fix(ci): repair trip tag checks and shared booking build

Restore the category label used by shared bookings, keep measured tag-menu positioning, and fix form queries and schema formatting. Collapse the Route label within narrow toolbars.
This commit is contained in:
Maurice
2026-12-05 01:41:10 +01:00
parent 27b736a819
commit 3cd22b91ff
5 changed files with 30 additions and 32 deletions
@@ -1175,7 +1175,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
* worse than the icon that means the same thing. The icon keeps the accessible
* name, so nothing is lost but the letters.
*/
const NARROW_PLAN_PX = 320
const DAY_DATE_BADGE = 'inline-flex items-center rounded-full bg-surface-card px-2 py-0.5 font-medium text-content-muted'
const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarProps) {
@@ -1251,22 +1250,6 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
// Deleting a note asks for confirmation first — the edit/delete icons sit close together and are
// easy to mis-tap on touch devices, where an accidental delete was previously unrecoverable.
const [pendingDeleteNote, setPendingDeleteNote] = useState<{ dayId: number; noteId: number } | null>(null)
// The plan sidebar is resizable. Below this the route button's own word is the
// first thing that stops fitting beside the two export buttons — the icon says
// the same thing, and the accessible name still spells it out.
//
// A callback ref rather than `useRef`, so the measurement happens when the
// element exists rather than on a mount that may render nothing yet.
const [panel, setPanel] = useState<HTMLElement | null>(null)
const [narrowPanel, setNarrowPanel] = useState(false)
useEffect(() => {
if (!panel || typeof ResizeObserver === 'undefined') return
const measure = (): void => setNarrowPanel(panel.clientWidth < NARROW_PLAN_PX)
measure()
const ro = new ResizeObserver(measure)
ro.observe(panel)
return () => ro.disconnect()
}, [panel])
// A stable key for the current selection. A multi-day place renders one row per
// day (same place_id, different assignment ids); selecting it by place_id alone
// (e.g. clicking an accommodation) marks every one of those rows selected, so a
@@ -1441,7 +1424,7 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
// trip switch above this, and at height 100% alone the list ran the switch's height
// past the panel's clipped edge, so the last day could never be scrolled into view.
// Where nothing sits above it (the mobile shell), the height still fills the panel.
<div ref={setPanel} data-touch-drag={dragDisabled ? undefined : ''} style={{ display: 'flex', flexDirection: 'column', flex: '1 1 0%', minHeight: 0, height: '100%', position: 'relative', fontFamily: "var(--font-system)" }}>
<div data-touch-drag={dragDisabled ? undefined : ''} style={{ display: 'flex', flexDirection: 'column', flex: '1 1 0%', minHeight: 0, height: '100%', position: 'relative', fontFamily: "var(--font-system)" }}>
{/* Toolbar */}
{toursEnabled && selectedDayId != null && projectDayItinerary(assignments[String(selectedDayId)] || [], true, places).some(item => item.kind === 'tour' && !item.valid) && (
<div role="status" style={{ color: 'var(--warning)', padding: '8px 12px' }}>
@@ -2520,7 +2503,7 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
{/* Routen-Werkzeuge (ausgewählter Tag, 2+ Orte — oder 1 Ort mit Hotel-Bookend #1330 — oder Hotel-zu-Hotel-Transfertag ohne Orte #1297) */}
{showRouteTools && (
<div data-dp="route-tools" className="mt-1 flex flex-col gap-2 border-t border-edge-faint px-1 pb-0.5 pt-2">
<div data-dp="route-tools" className="mt-1 flex flex-col gap-2 border-t border-edge-faint px-1 pb-0.5 pt-2 [container-type:inline-size]">
<div className="trek-desktop-panel flex flex-wrap items-center gap-2">
<button type="button"
onClick={() => {
@@ -2541,11 +2524,11 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
}}
aria-label={t('dayplan.route')}
aria-pressed={routeActive}
className={`inline-flex h-8 flex-none items-center gap-1.5 rounded-[10px] px-3 font-semibold transition-colors ${routeActive ? 'bg-accent text-accent-text' : `${ROUTE_TOOL} text-content-secondary hover:text-content`}`}
className={`inline-flex h-8 flex-none items-center justify-center gap-1.5 rounded-[10px] px-3 font-semibold transition-colors [@container(max-width:340px)]:w-8 [@container(max-width:340px)]:px-0 ${routeActive ? 'bg-accent text-accent-text' : `${ROUTE_TOOL} text-content-secondary hover:text-content`}`}
style={fs(12, 'body')}
>
<RouteIcon size={14} strokeWidth={2} />
{!narrowPanel && t('dayplan.route')}
<span className="whitespace-nowrap [@container(max-width:340px)]:hidden">{t('dayplan.route')}</span>
</button>
{/* The day's travel mode as one segmented control. */}
<div role="group" aria-label={t('dayplan.transportMode.change')}
@@ -145,6 +145,18 @@ export function SectionHead({ group, open, onToggle }: { group: BookingGroup; op
)
}
/** Text label for the shared trip's booking cards. */
export function TypeChip({ type }: { type: string }) {
const { t } = useTranslation()
const info = typeInfo(type)
return (
<span className="inline-flex flex-none items-center gap-1 rounded-full border border-edge-faint bg-surface-card px-2 py-[2px] font-geist font-bold uppercase tracking-[.06em] text-content-muted" style={fs(9.5)}>
<info.Icon size={11} strokeWidth={2.2} style={{ color: info.color }} />
{t(info.chipKey)}
</span>
)
}
export function BookingTypeMarker({ booking, inHeader = false }: { booking: Reservation; inHeader?: boolean }) {
const { t } = useTranslation()
const info = typeInfo(booking.type)