Review R4, search: a name match comes first, results open under their box, and the prep drawers can preview (#1020) #1026
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/1020-search-exact-first"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #1020, the owner's 1 October review. The last of its four PRs.
"Search does not put the exact result at the top (when I search for Odile I get Bastian at the top)." (l8-front, l6-lookups)
A wiki search had no ranking. Results came back in the wiki's browsing order (
ORDER BY entry_type, title), andplayer_characteris declared beforenpc, so a character who mentions her always came before Odile Marsh. Every search box inherited it.app/services/search_rank.pyis the one ranking: the name is the query; the name starts with it; a word in the name starts with it; the same three for aliases; then everything else, in the order that search had before. Case, accents and extra spaces are folded.GET …/lore?search=and thewikikind ofsearch-all: the app bar, the wiki front page, Table mode's Find, the prep Wiki drawer, the discussion pickers), the rules search (the Rules & bestiary drawer, Find, the sheet pickers), and the people and sessions the app bar finds..titleread; the allowlist tests pass unchanged."The results box is not under the search box, but is instead off to the right side." (l8-front)
The wiki front page's panel was hung from the right edge of a full-width row. It now starts at the box's left edge, directly under it, at the box's width, at every width.
"There's also no way to preview rules or items in the wiki." (l6-lookups)
In the prep sheet's Wiki and Rules & bestiary drawers (and Planning's), a result's title opens a preview inside the drawer: the same one Table mode's Find uses, with Insert (Keep on Planning) and "Back to results". Escape goes back to the results, without closing the phone's Tools sheet; focus returns to the title it came from; the preview is brought into view when it opens. Catalogue row IS-472.
"The bottom of the wiki search list is cut off by the footer." (l6-lookups)
The tool margin was sized to the window (
100dvh − 6rem) while it sticks inside the page's scroller, which is shorter by the app bar and any banner, so its last rows sat past the scroller's edge. It is sized to the scroller now (useScrollerHeight). Re-checked on top of #1024, where the footer joined the page's scroll.Also fixed (on main already)
Table mode's Find rows were wider than their list (the grid's one column sized to the longest snippet), so the list scrolled sideways and snippets were cut at its edge. Rows now fit and the snippet ends in an ellipsis. "In the sheet" no longer wraps to three lines on a phone.
Checked
coverage/lane*.pyand the changelog check pass.tests/test_search_ranking.pyis new (36 tests)./askhas its own query).docs/API.mdhas a "Search order" section.Noted, not changed
Every list stops at ten results without saying so. The preview shows a page's summary where it has one, not its full text, as Find's does. A preview scrolls into view twice in quick succession on a phone (once on open, once when the entry arrives).
🤖 Generated with Claude Code