Enhance broken/missing linked-card overlay UI (CS-11318)#5093
Conversation
Refine the placeholder + reveal overlay shown when a linksTo/linksToMany reference is missing or fails to load: - Atom placeholder is 28px tall with a 10px gap between the type label and the caution triangle. - The broken reference is informational text, never a clickable link; a copy-to-clipboard control sits to its left (the same CopyButton the AI assistant uses for code blocks). - The overlay is a fixed 350px wide, floored at 155px and capped at 600px. The cap is further clamped to the room available inside the bounding card so a tall error scrolls internally instead of clipping past the card edge. - An "Open anyway" action pinned at the overlay bottom navigates to the broken reference via the field component's viewCard (a stack visit in interact, a code-editor jump in code). viewCard is threaded to the placeholder from the linksTo and linksToMany field components. The reveal tip/beak geometry is unchanged; it anchors to the overlay corner so it tracks the resized panel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de92930670
ℹ️ 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 refines the broken/missing linksTo / linksToMany placeholder + reveal overlay UI, adding a non-linking URL display with copy affordance and an “Open anyway” action wired through viewCard, along with overlay sizing/scroll behavior updates and a regression test.
Changes:
- Thread
viewCardfrom links-to field components intoBrokenLinkTemplateto support an “Open anyway” navigation action. - Update
BrokenLinkTemplateoverlay UI to render the broken reference as plain text with aCopyButton, and adjust overlay sizing (fixed width + min/max height with internal scrolling). - Extend integration coverage to assert non-linking behavior, presence of copy control, and “Open anyway” behavior via
viewCard.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/host/tests/integration/components/linksto-broken-link-placeholder-test.gts | Adds a regression test for non-linking URL, copy affordance, and “Open anyway” navigation via viewCard. |
| packages/base/links-to-many-component.gts | Wires crud.viewCard into broken-link rendering for linksToMany placeholders. |
| packages/base/links-to-editor.gts | Wires crud.viewCard into the singular broken-link placeholder rendering. |
| packages/base/default-templates/broken-link-template.gts | Implements the updated overlay UI (copy + non-link URL) and adds “Open anyway” CTA plus overlay sizing/scroll behavior. |
| packages/base/card-api.gts | Passes cardCrudFunctions.viewCard into the BrokenLinkTemplate for singular linksTo rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Preview deploymentsHost Test Results 1 files 1 suites 1h 54m 7s ⏱️ Results for commit 2584ee2. Realm Server Test Results 1 files 1 suites 10m 34s ⏱️ Results for commit 2584ee2. For more details on these errors, see this check. |
Address review feedback on the broken-link overlay: - "Open anyway" now only offers to navigate http(s) references. The CTA forwards the reference into viewCard, so non-http protocols (javascript:, data:, …) are rejected — the same safety posture the plain-text URL display already keeps. Adds a parseHttpUrl helper shared by canOpen and openAnyway. - The room-based height clamp no longer collapses the overlay to 0px when a card is too short to fit it (trigger pinned near both edges). It floors at a usable height so the panel stays reachable, overflowing rather than vanishing — the accepted fallback for very small cards. Adds a regression test that "Open anyway" is withheld for a non-http(s) reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refines the placeholder and reveal overlay shown when a
linksTo/linksToManyreference is missing or fails to load (CS-11318).What changed
CopyButtonthe AI assistant uses for code blocks.viewCard— a stack visit in interact mode, a code-editor jump in code mode.viewCardis threaded down to the placeholder from thelinksToandlinksToManyfield components. The reveal tip/beak geometry is unchanged; it anchors to the overlay corner via CSSanchor(), so it tracks the resized panel and re-orients to whichever corner faces the placeholder.Overlay states
Not-found (155px floor) and a failed-to-load error capped at 600px with an internal scrollbar; both show the copyable URL and the tip pointing back at the placeholder:
Error overlay detail — status, stack, additional-errors accordion, and the pinned "Open anyway":
Atom placeholder (28px, 10px gap):
Tests
Extends
linksto-broken-link-placeholder-testwith a regression test asserting the reference is not an anchor, the copy affordance is present, and "Open anyway" navigates viaviewCard. Full broken-link placeholder suite (singular + plural, 20 tests / 84 assertions) passes.🤖 Generated with Claude Code