fix(ci): format the updated desktop components

Apply the repository formatter to the files listed by the Client checks formatting step.
This commit is contained in:
Maurice
2026-12-05 12:36:57 +01:00
parent 1eddfe3a29
commit fb7169b158
25 changed files with 115 additions and 52 deletions
@@ -110,8 +110,11 @@ function InstanceConnection({ A }: { A: AiAdmin }) {
const { t } = useTranslation();
const { live, connection, replacing, cancelReplace, onConnected } = A.instance;
return (
<DialogSection icon={Unplug} label={t('assistant.admin.connection')}
action={!live && <StatusPill>{t('assistant.admin.connectionNone')}</StatusPill>}>
<DialogSection
icon={Unplug}
label={t('assistant.admin.connection')}
action={!live && <StatusPill>{t('assistant.admin.connectionNone')}</StatusPill>}
>
<div className="flex flex-col gap-2.5">
{!replacing && <LiveConnection A={A} />}
{A.showPanel && (
@@ -1,5 +1,5 @@
import { asLlmVision, LLM_VISION_MODES, type LlmVision } from '@trek/shared';
import { Bot, Image, Check, RefreshCw } from 'lucide-react';
import { Bot, Check, Image, RefreshCw } from 'lucide-react';
import React, { useId } from 'react';
import { useTranslation } from '../../../i18n';
import { ProviderMark } from '../../Settings/ai/AiConnectPanel';
@@ -37,7 +37,10 @@ export function AutoLoadSettings({ admin }: { admin: Admin }) {
<DialogSection icon={CloudDownload} label={t('admin.paddleRegions.auto.title')}>
<div className="flex min-w-0 flex-col gap-3">
<div className="min-w-0">
<fieldset disabled={saving} className="m-0 min-w-0 border-0 p-0 [&>[role=group]]:bg-[color:var(--bg-selected)]">
<fieldset
disabled={saving}
className="m-0 min-w-0 border-0 p-0 [&>[role=group]]:bg-[color:var(--bg-selected)]"
>
<Segmented<PaddleRegionAutoMode>
value={settings.mode}
onChange={(mode) => void save({ mode })}
@@ -56,7 +59,10 @@ export function AutoLoadSettings({ admin }: { admin: Admin }) {
<SettingsHint className="mt-1.5">{t(`admin.paddleRegions.auto.modeHint.${settings.mode}`)}</SettingsHint>
</div>
{settings.mode === 'auto' && (
<fieldset disabled={saving} className="m-0 min-w-0 border-0 p-0 [&_[aria-pressed=false]]:bg-surface-input [&_[aria-pressed=true]]:bg-accent [&_[aria-pressed=true]]:text-accent-text">
<fieldset
disabled={saving}
className="m-0 min-w-0 border-0 p-0 [&_[aria-pressed=false]]:bg-surface-input [&_[aria-pressed=true]]:bg-accent [&_[aria-pressed=true]]:text-accent-text"
>
<span className={LABEL}>{t('admin.paddleRegions.auto.maxSize')}</span>
<ChoiceChips<string>
value={String(settings.max_mb)}
@@ -136,8 +142,11 @@ export function RequestList({ admin }: { admin: Admin }) {
const open = admin.requests.filter((request) => !request.declined).length;
return (
<div data-testid="paddle-region-requests">
<DialogSection icon={Inbox} label={t('admin.paddleRegions.requests.title')}
action={open > 0 && <StatusPill tone="warning">{open}</StatusPill>}>
<DialogSection
icon={Inbox}
label={t('admin.paddleRegions.requests.title')}
action={open > 0 && <StatusPill tone="warning">{open}</StatusPill>}
>
<SettingRows>
{ordered.map((request) => (
<RequestRow key={request.id} request={request} admin={admin} />
@@ -1,5 +1,17 @@
import type { PaddleRegion, PaddleRegionCatalogEntry } from '@trek/shared';
import { Check, ChevronRight, Info, Loader2, MapPin, Plus, RefreshCw, Search, Trash2, Waves, WifiOff } from 'lucide-react';
import {
Check,
ChevronRight,
Info,
Loader2,
MapPin,
Plus,
RefreshCw,
Search,
Trash2,
Waves,
WifiOff,
} from 'lucide-react';
import { useState } from 'react';
import { useDateFormat } from '../../../hooks/useDateFormat';
import { useTranslation } from '../../../i18n';
@@ -1,4 +1,4 @@
import { Zap, NotebookPen, Plus } from 'lucide-react';
import { NotebookPen, Plus, Zap } from 'lucide-react';
import { useId, useState } from 'react';
import { useTranslation } from '../../i18n';
@@ -1,5 +1,5 @@
import type { TourActivityTotals, TourTypeKey } from '@trek/shared';
import { ChartBar, Route, Footprints } from 'lucide-react';
import { ChartBar, Footprints, Route } from 'lucide-react';
import { createElement, useId } from 'react';
import { useTranslation } from '../../../i18n';
import type { DistanceUnit } from '../../../types';
@@ -99,7 +99,8 @@ function StatsBody({ stats }: { stats: TourActivityStats }) {
</ul>
</DialogSection>
)}
<DialogSection icon={Route}
<DialogSection
icon={Route}
label={t('tours.mode.tours')}
action={
<span className="font-geist tabular-nums text-content-faint" style={fs(11)}>
@@ -45,7 +45,8 @@ export function ExpenseReceiptsSection({
const canLink = linkable.length > 0;
return (
<DialogSection icon={Receipt}
<DialogSection
icon={Receipt}
label={t('costs.receiptsTitle')}
className={className}
action={
+1 -1
View File
@@ -1,4 +1,4 @@
import { Compass, Lock, Sparkles, ArrowLeft, ArrowRight, Clock, ExternalLink, Images, RotateCcw } from 'lucide-react';
import { ArrowLeft, ArrowRight, Clock, Compass, ExternalLink, Images, Lock, RotateCcw, Sparkles } from 'lucide-react';
import { lazy, Suspense, useId } from 'react';
import { useTranslation } from '../../i18n';
import { focusRevealedEditor } from '../shared/dialogFocus';
@@ -1,4 +1,4 @@
import { Map, Bed, Clock, FilePen, Loader2, RefreshCw, Route, Users } from 'lucide-react';
import { Bed, Clock, FilePen, Loader2, Map, RefreshCw, Route, Users } from 'lucide-react';
import { useDateFormat } from '../../hooks/useDateFormat';
import { useTranslation } from '../../i18n';
import { useSettingsStore } from '../../store/settingsStore';
@@ -197,7 +197,8 @@ export function JourneyDayImportReview({ state, dayColor, prep }: Props) {
<RouteLine state={state} />
</div>
</DialogSection>
<DialogSection icon={Bed}
<DialogSection
icon={Bed}
label={t('journey.dayImport.stays')}
action={
choice && review.stays.length > 1 ? (
@@ -1,5 +1,5 @@
import type { JourneyRecordedDay, JourneyRecordingPreview } from '@trek/shared';
import { Globe, ListFilter, AlertTriangle, Clock, Info, Loader2, RefreshCw, Route, Users } from 'lucide-react';
import { AlertTriangle, Clock, Globe, Info, ListFilter, Loader2, RefreshCw, Route, Users } from 'lucide-react';
import { useState, type ReactNode } from 'react';
import { useTranslation } from '../../i18n';
import { useSettingsStore } from '../../store/settingsStore';
@@ -1,5 +1,5 @@
import { useId, type RefObject } from 'react';
import { NotebookPen, Paperclip } from 'lucide-react';
import { useId, type RefObject } from 'react';
import { useTranslation } from '../../i18n';
import type { TripFile } from '../../types';
@@ -351,10 +351,7 @@ const SCOPE_MODES: Record<AiConnectionScope, readonly AiConnectMode[]> = {
instance: ['key', 'chatgpt', 'custom'],
};
const MODE_TILES: Record<
AiConnectMode,
{ titleKey: string; subtitleKey: string; mark: React.ReactNode }
> = {
const MODE_TILES: Record<AiConnectMode, { titleKey: string; subtitleKey: string; mark: React.ReactNode }> = {
chatgpt: {
titleKey: 'assistant.connect.chatgpt',
subtitleKey: 'assistant.connect.chatgptHint',
@@ -406,9 +403,11 @@ export default function AiConnectPanel({ scope, onConnected, initialMode, prefil
<div
role="group"
aria-label={t('assistant.setup.question')}
className={scope === 'instance'
? 'grid gap-2 [&>button>span:first-child]:bg-surface-secondary'
: 'grid grid-cols-2 gap-2 max-sm:grid-cols-1'}
className={
scope === 'instance'
? 'grid gap-2 [&>button>span:first-child]:bg-surface-secondary'
: 'grid grid-cols-2 gap-2 max-sm:grid-cols-1'
}
>
{SCOPE_MODES[scope].map((m) => {
const tile = MODE_TILES[m];
@@ -1,8 +1,9 @@
import type { TourListItem } from '@trek/shared';
import { Palette, CalendarDays, Text, NotebookPen, Paperclip,
import {
AlertTriangle,
ArrowDown,
ArrowUp,
CalendarDays,
Check,
CheckCheck,
ChevronDown,
@@ -17,9 +18,13 @@ import { Palette, CalendarDays, Text, NotebookPen, Paperclip,
Loader2,
Minus,
Navigation,
NotebookPen,
Palette,
Paperclip,
Pencil,
Route,
Ruler,
Text,
Upload,
} from 'lucide-react';
import { createElement, useEffect, useMemo, useRef, useState, type ComponentType } from 'react';
@@ -876,7 +881,8 @@ function TourFilesSection({
if (placeFiles.length === 0 && !onFileUpload) return null;
return (
<DialogSection icon={Paperclip}
<DialogSection
icon={Paperclip}
className="flex-none"
label={t('inspector.files')}
action={
@@ -1,5 +1,18 @@
import type { TourActivity, TourListItem } from '@trek/shared';
import { Badge, SlidersHorizontal, Route, AlertTriangle, Check, Clock, FileDown, Footprints, Link2, Loader2, Ruler, Upload } from 'lucide-react';
import {
AlertTriangle,
Badge,
Check,
Clock,
FileDown,
Footprints,
Link2,
Loader2,
Route,
Ruler,
SlidersHorizontal,
Upload,
} from 'lucide-react';
import { useId, useMemo } from 'react';
import { useTranslation } from '../../../i18n';
import { useSettingsStore } from '../../../store/settingsStore';
@@ -246,7 +259,8 @@ export default function TourActivityDialog({
<DialogSection icon={SlidersHorizontal} label={t('tours.activity.execution')}>
<ExecutionPicker assignment={assignment} />
</DialogSection>
<DialogSection icon={Route}
<DialogSection
icon={Route}
label={t('tours.activity.track')}
action={
<CardAction
@@ -1,5 +1,16 @@
import type { TourActivity, TourListItem } from '@trek/shared';
import { Activity, CalendarDays, CheckCheck, Clock, CloudOff, FileDown, Footprints, Plus, RefreshCw, Unlink } from 'lucide-react';
import {
Activity,
CalendarDays,
CheckCheck,
Clock,
CloudOff,
FileDown,
Footprints,
Plus,
RefreshCw,
Unlink,
} from 'lucide-react';
import { useMemo } from 'react';
import { useTranslation } from '../../../i18n';
import { useSettingsStore } from '../../../store/settingsStore';
@@ -258,7 +269,8 @@ export default function TourActivitySection({
return null;
}
return (
<DialogSection icon={Activity}
<DialogSection
icon={Activity}
className="flex-none"
label={t('tours.activity.label')}
action={
@@ -1,5 +1,5 @@
import type { CollectionTourPoint, CollectionTourTarget } from '@trek/shared';
import { Luggage, MapPin,
import {
AlertTriangle,
ArrowRight,
CalendarDays,
@@ -8,6 +8,8 @@ import { Luggage, MapPin,
Flag,
Info,
Loader2,
Luggage,
MapPin,
Play,
Spline,
Waypoints,
@@ -1,5 +1,5 @@
import type { HorseRoute } from '@trek/shared';
import { Waypoints, Compass, ShieldCheck, Link, ArrowRight, ExternalLink, Plus } from 'lucide-react';
import { ArrowRight, Compass, ExternalLink, Link, Plus, ShieldCheck, Waypoints } from 'lucide-react';
import { useId } from 'react';
import { useTranslation } from '../../../i18n';
import { useSettingsStore } from '../../../store/settingsStore';
@@ -1,5 +1,5 @@
import type { TourListItem } from '@trek/shared';
import { ListChecks, AlertTriangle, ArrowUpRight, Backpack, Check, Link2, PackageOpen, Unlink } from 'lucide-react';
import { AlertTriangle, ArrowUpRight, Backpack, Check, Link2, ListChecks, PackageOpen, Unlink } from 'lucide-react';
import type { ReactNode } from 'react';
import { useTranslation } from '../../../i18n';
import type { PackingItem } from '../../../types';
@@ -1,5 +1,5 @@
import { Waves } from 'lucide-react'
import type { TourListItem } from '@trek/shared';
import { Waves } from 'lucide-react';
import { useTranslation } from '../../../i18n';
import { BOX } from '../../Planner/bookings/bookingParts';
import { DialogSection } from '../../shared/DialogShell';
@@ -85,7 +85,7 @@ export function TourNameField({ planner, locked, inHeader = false }: TourFieldPr
ski: t('tours.planner.namePlaceholder.ski'),
}[planner.tourType]
}
className={`${INPUT}${inHeader ? ' font-medium' : ''}`}
className={`${INPUT}${inHeader ? 'font-medium' : ''}`}
/>
</div>
);
@@ -370,8 +370,11 @@ export function TourDetailsSection({
);
if (framed) {
return (
<RailCard icon={<FileText size={14} strokeWidth={2} />} title={title}
fold={{ expanded, onToggle: toggle, label: toggleLabel }}>
<RailCard
icon={<FileText size={14} strokeWidth={2} />}
title={title}
fold={{ expanded, onToggle: toggle, label: toggleLabel }}
>
<div className="flex flex-col gap-3">{fields}</div>
</RailCard>
);
@@ -379,14 +382,7 @@ export function TourDetailsSection({
return (
<TourSection
label={<span className="text-content">{title}</span>}
action={
<FoldButton
expanded={expanded}
onToggle={toggle}
controls="tour-planner-details"
label={toggleLabel}
/>
}
action={<FoldButton expanded={expanded} onToggle={toggle} controls="tour-planner-details" label={toggleLabel} />}
>
<div id="tour-planner-details" hidden={!expanded} className="flex flex-col gap-3">
{fields}
@@ -1,5 +1,5 @@
import type { TourListItem, TourProvenance, TourSourceCheckResponse, TourSourceHint } from '@trek/shared';
import { FileCheck, CopyPlus, Download, ExternalLink, FileDown, Loader2, PenLine, RefreshCw } from 'lucide-react';
import { CopyPlus, Download, ExternalLink, FileCheck, FileDown, Loader2, PenLine, RefreshCw } from 'lucide-react';
import type { ReactNode } from 'react';
import { useTranslation } from '../../../i18n';
import { formatDate } from '../../../utils/formatters';
@@ -281,7 +281,8 @@ export default function TourProvenanceSection({ provenance, check, hint }: TourP
const openHint = check && hint && !check.answered ? hint : null;
return (
<DialogSection icon={FileCheck}
<DialogSection
icon={FileCheck}
className="flex-none"
label={t('tours.provenance.label')}
action={check && !openHint && <CheckButton check={check} t={t} />}
@@ -1,5 +1,5 @@
import type { WalkImportPreviewResponse, WalkImportStation } from '@trek/shared';
import { MapPin, AlertTriangle, ExternalLink, Footprints, Link2, Loader2, MapPinOff, Route } from 'lucide-react';
import { AlertTriangle, ExternalLink, Footprints, Link2, Loader2, MapPin, MapPinOff, Route } from 'lucide-react';
import { useId, type FormEvent } from 'react';
import { useTranslation } from '../../../i18n';
import { EditorField, INPUT } from '../../shared/dialogParts';
@@ -283,7 +283,8 @@ export function WalkStationsCard({
const visited = listed.filter((station) => station.key && visits?.[station.key] === 'visited').length;
const marking = markState(canMark, assignmentId);
return (
<DialogSection icon={MapPin}
<DialogSection
icon={MapPin}
className="flex-none"
label={t('tours.walk.stations')}
action={
+3 -1
View File
@@ -124,7 +124,9 @@ export function TripTagField({
};
if (readOnly) {
return <ReadOnlyTripTags tags={tags} label={t('mobileJourney.tags')} labelClass={labelClass} className={className} />;
return (
<ReadOnlyTripTags tags={tags} label={t('mobileJourney.tags')} labelClass={labelClass} className={className} />
);
}
return (
+5 -2
View File
@@ -6,9 +6,12 @@ export const REMINDER_PRESETS = [0, 1, 3, 9];
export function tripReminderOptions(t: T) {
return [
...REMINDER_PRESETS.map(value => ({
...REMINDER_PRESETS.map((value) => ({
value: String(value),
label: value === 0 ? t('trips.reminderNone') : `${value} ${t(value === 1 ? 'trips.reminderDay' : 'trips.reminderDays')}`,
label:
value === 0
? t('trips.reminderNone')
: `${value} ${t(value === 1 ? 'trips.reminderDay' : 'trips.reminderDays')}`,
})),
{ value: 'custom', label: t('trips.reminderCustom') },
];