Repository navigation
Filter the Page Map's groups on a search keystroke without re-deriving them - #5790
Conversation
…g them A keystroke in the Page Map search ran the whole sheet render: it read every entry's passage text (says(blockAt(...))), rebuilt marginMapGroups, re-rendered the keyed list and reconciled every contribution's map controls, although only which groups are hidden depends on the query. The groups and their search text now derive when the entries change or the map opens, and the search's input event only sets each group's hidden flag and the empty status. Refs #5722
|
@leaf-agent The search optimization now splits Page Map visibility from Lit:
|
The search keystroke wrote each group section's hidden attribute through dialogList.children[index], beside Lit's render of the same sections: a second renderer for generated UI, coupled to the keyed list's child order. Lit's ?hidden binding owns the attribute again. The groups and their search text still derive only when the entries change or the map opens (deriveSheet), and a keystroke re-renders the keyed list with the new query (drawSheet). Each group's heading and rows sit in guard([group]), so an unchanged group skips its content and the keystroke updates only hidden and the empty status. No behavior changes from the previous commit. Refs #5722
|
Done in 9979403: Lit's The search gain mostly holds. With 400 groups, one |
A keystroke in the Page Map search re-derived the entire sheet.
inputran the full render, which read every entry's passage text (says(blockAt(targetFor(entry)))), rebuiltmarginMapGroups, re-rendered the keyed list and reconciled every offer's map controls. Only which groups are hidden depends on the query. NowderiveSheetderives the groups, their search text and the offer reconciliation when the entries change or the map opens. The search'sinputruns onlydrawSheet, which renders the keyed list again with the new query. Lit's?hiddenbinding still owns each section's visibility. Each group's heading and rows sit insideguard([group]), andderiveSheetreplaces the group objects only when the entries change, so a keystroke updates onlyhiddenand the empty status.A keystroke still checks every group's search string, since the filter is a scan, but it no longer reads passages or re-renders rows.
Measurement and checks
Median time for a synchronous dispatch of one search
inputevent, over 30 queries in headless Chromium. Each page had N comments, one per section, with the Page Map open. The probe was a throwaway browser test and isn't committed. It doesn't include style or layout after the handler, so its numbers are lower than the earlier table, which timed differently.hidden+guard(head)pnpm run checkpasses.tests/browser/margin/test_page_map.pypass:-k "search or reconciliation or g_shift or small_screen or reconciles", 9 tests and 2 subtests. They cover filtering in place, the empty status, the walk over filtered rows and reconciliation while a query is set.This is item 4 of #5722.
obligationsIn(item 2),lf-toc's measuring (item 3) andmessageHoldingare untouched.Refs #5722 — automated triage