Skip to content

Fix opening cards in preview mode - #5684

Open
jurgenwerk wants to merge 1 commit into
mainfrom
cs-12425-in-card-navigation-buttons-do-nothing-in-the-code-mode
Open

Fix opening cards in preview mode#5684
jurgenwerk wants to merge 1 commit into
mainfrom
cs-12425-in-card-navigation-buttons-do-nothing-in-the-code-mode

Conversation

@jurgenwerk

@jurgenwerk jurgenwerk commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Clicking "Open" didn't work:

image

Card templates get their crud functions from the card-crud-functions
context, which only the interact-mode stack and host mode provided. The
code-mode preview pane rendered cards without it, so any in-card button
that calls `viewCard` did nothing at all: the function was undefined and
every call site guards with `?.`, so there was not even a console error.
The Workspace card's pinned tiles are the visible case — clicking Open in
the preview looked broken.

The pane already had a `viewCard` of its own for the hover overlays, which
navigates the code path. It now provides that through the context too, so
an in-card Open behaves the same way the overlay buttons above it already
do. The other crud functions stay undefined: a create, edit, or delete
button remains inert here rather than doing something a read-only preview
cannot honor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jurgenwerk jurgenwerk changed the title Let previewed cards navigate in the code-mode preview pane Fix opening cards in preview mode Aug 4, 2026
@jurgenwerk
jurgenwerk requested a review from a team August 4, 2026 13:03
@jurgenwerk
jurgenwerk marked this pull request as ready for review August 4, 2026 13:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1aca648f87

ℹ️ 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".

Comment on lines +232 to +235
@provide(CardCrudFunctionsContextName)
// @ts-ignore context is used via provider
private get cardCrudFunctions(): Partial<CardCrudFunctions> {
return { viewCard: this.args.viewCard };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Provide navigation to playground previews too

When previewing an instance selected from a .gts card definition, module-inspector.gts renders Playground (lines 653–660), whose playground-preview.gts renders CardRenderer directly rather than through PreviewPanel. Consequently, this provider is not an ancestor of that card template, so controls using viewCard remain inert in the module playground; the provider needs to cover that preview path as well, with a focused test for navigation from a definition's selected instance.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 53m 50s ⏱️
3 810 tests 3 796 ✅ 14 💤 0 ❌
3 829 runs  3 815 ✅ 14 💤 0 ❌

Results for commit 1aca648.

Realm Server Test Results

    1 files      1 suites   13m 51s ⏱️
2 032 tests 2 032 ✅ 0 💤 0 ❌
2 111 runs  2 111 ✅ 0 💤 0 ❌

Results for commit 1aca648.

@burieberry burieberry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is helpful but that teal color is not meant to be used by itself on light background for legibility reasons, even though ai loved to use it that way. Can we make the Open button a primary, secondary, or default boxel ui button?

@burieberry

Copy link
Copy Markdown
Contributor

This is helpful but that teal color is not meant to be used by itself on light background for legibility reasons, even though ai loved to use it that way. Can we make the Open button a primary, secondary, or default boxel ui button?

I see now that this button wasn't a new addition. In that case, up to you if you want to handle in this pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants