Skip to content

Enhance broken/missing linked-card overlay UI (CS-11318)#5093

Merged
habdelra merged 4 commits into
mainfrom
cs-11318-broken-link-overlay-ui
Jun 4, 2026
Merged

Enhance broken/missing linked-card overlay UI (CS-11318)#5093
habdelra merged 4 commits into
mainfrom
cs-11318-broken-link-overlay-ui

Conversation

@habdelra

@habdelra habdelra commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Refines the placeholder and reveal overlay shown when a linksTo / linksToMany reference is missing or fails to load (CS-11318).

What changed

  • Atom placeholder is 28px tall with a 10px gap between the card-type label and the caution triangle.
  • The broken reference is read-only 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 inside the panel instead of clipping past the card edge. The header (title + copyable URL) and the action row stay pinned while the body scrolls.
  • 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 mode, a code-editor jump in code mode.

viewCard is threaded down to the placeholder from the linksTo and linksToMany field components. The reveal tip/beak geometry is unchanged; it anchors to the overlay corner via CSS anchor(), 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:

Broken-link overlay — not-found and error-with-scroll states

Error overlay detail — status, stack, additional-errors accordion, and the pinned "Open anyway":

Error overlay detail

Atom placeholder (28px, 10px gap):

Atom placeholder

Tests

Extends linksto-broken-link-placeholder-test with a regression test asserting the reference is not an anchor, the copy affordance is present, and "Open anyway" navigates via viewCard. Full broken-link placeholder suite (singular + plural, 20 tests / 84 assertions) passes.

🤖 Generated with Claude Code

habdelra and others added 3 commits June 3, 2026 15:22
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>

@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: 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".

Comment thread packages/base/default-templates/broken-link-template.gts

Copilot AI 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.

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 viewCard from links-to field components into BrokenLinkTemplate to support an “Open anyway” navigation action.
  • Update BrokenLinkTemplate overlay UI to render the broken reference as plain text with a CopyButton, 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.

Comment thread packages/base/default-templates/broken-link-template.gts
Comment thread packages/base/default-templates/broken-link-template.gts Outdated
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   1h 54m 7s ⏱️
2 933 tests 2 918 ✅ 15 💤 0 ❌
2 952 runs  2 937 ✅ 15 💤 0 ❌

Results for commit 2584ee2.

Realm Server Test Results

    1 files      1 suites   10m 34s ⏱️
1 549 tests 1 547 ✅ 1 💤 1 ❌
3 280 runs  3 277 ✅ 2 💤 1 ❌

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>
@habdelra habdelra requested a review from a team June 3, 2026 20:23
@habdelra habdelra merged commit c8f4866 into main Jun 4, 2026
100 of 102 checks passed
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