Repository navigation
The Library finds a passage inside its documents, cited by revision and place - #284
Merged
Merged
Conversation
…nd place Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…th and its row keys Hits from a server without revisions and locators render uncited. A passage and a ?doc= link open through one openByUri. Find is a BusyButton, hits are ListRows with their own row navigator that takes over from the list while they show, the panel mounts on a non-empty library keyed by place, and a full page says it is the best ten. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… a failed list The passages and the document list each keep their row keys while focus is in them, the count line alone is announced, matched keys are neutral chips, the panel is not shown above a list that failed to load, and the hit count's default lives in one constant. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…n leaving The panel shows once the place's list has loaded and stays through a later failed read. A hit shows its whole source address beside its file name and a two-line excerpt. A search still running when the panel goes is aborted, the hint says library, and searchKnowledge takes its hit count from the caller. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…tanding status line The folded panel took a row of its own, which pushed the first document below the list pages' layout budget; its toggle now sits in the toolbar (on a phone, beside the sort), with aria-expanded and aria-controls. The count is one role=status line present from the start, the hint says a tag filter does not narrow the search and describes the field, an excerpt is cut by code point, and the deep-link effect lists the place it checks. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…its state A hit's open button is named by its source and citation with the excerpt as its description, the hit list is busy while a new search runs, the toggle carries a chevron, the form no longer repeats the region's name, the toggle waits for this place's rows, and truncate cuts by code point for every caller. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…e their own block Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…heme listedScope clears on a new place, so a return visit whose read fails shows no toggle; the place effect folds the panel; truncate cuts between graphemes (a flag, a skin tone, a ZWJ sequence stay whole); tests pin j/k routing and the busy hit list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/library-search-locators
branch
from
November 6, 2026 09:15
d532cd4 to
d905800
Compare
A tag filter typed into an empty library no longer brings it up. passagesShown is passageHitsShown, after the prop that sets it, and truncate's accented-letter case is tested. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… per answer Show more asks for ten more of the query that was searched, up to the hundred knowledge.search lists. The hit list is memoised over the answer with a stable open, so a keystroke in the field renders only the field. A library that became empty takes the panel away, and its comment says so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…loads anywhere The segmenter is made on first use where the browser has one, else truncate cuts by code point, and collectionLabel uses it. The last Show more focuses the first hit it added; a failed one leaves the hits and the button beside the alert; a key the citation already names is not listed as matched again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… boundary A string of max units or fewer comes back whole again, so a card value one unit over its limit is still marked cut; the cut steps back to the last whole grapheme that fits, segmenting lazily. collectionLabel keeps its own character count. The passage toggle carries its chevron as Code's Advanced toggle does, and the design guide names that form. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… wherever it sits Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
knowledge.search keeps one hit per section, so an answer shorter than asked is no sign that nothing is left: the count reads as the best N while more may exist, and Show more goes once a read adds none or the op's hundred is reached. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
The wording follows whether a read has added nothing, not whether Show more is offered, so a list cut at the cap is not called complete. The knowledge page's link to the dashboard names finding a passage. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…panel Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
The test pins the namespace_scope the panel depends on, the hits asked and the answer read. Two comments name the passage panel beside the deep link, and the note on kept hits sits on the catch that keeps them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
The toggle sits in a toolbar that stays at the top as the list scrolls; without the focus, a panel opened low in the list opened out of sight. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
A library that became empty kept its scope, so a tag typed into it brought the toggle back over a namespace with nothing to search. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…identity Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
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.
Related: #157
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The dashboard's Library finds a passage inside its documents. Each hit is cited as an agent cites it: the document, the revision it was read from and where the passage sits, in lines, a key, pages or slides, or a sheet's rows. A hit opens its document.
Why
The issue's plan has the dashboard's Library show locator citations. Search hits carry the revision and locator since #252. Before this PR the Library could only filter its list by title, file name or tag, so a person could not find a passage inside the documents or see where an agent's citation points. #283 moved the Library's adds onto the extractor; this is the last dashboard piece of the plan.
Design
lib/locator.tsturns a hit's locator into words for its format, with the field meanings taken fromserver/knowledge/domain/extract/artifact.py::Locator:lines 10–24,line 4;key server.port;page 3,pages 3–5, or slides for a.pptx;Orders, rows 2–40.citationadds the revision: "revision 3, page 7".searchKnowledge(api/knowledge.ts) callsknowledge.searchfor the caller's number of hits in the namespace the Library shows (a collection's namespace included, as the list reads it), withnamespace_scope: "this".views/LibraryPassages.tsxis the "Find a passage" panel. Its toggle sits in the Library's toolbar (on a phone, beside the sort, under the search), and the panel mounts only while open, so a folded panel adds no height above the list. The toggle is a Click UIemptybutton with a chevron andaria-expanded, as the Code page's disclosure toggles are, and it also setsaria-controls.docs/development/dashboard-design.md's disclosure line now names that form beside the native button. It shows once the place's list has returned a document on this visit, and stays through a later filtered or failed read. An unfiltered empty read, such as after the last document is deleted, is an empty library and takes it away; once a document is back, the toggle returns folded. A tag filter typed into an empty library does not bring it up, and neither does one carried into another namespace whose filtered first read finds nothing, until the filter is cleared. Another namespace folds it; a search still running then is aborted.aria-describedby, says the search covers every document in the library whatever the tag filter, and how hits are cited.BusyButton, so it keeps focus while the search runs.knowledge.searchlists. The op keeps one hit per section (collapse_sections), so an answer shorter than asked is no sign that nothing is left. Show more stays until a read adds no passage or the cap is reached, and the count reads "The best N passages" until a read adds none, at the cap too. Arole="status"line, in the page from the start, announces the count ("The best passage", "The best 10 passages", "14 passages" once a read adds none, "No passage answers that.").lib/useLastPageFocus, as the list's Load more does). A failed search keeps the hits it would have replaced, beside the alert.aria-busy.ListRowwhose open button is named by what the row shows (the document's source, its section, the citation and the matched keys), with the excerpt as its description, and shows:truncate(lib/format.ts), which cuts it, keeps its limit in UTF-16 units: a string ofmaxunits or fewer comes back whole, whichMemoryCard's cut-value mark relies on. A longer one is now cut at the last boundary between the characters a reader sees that fits, so an emoji, a flag, a skin-tone or ZWJ sequence, or a letter with a combining accent is never split. It segments lazily, withIntl.Segmentermade on first use where the browser has one, else by code point, so the module loads on any browser.humanizeError.Documents.tsx, a hit and a?doc=link open through oneopenByUri. It opens from the rows already loaded, or throughfindDocumentfor a document past the first page, under one abort so a newer open wins. A link to a missing document drops?doc=; a hit whose document is gone says so in a toast.docs/features/dashboard.md, the dashboard link indocs/features/knowledge.md, and the disclosure line ofdocs/development/dashboard-design.md.Alternatives considered:
Scope and risk
knowledge.search, is unchanged, and the reach manifest already counts the dashboard's calls to it.knowledge.searchhas no cursor, so each Show more runs the whole search again with a largertop_k: another query embedding and, where the deployment's default reranker is a provider's, another reranker call, up to nine per query. The hits already shown can reorder with it.Compatibility, rollout and rollback
KnowledgeHittypes them as optional, and such a hit shows its document and excerpt with no citation.Tests
frontend/src/api/knowledge.test.ts:searchKnowledgeposts toknowledge.searchwith the namespace shown, the hits asked andnamespace_scope: "this", and answers itsresults.frontend/src/lib/locator.test.ts:frontend/src/views/LibraryPassages.test.tsx:frontend/src/views/Documents.url.test.tsx: in the Library:?doc=;jmove through the passages while focus is there, and through the documents once focus moves to a document row (the test fails with the hand-off removed);npm --prefix frontend run test(1,914),run build,run budgetandmake lint(Biome's accessibility rules included) pass. Playwright: the full run on the rebased head passed 496 of 497. The one failure,/admin/userstiming out before its heading appeared, passed alone, together with the list specs (93 passed). WithE2E_PORT=<port> npm --prefix frontend run e2e -- e2e/list-pages.spec.ts, the list-pages layout budget (first row at or above y = 300 on a desktop, 360 on a phone) failed with the panel's own toggle row (335 and 427) and passes with the toggle in the toolbar.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: the locator wording against the server's
Locatorfields, the panel and the open path in the tests above, and a review at every push.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code