Repository navigation
Description
Problem
The system prompt tells the assistant exactly what a good reading answer contains: "Cite file paths and useful page, line or cell references" (ui-packages/web/src/features/assistant/system-prompt.ts:5). So the answers come back as "the method is described in paper.pdf, page 12" — and there the citation stops being useful. The reader's only path to that place is to leave the conversation, find the file in Files, open it, and navigate by hand; in a long PDF the navigation itself is what #177 calls dragging blind.
The moment that should complete the citation exists and is deliberately constrained: the open tool, whose description says "open a file only when the reader asks or a task needs it active" (ui-packages/web/src/features/assistant/tools.ts:112-116). But its schema is Type.Object({ fileId }) — no place. A reader who says "take me there" gets the file opened at page 1, and the answer's "page 12" lands nowhere.
Everything the missing half needs is already built and already speaks the vocabulary:
readtakes one-based inclusive line and PDF page ranges (tools.ts:44-46) — the assistant already names places in exactly these terms.openFile(fileId, place)plus the reveal actions handle page, sheet and scroll targets generically (ui-packages/web/src/features/workspace/workspace-context.tsx:153-157), and the PDF reader lands on a revealed page (ui-packages/web/src/features/reader/pdf-reader.tsx:27-34).- A note's
[[paper.pdf#page=12]]jumps straight to page 12 — the same place the chat answer names is clickable from a note (Let readers follow the links in their own notes — [[wiki-links]] render as plain text while the assistant walks the graph #95) and inert from a conversation, where anchors only render for http(s) (ui-packages/web/src/components/markdown.tsx:56-60).
Proposal
- Give
openan optional place — the page, line or cell reference the tools already use — forwarded to the existingopenFile(fileId, place)reveal path, so the licensed "open when the reader asks" lands where the answer said. - Say so in the tool description and the citation line of the system prompt: when the reader asks to see a cited place, open it at that place.
Goal
After this, "take me there" opens the cited file at the exact page, line or cell the answer named — the citation the assistant already writes and the reader's landing place become the same place, with no hand navigation in between.
Verification
grep -n -A3 "'open'," ui-packages/web/src/features/assistant/tools.ts | grep -qE 'page|place'
pnpm --filter @gamma-reader/web test --silent
pnpm checkRefs
- ui-packages/web/src/features/assistant/tools.ts:112-116 —
openwith{ fileId }only, the gap this fills - ui-packages/web/src/features/assistant/tools.ts:44-46 —
readalready speaks line and page ranges - ui-packages/web/src/features/workspace/workspace-context.tsx:153-157 —
openFile(fileId, place)and the reveal actions, generic over page/sheet/scroll - ui-packages/web/src/features/reader/pdf-reader.tsx:27-34 — a revealed page is where the PDF opens
- ui-packages/web/src/features/assistant/system-prompt.ts:5 — the citation instruction whose output this makes followable
- ui-packages/web/src/components/markdown.tsx:56-60 — chat anchors render for http(s) only; the display-side face of the same gap
- Let readers reopen the files a message named with @ — they render as plain text, while attachments open on click #168 — the sibling gap for the reader's own @ references; this one is the assistant's citations
- Let readers follow the links in their own notes — [[wiki-links]] render as plain text while the assistant walks the graph #95 — notes' links already jump to a page; this is the conversation's turn
- Let a reader see where they are going in a bookmark-less PDF — the outline button vanishes today and the page slider drags blind #177 — why finding page 12 by hand in a long PDF is the wrong ask
- ui-packages/web/PRODUCT.md — "Precise": an answer that names a place should be able to deliver the reader to it
Activity
bencode commentedon Oct 23, 2026
Independent review — posted by the scheduled issue-reviewer loop (a session separate from the one that files these issues), under the maintainer's standing instruction to evaluate, sharpen, or retire
source:scheduledproposals. Audited againstmain@fc25139.Evidence audit: substance fully confirmed; one citation drifted by a few lines.
tools.ts:104-108(cited:112-116— that range is themovebind; drift, substance exact) —open's description contains "open a file only when the reader asks or a task needs it active" verbatim, and its schema is exactlyType.Object({ fileId })— no place.:44-47—readspeaks "one-based inclusive line or PDF page range" as claimed.workspace-context.tsx:153-157—openFile(fileId, place: RevealTarget | null)→actions.reveal(fileId, place)+ open: the generic landing path exists and is unused byopen.pdf-reader.tsx:27-34— a revealed page is where the PDF opens (verified this loop in Let a reader follow a PDF's own links — a 'see Figure 3', citation or table-of-contents click does nothing today #189's audit too).system-prompt.ts:5— "Cite file paths and useful page, line or cell references" verbatim.components/markdown.tsx:56-60— non-http(s) chat hrefs renderundefined(inert anchor), so a citation in the transcript indeed cannot carry the reader anywhere today.Sensor:
lint✓;verify✗ on main → stays open. The anchor (page|placewithin 3 lines of the'open',bind) is deliverable-shaped — bind's fixed structure (name → description → schema) puts any place/page addition in range.Sharpening, one scope note:
markdown.tsx:56-60is the display-side face of the same gap — even with the tool fixed, a[[paper.pdf#page=12]]written by the assistant in chat stays inert because chat anchors only render http(s). The proposal correctly fixes the tool path ("take me there"); if the maintainer also wants citations clickable in the transcript, that is a second, separable change (rendering reader-fragment/wikilink anchors in the chat variant) worth its own decision rather than scope creep here.Verdict: valid, keep open. No commit implements or invalidates it.
bencode commentedon Oct 24, 2026
Independent re-review — posted by the scheduled issue-reviewer loop, independent of the session that authored this issue. Audited against
main@90b046f; last review stood atmain@fc25139.Drift check: 15 commits since the last review; two touch the cited area —
6d92ea4(read_conversation tool) and7a022aa(document-access.ts refactor). Neither implements the proposal.Evidence audit: substance intact; anchors moved 1–2 lines —
tools.ts—opennow binds at:105-108: description with "open a file only when the reader asks or a task needs it active" verbatim at:106, schema stillType.Object({ fileId })at:107. The issue's cited:112-116anchors themovetool (drift the prior review already flagged, +1 from read_conversation).read's "one-based inclusive line or PDF page range" at:44-46— exact ✓workspace-context.tsx—openFile(fileId, place)now at:154-158(cited:153-157) ✓;pdf-reader.tsx:27-34reveal-page open ✓;system-prompt.ts:5citation line verbatim ✓;markdown.tsx:56-61— chat anchors still render only reader#-fragments and http(s) ✓Duplicate check (open + closed titles): none.
Sensor:
lint✓;verify✗ on main — nopage|placenear theopenbind, so not implemented.New sharpening from the refactor:
7a022aamoved the assistant's open execution intocreateReaderDocumentAccess—document-access.ts:31isopen: async (fileId, signal), no place. The fix now crosses that module boundary: threadplacethrough the access module, or fire the existingopenFile(fileId, place)reveal path from the bind. The prior review's display-side note stands unchanged (assistant-written[[paper.pdf#page=12]]stays inert in chat,markdown.tsx:57-61).Verdict: still valid, keep open.