Skip to content

Planner: trip settings at the top of the day list, a one-row elevation drawer, a centred plus button #3291

Closed

Description

@timohueser

Status: done
Size: M
Part of #3286. Depends on #3288 and #3290.
Systems: route-planning

TL;DR

Goal: The start date, the number of riding days and the stay kinds stand at the top of the day list. The elevation drawer has one row of controls. The + between two days is centred and clear.
Problem: The drawer has three rows above the plot: its own controls, the trip settings and a coloured day label. A number at the right repeats the last tick of the axis. The + sign sits off centre in a faint circle.
Decision: The trip settings move from the drawer to the top of the day list, as three compact controls. The drawer keeps one row: its title, the range switch and the grade switch. The coloured day label and the number at the right go. The + becomes 20 px, centred and dark. (Review page, findings 09 and 10.)

Plan

  1. New component builder/web/src/components/planner/StayChip.svelte. Props: value: Stay[], onChange: (kinds: Stay[]) => void and the optional onReset?: () => void with resetLabel?: string. It is a .planner-chip button with --chip-ink: var(--query-place), the icon of the first chosen kind and a label: the label of the kind for one kind, "Any place" for all five, else the first label and " +N". It opens a popover below it with one checkbox row for each entry of stayOptions. The last checked row cannot be unchecked. With onReset, the popover ends with a button that shows resetLabel. Escape and a press outside close it.
  2. builder/web/src/components/planner/TripRow.svelte: the date button takes the class planner-chip with --chip-ink: var(--query-time); a guessed date keeps its dashed border. Its popover opens below the button. The day counter is 32 px high and shows "N days" (its aria-label keeps "riding days"); a guessed count keeps its dashed line. StayChip replaces the five toggle buttons and the label "Sleep in". The row wraps and has no margin-left: auto.
  3. builder/web/src/components/planner/Itinerary.svelte: new prop onTrip: (next: Trip, description: string) => void. While no day is open, <TripRow> stands at the top, with a 1 px line in var(--line) below it. Delete the paragraph "Choose where to sleep each night. Open a day for its stops." The "campsites suggested" block stays; its second sentence goes.
  4. builder/web/src/components/planner/StopPicker.svelte: StayChip replaces the .kinds group. onReset is set when the night has its own kinds, with resetLabel "Same as the trip".
  5. builder/web/src/components/planner/PlannerProfile.svelte: delete the props trip and onTrip, the TripRow import and the .trip element; delete the .labels block with labelled and dayDate; delete the .distance element. The rest-day columns stay. PlannerApp.svelte passes onTrip={changePlan} to Itinerary and no longer passes trip and onTrip to the profile.
  6. builder/web/src/components/planner/DayRow.svelte: with a start date, the title of a day is "Day N · " and the weekday label (weekdayLabel(addDays(trip.startDate, day.number - 1))), because the drawer no longer shows the date of a day.
  7. Itinerary.svelte .plus: padding: 0, 20 px wide and high, border-color: var(--ink-faint), color: var(--ink), icon size 12. On hover: background: var(--ink), color: var(--panel). Its centre stays on the vertical line of the day list.
  8. Docs, in its own docs: commit: in docs/content/software/trips.md, section "Days in the planner", say that the trip values stand at the top of the day list and that the profile shows the days by colour and by a marker at each night.
  9. Tests: update the cases of PlannerApp.svelte.test.ts and of the profile that read the trip row or the day labels. Add a component test for StayChip: the three label forms and the last row that cannot be unchecked.

Done when

  • From builder/web: npx vitest run src/components/planner/ and npm run check
  • python3 docs/build_docs.py --check-links
  • In the running planner at a side panel width of 320 px, the trip row wraps without a horizontal scroll bar.

Notes from the build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions