Repository navigation
feat(quotes): render citation previews as markdown - #612
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 13, 2026 08:55
nixuuu
added a commit
that referenced
this pull request
Nov 13, 2026
Short citations opened a fixed-width (320 px) card, padded by the selection's leading/trailing line breaks (user screenshot: one short line in a large card). - Citation hover card and composer citation preview: `w-max` up to `min(20rem, 100vw - 1rem)`. - `citationPreview` trims the quoted text and the note. - `HoverCard`: a caller's class replaces the default `w-72` instead of adding a second, conflicting width utility. Text sizes already follow the overlay density (docs/ui-scale.md); the large font in the report came from a build before #612. Related: #612 ### Copy audit (docs/copy.md §8) No UI text changed. ### Checks install, typecheck, lint, format:check and the quotes domain tests clean locally; full tests and web build in CI. Not yet checked in a browser.
nixuuu
added a commit
that referenced
this pull request
Nov 13, 2026
Current `dev` already renders ranged citations inline in sent and queued mobile messages. Share the pure UTF-16 range helper between composer spans and sent-message Markdown so both paths retain the same model, and cover it with five regression tests. Legacy quotes without ranges keep their block presentation until the queue editor applies `inlineLegacyQuotes`. The viewer already shows the full, literal note in a scrollable view. Keep the same chip convention as web, without an additional note indicator. No native code, dependencies, configuration or web UI changes. ## Diagnosis and installed bundle - The parent of #591 unconditionally rendered every quote through `MessageQuotes` and passed only mention ranges to Markdown. Its older protobuf schema also lacked citation ranges. That implementation matches the reported blocks plus raw placeholders. #591 added both the mobile range model and inline renderer; #612 retained notes in `CitationViewer`; #628 changed the web note editor only. The inspected current-dev rendering path and pure protobuf/range/sentinel tests do not reproduce the reported model failure. Device rendering remains unverified, so an older installed bundle is the supported explanation, not a confirmed observation of the user's installation. No `Fixes` attribution is warranted. - The first release containing #591 is `v0.2.0-nightly.146`. Publication is confirmed in [Mobile release 43333842969](https://github.com/itsoltech/canopy/actions/runs/43333842969): Android OTA group `e48b25a0-804b-417e-a044-a528b9cb526e`, update `01a1d239-0f22-7654-ad93-bbfc752d4c00`. - The later [nightly.147 publication](https://github.com/itsoltech/canopy/actions/runs/43342358688) is also confirmed: Android OTA group [`1c21f61a-57a6-4dc3-ba1d-43d357c3d3ef`](https://expo.dev/accounts/itsol/projects/canopy-mobile/updates/1c21f61a-57a6-4dc3-ba1d-43d357c3d3ef), update `01a1d274-0b11-71a1-9aa6-37106c5b9608`, commit `31c7f87825b9756d8b1adf677f506519f248f770`. Both Android updates target runtime `5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. A compatible nightly installation needs to run that OTA or later; a different native runtime needs a matching build rather than that OTA. Updating desktop alone does not update the mobile JS bundle. Related: #591, #612, #628 ## Verification - Passed with `nice -n 19`: install, generated-code check, final-head typecheck, lint, formatting check, web build, and the full test inventory through the repository's four `check:tmp` shards: **2753 pass, 166 skip, zero failures**, 513 files, and no test temp leftovers. Shards 1–3 used the standard command; shard 4 passed with `--isolate --parallel=2`. - The default local shard 4 twice failed the unchanged startup recovery test in `prompt-after-turn-end.test.ts` (`backgroundTasks`: expected 2, received 1). Its entire file passed separately (6 tests), and the full shard passed with Bun's built-in file isolation. No assertions or gateway code were changed. The exact interference between files was not investigated in this mobile change. [Standard GitHub CI](https://github.com/itsoltech/canopy/actions/runs/43418493981) is green on `2be705574aeb9b2c6d8785f59af95a81da4211e4`, including all four default test shards, static checks and builds. - Tests cover the reported two-note message after protobuf decoding (including `start: 0`), citation-only and adjacent tokens, reversed quote order, UTF-16 offsets around emoji and attachments, legacy queue conversion, truncated labels, and full multiline notes. No UI tests added. - `expo-updates fingerprint:generate` before/after JSON comparisons are empty for both platforms: iOS `74705db3a68907bc28379bb9b1080a227bc0755b`; Android `7d38be8f5c9bf842d62060c75820a206f99c87e3` (same local configuration and environment). - Device check unavailable: MacStudio returned `Device list failed: Could not communicate with device support. Try refreshing devices.` Refreshing once and attempting `device_open` for the requested Android device returned the same error. No other device session was touched, no EAS build or OTA was started, and native visual/layout behavior is unverified. ## Copy audit No UI copy changed. Existing `Citation`, `Copy quote` and source actions remain unchanged; labels and notes retain their existing presentation. The helper tests verify label truncation and unabridged notes, but do not replace a visual check.
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.
Render citation bodies as safe Markdown in sent-message and composer previews, with compact headings, task lists, links, formatted code and bounded scrolling. Show the source caption and GitHub link separately; keep citation notes literal. Mobile uses its existing native Markdown renderer in a lazily mounted citation viewer.
Whole-message citations retain their source under
agent_message_markdown. Existing rendered thread selections stay plain; PR selections usetext_selection, preserving owner-scoped PR source resolution. Only PR comment/review bodies and explicitly marked whole messages render Markdown. Shared domain helpers clean chip labels and composer title fallbacks without lexing every chip.Validation
nice -n 10:bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check,bun run --filter @canopy/web build, and the fullbun run check:tmppass. The full run reports 2678 passing tests, zero failures, and nothing left in its temp directory.Copy audit — docs/copy.md §8
@claude[bot] · **Claude finished …→@claude[bot] · Claude finished …: remove presentation syntax from markdown-source labels and title fallbacks. Literal source punctuation stays unchanged.Open on GitHubaction, and literal note: each part has one purpose.Open on GitHubremains a three-word imperative in sentence case. MobileCopy output→Copy quotenames the content being copied.