mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
fix(tours): give an actual track its own mark and a winter tile its label's icon
Footprints stood for a snowshoe hike, an actual track and a walk's moving time at once, with the snowshoe pill and the track pill side by side in a tour's head. An actual track now goes by the done mark on the list row, in the head and on a recording's tile, and a winter tile's corner takes the icon its head pill shows.
This commit is contained in:
@@ -11,6 +11,9 @@ describe('TourActivityBadge (ACT-01)', () => {
|
||||
<TourActivityBadge tour={{ activity_tracks: [{ id: 1, track_place_id: 9, assignment_id: null }] }} />
|
||||
);
|
||||
expect(screen.getByTestId('tour-activity-badge')).toHaveAttribute('aria-label', 'tours.activity.badgeHint');
|
||||
// The done mark, never footprints, which name a snowshoe hike and a walk's moving time.
|
||||
expect(screen.getByTestId('tour-activity-badge').querySelector('svg.lucide-check-check')).not.toBeNull();
|
||||
expect(screen.getByTestId('tour-activity-badge').querySelector('svg.lucide-footprints')).toBeNull();
|
||||
|
||||
rerender(<TourActivityBadge tour={{ activity_tracks: [], activity_of: 4 }} />);
|
||||
expect(screen.getByTestId('tour-activity-badge')).toHaveAttribute('aria-label', 'tours.activity.isTrackHint');
|
||||
|
||||
@@ -102,6 +102,10 @@ describe('TourActivitySection (ACT-01)', () => {
|
||||
expect(screen.getByTestId('tour-activity-compare-time')).toHaveTextContent('tours.activity.noTime');
|
||||
expect(screen.getByTestId('tour-activity-day')).toHaveTextContent('tours.activity.noDay');
|
||||
expect(screen.queryByText('tours.activity.recordedOn')).toBeNull();
|
||||
// The recording's tile goes by the done mark every actual track has, never footprints.
|
||||
const head = screen.getByTestId('tour-activity').querySelector('header') as HTMLElement;
|
||||
expect(head.querySelector('svg.lucide-check-check')).not.toBeNull();
|
||||
expect(head.querySelector('svg.lucide-footprints')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-ACT-SECTION-003: someone who may change the tour links, changes and unlinks; the dialog opens when asked', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TourActivity, TourListItem } from '@trek/shared';
|
||||
import { CalendarDays, Clock, CloudOff, FileDown, Footprints, Plus, RefreshCw, Unlink } from 'lucide-react';
|
||||
import { CalendarDays, CheckCheck, Clock, CloudOff, FileDown, Plus, RefreshCw, Unlink } from 'lucide-react';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from '../../../i18n';
|
||||
import { useSettingsStore } from '../../../store/settingsStore';
|
||||
@@ -29,11 +29,16 @@ interface PlanSide {
|
||||
comparison: ActivityComparisonState | null;
|
||||
}
|
||||
|
||||
/** The tile of a recording: footprints, with a small dot at its foot that says it was recorded. */
|
||||
/**
|
||||
* The tile of a recording: the done mark every actual track goes by (on the
|
||||
* list row, in the tour's head and here), with a small dot at its foot that
|
||||
* says it was recorded. Never footprints, which name a snowshoe hike and a
|
||||
* walk's moving time.
|
||||
*/
|
||||
function RecordedTile() {
|
||||
return (
|
||||
<span className="relative grid h-9 w-9 flex-none place-items-center rounded-full bg-surface-secondary text-content-secondary">
|
||||
<Footprints size={15} strokeWidth={2} aria-hidden="true" />
|
||||
<CheckCheck size={15} strokeWidth={2} aria-hidden="true" />
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="absolute -bottom-0.5 -end-0.5 h-3 w-3 rounded-full bg-success ring-2 ring-surface-card"
|
||||
|
||||
Reference in New Issue
Block a user