Repository navigation
feat(native): cite assistant selections in the composer - #96
Merged
Merged
Conversation
This was referenced Nov 3, 2026
Open
rynfar
force-pushed
the
nw/92-citations
branch
from
November 3, 2026 04:03
b8a983a to
438fefe
Compare
rynfar
force-pushed
the
nw/92-citations
branch
from
November 3, 2026 04:19
438fefe to
35b9abb
Compare
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.
Assistant text selections had no citation action or composer citation editor in the native client. This ports an initial TR-CITE slice: the Cite toolbar, citation chips with optional comments, web-compatible
t3-citation://v1links carried through the existing prompt/draft/send path, and source-row reveal with bounded history paging.The toolbar uses the pinned markdown renderer's existing shared selection, retaining links, highlighted code and normal copy handling. Pure UTF-16 selector, serialization/validation, dismissal, history and phase rules live in
t3-corewith cases mirroring the web tests. Selection state is bounded; nothing repaints continuously. The snapshot driver gains--typefor focused text input.Citation insertion uses the active caret, including backward selections, and preserves the retained prompt text; cancellation removes only the new link and inserted spaces. Selectors exclude renderer-added trailing paragraph whitespace and refuse repeated or overlapping matches. Chips retain original link bytes and ranges for editing/removal. Comment drafts settle before a question stashes the prompt and retire when the prompt is replaced. Open comment editors relocate by unique raw link bytes on every prompt edit; missing or duplicate links close the editor and unblock Send. Each source activation can retry an old page error, and Escape cancels pending navigation independently of the selection toolbar.
TR-CITE remains partial, and #92 stays open. Remaining gaps:
Verification:
cargo clippy --workspace --all-targets -- -D warningscargo test --workspace -- --test-threads=1: 1,025 tests passed serially after rebasing on fork/native, including the three latest regressions first observed failing without their fixes.vp run check:changed fork/nativepassed.Connecting → Connected, shell/config synchronized, showcase threadstatus=completed,runtimeMode=auto-accept-edits, no pending requests.Local offscreen evidence (absolute paths on Trevor’s machine):
/tmp/t3-92-source-before.png/tmp/t3-92-toolbar.png/tmp/t3-92-chip-editor.png/tmp/t3-92-final-comment.png/tmp/t3-92-code-selection.png/tmp/t3-92-keyboard-verified.png/tmp/t3-92-cancel-verified.pngAdditional local offscreen regression evidence:
/tmp/t3-92-review-cite-at-cursor.png/tmp/t3-92-review-preserved-prompt.png/tmp/t3-92-review-final-word.png/tmp/t3-92-review-raw-link.png/tmp/t3-92-review-raw-saved.png/tmp/t3-92-review-raw-removed.png/tmp/t3-92-review-raw-shifted-saved.pngLatest local offscreen regression evidence:
/tmp/t3-92-last-backward-caret.png/tmp/t3-92-last-comment-moved.png/tmp/t3-92-last-comment-removed.png/tmp/t3-92-last-comment-ambiguous.pngBuilt with GPT-6.1 Sol in Codex