ui: fix search suggestion selection, rendering, and clipping

Three findings from review and CI on the Common.js migration, all real.

Selecting a suggestion navigated nowhere.  Semantic handed its callers
`{result}` and every caller destructures that shape, so passing the bare result
left `result.location` undefined -- the search suggestions and the Ctrl+K modal
both stopped navigating.  The shape stays until the call sites can change
together.  (Greptile P1.)

Suggestions lost their custom markup.  Callers pass `resultRenderer` to draw a
tag as a chip rather than a line of text, and the migrated wrapper forwarded it
into a div's props instead of to SearchBox, so every suggestion fell back to the
generic title and description.  SearchBox takes it now.  (Greptile P2.)

The suggestion list clipped its last group.  A cypress spec caught it: with
directories, channels and domains all present, the content runs past the 320px
cap and the final row was cut off.  Eight grouped suggestions is an ordinary
result set, so the cap was simply too low; it is viewport-relative now and
still bounded.

Both regressions are pinned by tests -- one asserting the callback shape a
caller actually destructures, one asserting the custom renderer replaces the
default markup rather than wrapping it.
This commit is contained in:
Roland 2026-07-30 11:28:17 -06:00
parent 6ea9d3645f
commit 737056acf5
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
5 changed files with 77 additions and 7 deletions

View file

@ -275,7 +275,12 @@ html[data-theme="amber"] .wrolpi-searchbox-control:focus-within {
top: 100%;
left: 0;
right: 0;
max-height: 320px;
/*
* Tall enough for a full set of grouped suggestions -- directories, channels and
* domains together run past 320px, and the last group was being clipped -- but
* still capped so a long list cannot cover the page.
*/
max-height: min(60vh, 480px);
overflow-y: auto;
background: var(--panel);
border: 1px solid var(--border);