Repository navigation
refactor(chat): one navigation decision for every link surface CU-17tkuw61kfy - #2883
Conversation
…f growing the answer A card whose record carries a video drew its player (a 16:9 box and its tab row) the moment it resolved, under a skeleton one row tall, and an embedded video marker drew one as the answer streamed: every recording made the chat jump. The card's footer row now carries "Watch video" beside Ask, and the player opens below the card only when the reader asks; a marker with no card of its own gets the same action on a row of its own (chat-video-toggle.tsx). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…height while loading A card's skeleton now draws its footer row too, its actions in their loading form (SourceActionButton and ChatVideoToggleButton take a loading prop). A card type whose records can carry a video declares it on its registry entry, so its Watch video slot is in the skeleton and stays reserved, unseen, on a record without one. The answer still being written draws its sources strip in its loading form (SourceChips loading), so the strip is there when the answer ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e chip on a phone Measured in the OpenFrame frontend on stage: in Mingo's narrow panel the two skeleton chips wrapped to a second row (93px) and the strip shrank to 61px when the answer ended. The skeleton row no longer wraps (a chip that does not fit is cut), and a phone draws one chip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… box Mingo's links to the app's screens ([Devices → Add Device](/devices/new)) were drawn in the colour of the text around them. The chat now draws a root-relative link as an inline chip in the Tag badge skin the host's entity mentions use, still routed through the host's NavLinkAnchor. The skin is exported (INLINE_CHIP_CLASS) so the host's mention chip uses the same box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline box (the Tag badge as a span, with its inline skin) is one component the lib exports. The chat's link to a screen of the app draws it, and so does the host's mention chip, instead of each drawing a Tag with a copied class string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…creen link marker Review of #2870: - A card's "Watch video" is now the generic ChatCardDisclosure, with a variants table (video today). It opens and closes like every other chat expander (ExpandChevron + useCollapsible), and the content unmounts when the close has finished, so a closed player is not playing out of sight. - A link to a screen of the app is no longer guessed from its path: the answer marks it with the link title "app-screen" ([Devices → Add Device](/devices/new "app-screen")). The marker lives in chat-protocol (APP_SCREEN_LINK_TITLE, appScreenLinkMarkdown, isAppScreenLink), shared with the hub's instruction to the model. - The skeleton chip's one-line spacer is a named constant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sclosures by kind Review of #2870: - No app-screen marker. Whether a link in an answer stays in the app is the runtime's one new-tab rule (computeIsNewTab, the decision the chat's cards and source chips make): a link it keeps in this window is drawn as the inline box, one it sends to a new tab stays a plain link. The chat-protocol export is removed. - Card disclosures are by kind: CHAT_CARD_DISCLOSURE.VIDEO (one entry per kind, IMAGE and the like next). A kind owns its action, how it finds its content on a fetched record (fromItem, the old itemVideoMetadata) and how it draws it. Registry entries declare disclosure: CHAT_CARD_DISCLOSURE.VIDEO; CardWithVideo is CardWithDisclosure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ted anchor The chat's link routing is unchanged: every link renders through the same NavLinkAnchor branch with the same href and props it always had. A link the runtime's own new-tab rule keeps in this window now only draws its label as InlineChip inside that anchor. InlineAppLinkChip, which built its own anchor ahead of the routed branch and dropped the link's props, is deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦩 Flamingo Code Review❌ Tests and checks failed on this commit: tests (npm). What each printed is in the Tests and mutation section. 9 findings: 🔴 1 action required · 🟠 4 recommended · 🔵 4 informational Advisory: findings do not block the merge. 9 defects outside any rule
🔴 Action required (1)
🟠 Recommended (4)
🔵 Informational (4)
✅ What this change does well
Inline comments: 9 new 4 possible problems checked and ruled out, 2 after reading more of the repository
🧪 Tests and mutationTests per lane
Tests failed in openframe-frontend-core: what it printed lastChecks
The one failing test, markdown-parity 'fenced-code-js', is a snapshot taken before highlight.js applied; this pull request does not touch the markdown renderer and the same test passed in two full runs of this branch, so it is a timing flake under load, not the change. Openframe-frontend-core has no Stryker setup, so no mutation testing ran: mutation coverage of the new code is a gap. React-embedding-example has no test runner; its navigate wiring is covered only by type-checking. 2 gaps (not tested here):
Change set
🤖 Prompt for AI agents: fix every findingNext: commit a suggestion, or hand a comment's prompt to your coding agent. React 👍 on a finding that helped and 👎 on one that is wrong: the reviewer learns from both. Review again. New commits are not reviewed until you ask:
Or comment Updated 2026-10-29 20:09 UTC · reviewed from Michael Assraf's machine |
The navigation decision has one owner: useNavLinkTarget (the href resolved for the runtime, and the new-tab rule on it), which useNavLinkViaRuntime now routes by. A markdown link renders through ChatMarkdownLink: the host's NavLinkAnchor with the same props, drawing its label as InlineChip when that decision keeps it in the app. The message renderer no longer reads the runtime or decides anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… surface navLinkTarget (nav-anchor-props) is THE decision: the href resolved for the runtime and the new-tab rule on it. Every surface reads it and every click goes through executeNavigation: - source chips render NavLinkAnchorViaRuntime (their own resolve, new-tab call, anchor attrs and click handler are deleted); - inline cards and their click wrapper, the card-link hook, the anchor hook and the executor itself call navLinkTarget; - doc search decides with navLinkTarget and executes with executeNavigationImperative (it had its own router.push / window.open); - related content's default link provider reads navLinkTarget. A host-composed relative route (hostRoute) stays in the window in every mode, for doc search (as before) and now for cards too. A gate test fails on any direct call to the decision primitives outside the routing module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… no router fallback Every same-tab link the lib opens goes through runtime.navigation.navigate; a target the host does not take is a browser navigation. The fallbackNavigate option is gone from the executor and its four callers, and the embedding example wires navigate like the hub and the OpenFrame app. The chat's source chips, Ask and Watch video actions meet the loading standard: each switches on useLoadingScope() || loading, the disclosure button draws its own loading form, and the strip's chips are marked list items with one loading chip at every width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/mcp-in-app-links
…econd way to navigate A link is followed through the lib's navigation executor only. The new rule in the shared ESLint config fails a fallback option handed to the executor (fallbackNavigate and the like) and any router push, location write or window.open in the same function as an executor call. It runs on every repo that uses the shared config; the hub and the OpenFrame app have no violations. The one bypass it found is fixed: doc search opened a tab by hand. The lib now opens a new tab in one place, executeNewTabNavigation, which the executor and the doc search both call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
So a host follows its own links through the lib's one decision and executor, not a copy of them: - useNavLinkViaRuntime takes a nullable href (null: no link) and openIn, the caller's explicit tab (an admin preview always opens a new one); the embed rule still comes first. - useNavigateViaRuntime follows a link from code (a button, a card's click, a redirect after a save); a modifier click opens a new tab through executeNewTabNavigation. - newTabRel / newTabFeatures is the one referrer rule for a new tab, anchors and window.open alike: a named platform, a host of one of our platforms or a path of this site keeps the Referer (cross-domain attribution); a third party gets noreferrer. NEW_TAB_FEATURES is gone. The lint rule counts useNavigateViaRuntime as following links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked against the hub's old useNavLink rules, case by case (12 hrefs x 4 platforms x 3 tab requests): the destination, the tab and rel agree in all 144 host-mode cases, and window.open's features in every case. Two fixes made them agree: - useNavLinkViaRuntime returns no link for any empty destination (null, undefined or ''), as the hub's hook did; one signature. - newTabRel counts only a path (/x) or a platform's host as our own site; a bare #anchor and a mailto: get noreferrer, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…view - Markdown links no longer need a chat runtime (a host anchor without one drew a crash), and the in-app chip keeps main's look (no underline, hover fill). - With no runtime, a link follows the lib's default rule (another origin opens a new tab), as related-content cards did on main. - handleChatNavClick, its input type and NavSurface are deleted. - Doc search decides a click once: the action carries the platform it was decided with and the executor runs on the same inputs. - Card links (useEntityCardLink, buildAnchorProps) use the one referrer rule. - The lib's own navigations go through the executor: announcement bar, vendor button, service card, ticket attachments, devices table, openInNewTab, contact form redirect, and the ticket alerts button (its onNavigate callback and window.location.assign fallback, and AppHeader's onTicketAlerts, are gone). - NavLinkAnchorViaRuntime takes openIn; hostRoute honours openIn: 'new-tab'. - Comments and module docs name the current API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A string href always yields a link, a middle click opens a new tab, a right click navigates nowhere, a relative contact redirect stays in the host's router, and the card footer's actions share one FooterAction with its own loading form. Tests for the announcement bar, the ticket alerts button, the contact redirect and a markdown link with no runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… answer draws EmbeddableChat takes sourceSkeletonCount (default 1): the chips the source strip under an answer draws while the answer is written. 0 draws no strip until the answer ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every link the lib renders or follows now decides where it goes in ONE place and executes in ONE place.
The decision:
navLinkTarget(runtime, href, targetPlatform, { hostRoute })(utils/nav-anchor-props.ts): the href resolved for the runtime (resolveHrefForRuntime) and the new-tab rule on that resolved href (computeIsNewTab). No runtime: the href as given, same tab (the executor's existing rule).hostRoute: a relative route the host'scomposeContentUrlreturned as its own stays in the window in every mode.The execution:
executeNavigation/executeNavigationImperative, which now readnavLinkTargettoo.ChatMarkdownLink→ hostNavLinkAnchor, label asInlineChipwhen the decision keeps it in the appcomputeIsNewTab+ anchor attrs + click handlerNavLinkAnchorViaRuntimecomputeIsNewTab/resolveHrefForRuntimenavLinkTargetcomputeIsNewTabnavLinkTargetdecideNewTabdirectly, ownrouter.push/window.opennavLinkTarget+executeNavigationImperativedecideNewTabdirectlynavLinkTargetBehaviour changes (all from moving onto the one rule):
rel="noopener"), as every other chat link already did.decideNewTabandopenExternal(before, it called the lib rule directly and openedwindow.openitself, a dead click in the OpenFrame app shell).Gate:
navigation-ssot.test.tsreads the source and fails on any direct call ofcomputeIsNewTab,decideNewTab,resolveHrefForRuntimeorisCrossOriginUrloutside the routing module. Onmainit would list 10 such calls; on this branch, none. Chat, shared, related-content, navigation and chat-protocol suites: 1087 pass.Change-Set: feat-mcp-in-app-links
ClickUp task: CU-17tkuw61kfy Refine Hub MCP responses with direct in-app links (e.g. device deployment)
Design-Doc: https://product-hub.flamingo.so/admin/design-docs/hub-mcp-server
🤖 Generated with Claude Code
Change set
flamingo-stack/openframe-oss-lib#2870: these pull requests are one change, reviewed together.Linked work
Linked by the
Depends-On/Change-Setlines in these descriptions; this block is maintained by the hub.