Repository navigation
Description
Status: done
Size: S
Part of #3286 (round 2, after the owner's browser check). Depends on #3371.
Systems: route-planning
TL;DR
Goal: The town card has one way to say "I sleep here": the rider selects the town or one of its places, and one button ends the day there.
Problem: Three buttons do two things under almost the same name. "Stay here" on a town row and "End day 1 in Sarnen" on the card both end the day in the town with no place chosen. "Stay here" on a campsite ends the day at that campsite. The owner did not know which to press. The card also lists water. The owner decided that water does not belong to the town card: a rider who sleeps at a campsite or in a hotel of a town has water there.
Decision: The places of the card are choices, not buttons. The first choice is the town itself. One button at the bottom of the card confirms, and its text names what is selected. A town row has no button and only opens the town. The line "Water" goes. The two day tiles stay. (Wireframe page https://claude.ai/artifact/HibXoqwkvZM9jHwdae1Ka7, question 4, option A.)
Accepted cost: To end a day in a town with no place chosen takes two steps (open the town, confirm), where "Stay here" on a town row took one. The owner chose one place to decide.
Rejected:
- The same button on every row: a town with 21 places gets 22 buttons.
- The town first and the place later: a rider who knows the campsite needs two steps.
Words
- Town card: the page of one town in the night picker (
StopCard.svelteinbuilder/web/src/components/planner/). A stop is that town with its places to sleep (Stopinlib/planner/stops.ts). - Town row: one town in the list of the night picker (
StopPicker.svelte). - Day tiles: the two tiles "Day 1 ends here" and "Day 2 starts here" of the card (
.days).
Facts
StopCard.sveltehas the button.end-here("End day N in ",onEndHere(stop)), and for each place a row button (onSelectPlace(place), which shows the place on the map) and a button "Stay here" (onStay(place)).- In
PlannerApp.svelte,endDayInpins the night or sets the day end at the town, andstayAtpins the night at the place. Both commit the trip and close the picker. StopPicker.sveltehas a button "Stay here" on each town row (onEndHere(stop)).- The card groups its places by stay kind under headings such as "Campsites" and "Hotels".
- The block "Evening and morning" has the lines Food, Shops, Water and Night.
StopPickeralso shows small icons of the services of a town in its row (services).
Plan
StopCard.svelte: the places become one radio group with the heading "Where you sleep". Its first option is "Somewhere in " with the line "decide the place later". Then the places follow, under their headings by stay kind. The first option is selected when the card opens, when the card shows another town, and when the selected place leaves the list because the stay kinds of the night change.- The map: a click or an arrow key that selects a place shows that place on the map (
onSelectPlace), as a click on a place row does today. The first option shows no place: it clears the shown place, and the map stays where it is. StopCard.svelte: delete.end-hereand the buttons "Stay here". One button stands at the bottom edge of the scrolling side panel (.pane-scroll) and stays in view while the card scrolls. Its text is "End day N in " for the first option and "End day N at " for a place (for a place without a name: "End day N at this "); a long name wraps to a second line. It callsonEndHere(stop)oronStay(place). Both close the picker as today; Planner: a night and a town open as pages #3371 puts the focus on the button of the night.StopCard.svelte: delete the line "Water". The water of a stop then has no use in the night picker: delete it fromStopinstops.ts, from the search request oflib/planner/night-stops.svelte.tsand from the service icons of a town row (servicesinStopPicker.svelte), unless another reader exists. Say in the pull request what you found and what the request was shared with.StopPicker.svelte: delete the button "Stay here" of a town row and its style. The whole row opens the town. The propsonEndHereandonStaystay, because the card needs them.- Keyboard: the arrow keys move in the radio group, and
Enteron the button confirms. The accessible name of the group is "Where you sleep on night N". - Search for other uses of the text "Stay here" in
builder/web/src(for example the callout of the map) and list them in the pull request. They do not change in this issue. - Tests: update the cases of
Planner.svelte.test.tsandPlannerApp.svelte.test.tsthat press "Stay here" or "End day". New cases: the button text follows the selection; the first option ends the day in the town; a place pins the night at the place; the selection returns to the first option when the stay kinds remove the selected place; a town row has no button and opens the town; no "Water" line. - Docs, in its own
docs:commit:docs/content/software/trips.md, where it names "Stay here" or the end of a day in a town.
Done when
- From
builder/web:npx vitest run src/components/planner/ src/lib/planner/andnpm run check python3 docs/build_docs.py --check-links- In the running planner: a town card has one button; its text changes when a place is selected; no town row has a button.
Activity