feat(tours): plan ski and winter tours, snowshoeing and winter hiking among them

Ski becomes "Ski & winter", a type the planner plans with six disciplines
(alpine, snowboard, cross-country, ski touring, snowshoeing, winter hiking),
nothing preselected; saving needs a discipline, and a technique for
cross-country. Every leg is drawn straight between the points through
planner/skiRouting.ts, the one place the piste router will plug in, with its
heights from the elevation source and no ski time worked out.

The hike's winter label goes entirely: its migration, column, field, marks,
GPX rule, MCP field and strings. A hike is summer only; a ski tour with the
snowshoe discipline exports as snowshoeing. The unreleased ski migration takes
the six disciplines and the collection migration loses the winter column.

The pistes are offered for a ski tour, shown until switched off, and with no
tour open, never for a hike. Export, copy, collections, stages (untimed),
actual tracks, the atlas, list and day marks (one glyph per discipline), 3D,
planning over a ski import and list_tours/get_tour_plan know the planned ski
tour.
This commit is contained in:
Maurice
2026-10-20 18:27:53 +02:00
parent 204ee2ef86
commit 164a3633ac
116 changed files with 1675 additions and 1576 deletions
@@ -7,18 +7,22 @@ import { skiChoiceMissing, type SkiChoice } from './skiChoice';
import { SKI_DISCIPLINE_ICON } from './skiDiscipline';
/**
* SKI-02: what a ski track is, chosen on purpose: the discipline, none until
* one is picked, and for cross-country the technique, Unknown among its
* answers. The technique stays in sight but dimmed while another discipline
* is chosen. The info dot says what TREK does with the track. The GPX import
* and the classification dialog share it.
* SKI-02: what a ski tour is, chosen on purpose: the discipline, none until
* one is picked, six of them in two columns, and for cross-country the
* technique, Unknown among its answers. The technique stays in sight but
* dimmed while another discipline is chosen. The info dot says what TREK does
* with the tour. The GPX import, the classification dialog and the planner
* share it; `planned` says the choice is asked for a tour to save rather than
* a track to import.
*/
export function SkiClassificationFields({
choice,
onChange,
planned = false,
}: {
choice: SkiChoice;
onChange: (choice: SkiChoice) => void;
planned?: boolean;
}) {
const { t } = useTranslation();
const crossCountry = choice.discipline === 'cross_country';
@@ -34,13 +38,14 @@ export function SkiClassificationFields({
value={(choice.discipline ?? '') as SkiDiscipline}
onChange={(discipline) => onChange({ ...choice, discipline })}
label={t('tours.ski.discipline')}
fill
columns={2}
options={SKI_DISCIPLINES.map((discipline) => {
const Icon = SKI_DISCIPLINE_ICON[discipline];
return {
value: discipline,
label: t(`tours.ski.discipline.${discipline}`),
icon: <Icon size={13} strokeWidth={2} aria-hidden="true" />,
// Two columns in a narrow rail: a long name ends in an ellipsis rather than spilling out.
label: <span className="min-w-0 truncate">{t(`tours.ski.discipline.${discipline}`)}</span>,
icon: <Icon size={13} strokeWidth={2} aria-hidden="true" className="flex-none" />,
};
})}
/>
@@ -64,7 +69,13 @@ export function SkiClassificationFields({
</fieldset>
{missing && (
<TourNotice role="status" icon={<Info size={13} strokeWidth={2} />}>
{t(missing === 'discipline' ? 'tours.ski.chooseDiscipline' : 'tours.ski.chooseTechnique')}
{t(
missing === 'technique'
? 'tours.ski.chooseTechnique'
: planned
? 'tours.ski.chooseDisciplineToSave'
: 'tours.ski.chooseDiscipline'
)}
</TourNotice>
)}
</div>