Repository navigation
Description
Status: done
Size: M
Part of #3286. Depends on #3287.
Systems: route-planning, search
TL;DR
Goal: The search chips look pressable, the results list is easy to scan, a hovered marker always shows its row, and the block under the search field is gone.
Problem: The chips are pale pills with 12 px text. Each result row repeats its kind and a long distance sentence. A hovered marker highlights a row that is often outside the visible part of the list. Under the search field sit the region name, a location button, a test route and a coverage sentence.
Decision: The chips take the look of the other controls of the planner: white, a thin border, 13 px semibold. The results show their distances in a right column and, on a trip, are grouped by day. A hovered marker scrolls its row into view. The block under the search field goes; a search that needs the position of the rider asks the browser for it. (Review page, findings 01 option A, 02 and 03.)
Plan
builder/web/src/components/planner/PlannerApp.svelte: add the global class.planner-chipwith the values of "Shared look" in EPIC — Planner UX: less text, clear controls, nights that follow the stay kinds, no route alternatives #3286.builder/web/src/components/planner/QueryChip.svelte: the trigger button takes the classplanner-chipand sets--chip-ink: var(--filter-ink). Delete the pill rules of.chip(tint, radius 999 px, 12 px). The end icon isupwhile the chip is open. A removed chip keeps its line-through.builder/web/src/components/planner/PlannerQuery.svelte: delete the.meaning-labelline, the.data-button, the.settingsblock, the statesettingsand the constantonline. Delete the proponLocationas a button target (step 4 uses it). KeeponSample, and show its button only whenimport.meta.env.DEVis true.- Location on demand.
planner/search/resolver.mjs: the two errors that start with "Set your location" get the propertycode = 'location'.planner/search/server.mjs: an error answer includescodewhen the error has one.searchPlacesinbuilder/web/src/lib/planner/search/types.ts: the thrownErrorcarriescode.PlannerQuery.svelterun: oncode === 'location', callawait onLocation()once and run the search again with the new position. If no position comes, show "Allow location access to search near you."onLocationislocateinPlannerApp.svelte, which reads the position from the browser (navigator.geolocation.getCurrentPosition). It returnsPromise<Coordinate | undefined>and no longer writes "Location set for search" to the status line. builder/web/src/components/planner/PlaceRow.svelte: add the optional propdistance?: { main: string; sub?: string }. With it, the row shows the two lines right-aligned withtabular-numsin place of the chevron and of thedetailline. Add the optional propshowKind = true; withfalsethe second line is the locality only.builder/web/src/components/planner/QueryResults.svelte:- A result with
positiongetsmain = "km " + along.toFixed(1)andsub = "on route"whenposition.distance < 0.05, elsedistance.toFixed(1) + " km off". A result withoutpositiongetsmain = distance.toFixed(1) + " km"and nosub. The text "Street location only" stays in the second line of its row. showKindisfalsewhen every result has the samekind.- New props
days: { number: number; from: number; to: number }[]andtheme.PlannerApp.sveltepassesqueryPlan.days.filter(day => !day.rest): the riding days in km, each with the day number that the day list shows. Whendayshas more than one entry and every result hasposition, a heading "Day {number}" (.day-head, sticky inside.pane-scroll) stands before the first result of each day. Its dot has the colourdayColor(index + 1, theme), whereindexis the position of the day indays. - Rows are divided by a 1 px line in
var(--line).
- A result with
- Hover. In
PlaceRow.svelte, whenhoveredturns true and the row does not match:hover, callscrollIntoView({ block: 'nearest' }); usebehavior: 'smooth'unless the user prefers reduced motion. A hovered or selected row drawsbox-shadow: 0 0 0 2px var(--amber)on its.place-icon, the same ring as the highlighted marker. - Tests: update
PlannerQuery.svelte.test.tsfor the deleted block and the dev-only button. Add cases to aQueryResultscomponent test: day headings, "on route", the kind hidden when all kinds are equal. Add one resolver test forcode.
Done when
- From
builder/web:npx vitest run src/components/planner/andnpm run check - The search suite of
planner/search/README.mdpasses. - In the running planner: "hotel along the route" on a two-day trip shows day headings; hovering a marker far down the list scrolls its row into view.
Activity
Merge pull request #3316 from timohueser/claude/planner-ux-3288-searc…