Add ability to view default edit-template in interact context menu#4391
Add ability to view default edit-template in interact context menu#4391burieberry wants to merge 3 commits intomainfrom
Conversation
Preview deployments |
a012200 to
0f23581
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 408ef22b52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR adds an “Edit Fields” action to Interact-mode context menus that opens a card in the default/base edit template (instead of a card’s custom static edit template), with logic to only show the option when appropriate based on whether the card type has a custom edit template.
Changes:
- Add
CardDef.hasCustomEditTemplateand use it to conditionally show an “Edit Fields” menu item in Interact context menus. - Plumb a
useDefaultEditTemplateflag through view/edit flows and stack state so cards can be opened in edit format while forcing the baseCardDeftemplate. - Add/extend unit + integration test coverage, and update realm indexing expectations for the newly referenced icon.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/host/tests/unit/card-def-menu-items-test.ts | Adds unit tests asserting when “Edit Fields” appears in Interact menu items. |
| packages/host/tests/integration/realm-indexing-test.gts | Updates expected indexed icon URLs to include the new forms icon. |
| packages/host/tests/integration/components/overlay-menu-items-test.gts | Adds integration coverage for overlay menu visibility and default-edit behavior when clicking “Edit Fields”. |
| packages/host/app/services/operator-mode-state-service.ts | Extends editCardOnStack to carry an optional useDefaultEditTemplate flag into the stack item. |
| packages/host/app/lib/stack-item.ts | Adds useDefaultEditTemplate to stack items and ensures cloning preserves it. |
| packages/host/app/components/operator-mode/stack-item.gts | Passes @codeRef={{baseCardRef}} to CardRenderer when default-edit-template mode is requested. |
| packages/host/app/components/operator-mode/overlays.gts | Extends overlay open/select/view plumbing to carry useDefaultEditTemplate. |
| packages/host/app/components/operator-mode/operator-mode-overlays.gts | Adds “Edit Fields” to overlay context menu (including prerendered/string targets) and passes through the new flag. |
| packages/host/app/components/operator-mode/interact-submode.gts | Extends view/edit actions to accept useDefaultEditTemplate and handles cards not already on the stack. |
| packages/base/menu-items.ts | Adds “Edit Fields” to default Interact card menu items (only for cards with custom edit templates). |
| packages/base/card-api.gts | Adds CardDef.hasCustomEditTemplate and updates EditCardFn to accept options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
i know that you are checking to see if the card is in the store first so that you don't end up loading every card in the grid in order to see if you should show an edit view--which is good, otherwise that defeats the purpose of prerendering. but won't it also be confusing to the user that sometimes they see the edit item in teh menu and sometimes they don't all because of whether the store decided to load the card or not? it seems like it might be flaky |
f359e81 to
3d797b9
Compare
Yes, we've actually changed this and now the switching between custom and default templates is only from isolated and edit view of a card in interact mode. I've updated the PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52418c3b92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
52418c3 to
6034d2b
Compare
Uh oh!
There was an error while loading. Please reload this page.