8356
Wx
www-xonecas-io / files
www-xonecas-io / tickets / 1037-needs-a-autoselect-dropdown.md
2.2 KB
1--- 2id: 1037 3title: needs a autoselect dropdown 4type: feature 5status: done 6priority: p2 7created: 2026-11-08T05:20:43Z 8updated: 2026-11-08T16:01:13Z 9source: devnote 10moves: 2026-11-08T05:21:37Z inbox doing drag; 2026-11-08T05:31:10Z doing review agent; 2026-11-08T16:01:13Z review done drag 11area: site 12--- 13 14## Context 15 16Filed from `http://192.168.122.10:8080/`, on `input.w-full.sm:w-80.px-3`. 17 18## Notes 19 20- 2026-11-08 05:31Z (agent): Done: the header search shows a dropdown of suggestions as you type, with the first one already selected (the autoselect). 21 22 - Enter opens the selected suggestion, the up and down arrows move the selection (wrapping around), and Escape or leaving the field closes it. With nothing suggested, Enter submits to /projects/?q= as before. 23 - Suggestions: up to 6 projects whose name contains the text, names that start with it first, each with its description. Then up to 3 topics that contain it, shown as 'topic · N projects' and linking to /projects/?q=<topic>. 24 - The dropdown is a card under the input with the same ink border and hard shadow as the rest of the site, and the selected row in accent. 25 - It's off on /projects, where typing already filters the list below. 26 27 How: the build writes /search.json (82 projects with name, description and topics, plus the topics most common first). search.js fetches it the first time the field gets focus, so pages carry no extra data. The input gets combobox, aria-controls, aria-expanded and aria-activedescendant. 28 29 Files: internal/site/search.go (new), static/search.js (new), build.go, components.html, layout.html, assets/site.css (#suggest). 30 31 Checked in agent-browser: 32 - On / typing 'mini' gives mini-coding-agent (selected) then mini-coder. ArrowDown selects mini-coder, and Enter opens /projects/mini-coder/. 33 - 'sql' gives 'sqlite topic · 7 projects'. Escape hides the dropdown. 34 - At 390px on /activity/ the dropdown for 'e' is 9 rows at x 16–374 with no horizontal scroll. 35 - On /projects/ it stays hidden while the list filters to 2. 36 - go vet and go test pass. 37 38 Not checked: a real mouse click on a suggestion, only keyboard. The mousedown handler keeps focus so the click reaches the link.