Repository navigation
refactor(frontend-core): one citation chip grammar for the server and the renderer CU-17tkuw61kfy - #2897
Merged
Conversation
… the renderer CU-17tkuw61kfy The [N] chip grammar lived in two readers here (the strip of cited sources and the renderer that hides chips) and a third copy in the hub that writes them. chat-protocol/citation-chip.ts is now the one definition: formatCitationChips, stripCitationChips and citedSourceNumbers. A removed chip takes the space before it, so no doubled space is left to collapse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
Contributor
🦩 Flamingo Code ReviewNot reviewed yet. Reviews start when you ask, so the reviewer reads this pull request when it is ready, not when it is opened. When it is ready:
Or comment Updated 2026-10-30 14:32 UTC · workflow run |
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
chat-protocol/citation-chip.ts: the one[N]citation chip grammar, exported from./chat-protocol:formatCitationChips(numbers):[1][3]stripCitationChips(text): removes chips standing apart from a word, with the space before themcitedSourceNumbers(text): the numbers cited, in first-mention orderremarkStripCitationsandsplitCitedSourcesread it instead of their own regexes.Why
The hub writes the chips and strips the numbers a model types; the renderer reads and hides them. That was three copies of one grammar (review on multi-platform-hub#1737). The hub moves onto this export once it is released.
Behaviour
the guide [3] covers itreadsthe guide covers itwith no collapse pass.splitCitedSourcesnow reads every number of a comma list ([1, 2]) and ignores an index glued to a word (argv[1]), the rule the renderer already used.Tests:
citation-chip.test.ts, plus the chat suites (979 passed).Change-Set: feat-mcp-in-app-links
🤖 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.