Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

feat(flight-live): route mini map and a calmer live card; fix the CI gates

Mauricee525e0b8380b
diff --git a/client/scripts/size-baseline.json b/client/scripts/size-baseline.json
index 5b589778c..3d3878d81 100644
--- a/client/scripts/size-baseline.json
+++ b/client/scripts/size-baseline.json
@@ -7,7 +7,7 @@
"src/components/Budget/CostsPanel.tsx": 1607,
"src/components/Map/MapView.tsx": 1200,
"src/components/Map/MapViewGL.test.tsx": 2919,
- "src/components/Map/MapViewGL.tsx": 2118,
+ "src/components/Map/MapViewGL.tsx": 2116,
"src/components/Planner/DayDetailPanel.test.tsx": 2333,
"src/components/Planner/DayPlanSidebar.test.tsx": 5349,
"src/components/Planner/DayPlanSidebar.tsx": 2910,
diff --git a/client/src/components/Map/VectorBasemap.tsx b/client/src/components/Map/VectorBasemap.tsx
index 6100ebe74..ace778346 100644
--- a/client/src/components/Map/VectorBasemap.tsx
+++ b/client/src/components/Map/VectorBasemap.tsx
@@ -47,9 +47,47 @@ async function loadLayerFactory() {
import('./engines/maplibre'),
import('@maplibre/maplibre-gl-leaflet'),
])
+ guardTransitionEnd(bridge.MaplibreGL.prototype as unknown as GlLayerInternals)
return bridge.maplibreGL
}
+interface GlLayerInternals {
+ _map: L.Map | null
+ _glMap: { _actualCanvas: HTMLElement; once(event: string, fn: () => void): void; jumpTo(view: { center: L.LatLng; zoom: number }): void }
+ _resizeContainer(): void
+ _zoomEnd(): void
+ _transitionEnd: (e?: unknown) => void
+ _trekGuarded?: boolean
+}
+
+/**
+ * The bridge answers a map resize by scheduling a frame that reads
+ * `this._map.getZoom()` without asking whether the layer is still on a map. A
+ * layer taken off before that frame (a dialog closed at once, React mounting a
+ * map twice in development) threw "Cannot read properties of null (reading
+ * 'getZoom')" from inside the frame. This is the bridge's own method (0.1.4,
+ * pinned) with that question added; patched once, on the class.
+ */
+function guardTransitionEnd(proto: GlLayerInternals): void {
+ if (proto._trekGuarded) return
+ proto._transitionEnd = function (this: GlLayerInternals) {
+ L.Util.requestAnimFrame(() => {
+ const map = this._map
+ if (!map) return
+ const zoom = map.getZoom()
+ const center = map.getCenter()
+ const offset = map.latLngToContainerPoint(map.getBounds().getNorthWest())
+ this._resizeContainer()
+ L.DomUtil.setTransform(this._glMap._actualCanvas, offset, 1)
+ this._glMap.once('moveend', () => {
+ if (this._map) this._zoomEnd()
+ })
+ this._glMap.jumpTo({ center, zoom: zoom - 1 })
+ })
+ }
+ proto._trekGuarded = true
+}
+
/** The factory, or null when its chunk never arrived. A dead chunk is not the basemap's problem. */
async function loadLayerFactoryOrNull() {
try {
diff --git a/client/src/components/Map/flightAircraft.css b/client/src/components/Map/flightAircraft.css
index fbf9da2f3..71555a516 100644
--- a/client/src/components/Map/flightAircraft.css
+++ b/client/src/components/Map/flightAircraft.css
@@ -30,7 +30,7 @@
.trek-aircraft__halo {
position: absolute;
- left: 0;
+ inset-inline-start: 0;
top: 0;
width: 30px;
height: 30px;
@@ -53,7 +53,7 @@
.trek-aircraft__label {
position: absolute;
- left: 36px;
+ inset-inline-start: 36px;
top: 50%;
transform: translateY(-50%);
padding: 3px 8px;
diff --git a/client/src/components/Planner/bookings/BookingCard.tsx b/client/src/components/Planner/bookings/BookingCard.tsx
index ef91de68b..fc144fb86 100644
--- a/client/src/components/Planner/bookings/BookingCard.tsx
+++ b/client/src/components/Planner/bookings/BookingCard.tsx
@@ -72,7 +72,7 @@ export default function BookingCard(p: BookingCardProps) {
<div className="flex flex-1 flex-col gap-2 px-3 pb-3 pt-2.5">
<WhenFields facts={facts} />
- {r.type === 'flight' && <FlightLiveStrip tripId={p.tripId} reservationId={r.id} />}
+ <FlightLiveStrip tripId={p.tripId} reservationId={r.id} type={r.type} />
{transit ? <TransitBody r={r} /> : (
<>
diff --git a/client/src/components/Planner/bookings/BookingDetailDialog.tsx b/client/src/components/Planner/bookings/BookingDetailDialog.tsx
index 48c6c45e3..2a073f27b 100644
--- a/client/src/components/Planner/bookings/BookingDetailDialog.tsx
+++ b/client/src/components/Planner/bookings/BookingDetailDialog.tsx
@@ -146,11 +146,12 @@ export default function BookingDetailDialog(p: BookingDetailDialogProps) {
{!!r.needs_review && <ReviewPill pill />}
<AirTrailPill r={r} pill />
{r.confirmation_number && (
- <span className={`${PILL} gap-1 py-0.5 pe-1`}>
+ // The copy button rides in the pill's padding (-my-1), so this pill is as tall as its neighbours.
+ <span className={`${PILL} gap-1 pe-1`}>
<BlurredCode className="font-geist tabular-nums">#{r.confirmation_number}</BlurredCode>
<Tooltip label={t('reservations.copyCode')}>
<button type="button" onClick={copyCode} aria-label={t('reservations.copyCode')}
- className="grid h-6 w-6 place-items-center rounded-full text-content-faint hover:bg-surface-hover hover:text-content">
+ className="-my-1 grid h-6 w-6 place-items-center rounded-full text-content-faint hover:bg-surface-hover hover:text-content">
<Copy size={12} strokeWidth={2} />
</button>
</Tooltip>
diff --git a/client/src/components/Planner/flightLive/FlightArc.tsx b/client/src/components/Planner/flightLive/FlightArc.tsx
deleted file mode 100644
index 02ed0b612..000000000
--- a/client/src/components/Planner/flightLive/FlightArc.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import { useId } from 'react';
-
-interface FlightArcProps {
- /** Share of the way flown, 0 to 1. */
- progress: number;
- /** Draws the aircraft; off where only the route is shown. */
- showPlane: boolean;
- /** Softens the aircraft while its position is a guess (stale feed). */
- dimPlane?: boolean;
- /** Colours as CSS values, so the desktop and the phone dress it in their own tokens. */
- track: string;
- flown: string;
- plane: string;
- className?: string;
-}
-
-// The arc is a quadratic curve across a fixed box; the SVG scales to its column.
-const W = 320;
-const H = 74;
-const P0 = { x: 14, y: 62 };
-const P1 = { x: W / 2, y: -14 };
-const P2 = { x: W - 14, y: 62 };
-
-function pointAt(t: number): { x: number; y: number; angle: number } {
- const u = 1 - t;
- const x = u * u * P0.x + 2 * u * t * P1.x + t * t * P2.x;
- const y = u * u * P0.y + 2 * u * t * P1.y + t * t * P2.y;
- const dx = 2 * u * (P1.x - P0.x) + 2 * t * (P2.x - P1.x);
- const dy = 2 * u * (P1.y - P0.y) + 2 * t * (P2.y - P1.y);
- return { x, y, angle: (Math.atan2(dy, dx) * 180) / Math.PI };
-}
-
-const PATH = `M${P0.x} ${P0.y} Q${P1.x} ${P1.y} ${P2.x} ${P2.y}`;
-
-/** An airliner seen from above, nose along +x, about 18 units long. */
-const PLANE =
- 'M9 0c0-.9-.7-1.3-1.6-1.3H3.2L-1.6-7.6h-2.1l2.3 6.3h-4.1l-1.7-2.4h-1.6l1 3.7-1 3.7h1.6l1.7-2.4h4.1l-2.3 6.3h2.1l4.8-6.3h4.2C8.3 1.3 9 .9 9 0Z';
-
-/**
- * The route of a flight as a gentle arc: dashed where it is still to fly,
- * solid where it has flown, the aircraft riding the curve at its heading.
- * Around the aircraft the lines are masked out rather than covered, so it sits
- * cleanly on any card, translucent ones included. In a right-to-left layout
- * the origin stands on the right, so the whole drawing is mirrored with it.
- * Purely visual; the numbers sit in the card around it.
- */
-export default function FlightArc({
- progress,
- showPlane,
- dimPlane,
- track,
- flown,
- plane,
- className = '',
-}: FlightArcProps) {
- const maskId = useId();
- const p = Math.min(1, Math.max(0, progress));
- const at = pointAt(p);
- // A CSS transform rather than the attribute, so a new position glides there.
- const placed = { transform: `translate(${at.x}px, ${at.y}px) rotate(${at.angle}deg)` };
- return (
- <svg
- viewBox={`0 0 ${W} ${H}`}
- className={`block h-auto w-full overflow-visible rtl:-scale-x-100 ${className}`}
- aria-hidden="true"
- >
- <mask id={maskId} maskUnits="userSpaceOnUse" x={-20} y={-30} width={W + 40} height={H + 60}>
- <rect x={-20} y={-30} width={W + 40} height={H + 60} fill="white" />
- {showPlane && (
- <circle
- r={13}
- fill="black"
- style={placed}
- className="transition-transform duration-700 ease-out motion-reduce:transition-none"
- />
- )}
- </mask>
- <g mask={`url(#${maskId})`}>
- <path d={PATH} fill="none" stroke={track} strokeWidth={1.6} strokeDasharray="2 5" strokeLinecap="round" />
- {p > 0 && (
- <path
- d={PATH}
- fill="none"
- stroke={flown}
- strokeWidth={2.4}
- strokeLinecap="round"
- pathLength={1}
- strokeDasharray={`${p} 1`}
- className="transition-[stroke-dasharray] duration-700 ease-out motion-reduce:transition-none"
- />
- )}
- <circle cx={P0.x} cy={P0.y} r={4} fill="none" stroke={p > 0 ? flown : track} strokeWidth={2} />
- <circle
- cx={P2.x}
- cy={P2.y}
- r={4}
- fill={p >= 1 ? flown : 'none'}
- stroke={p >= 1 ? flown : track}
- strokeWidth={2}
- />
- </g>
- {showPlane && (
- <g
- style={placed}
- className="transition-transform duration-700 ease-out motion-reduce:transition-none"
- opacity={dimPlane ? 0.55 : 1}
- >
- <path d={PLANE} fill={plane} />
- </g>
- )}
- </svg>
- );
-}
diff --git a/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx b/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx
index e1b5e2793..2aa8df1ae 100644
--- a/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx
+++ b/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx
@@ -1,16 +1,18 @@
-// FE-PLANNER-FLIGHTLIVE-001 to FE-PLANNER-FLIGHTLIVE-008
+// FE-PLANNER-FLIGHTLIVE-001 to FE-PLANNER-FLIGHTLIVE-007
import type { FlightLiveLeg } from '@trek/shared';
-import { beforeEach, describe, expect, it } from 'vitest';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
import { render, screen } from '../../../../tests/helpers/render';
import MFlightLiveStrip, { MPlanFlightLine } from '../../../mobile/screens/trip/MFlightLiveStrip';
import MFlightLiveCard from '../../../mobile/screens/trip/sheets/MFlightLiveCard';
import { legKey, useFlightLiveStore } from '../../../store/flightLiveStore';
import type { Reservation } from '../../../types';
-import FlightArc from './FlightArc';
import FlightLiveCard from './FlightLiveCard';
import FlightLiveStrip, { PlanFlightLiveLine } from './FlightLiveStrip';
+// The map is Leaflet and WebGL, neither of which jsdom draws; the card around it is what is under test here.
+vi.mock('./FlightMiniMap', () => ({ default: () => null, FLIGHT_MAP_CREDIT: 'map credit' }));
+
const H = 3_600_000;
function leg(over: Partial<FlightLiveLeg> = {}): FlightLiveLeg {
@@ -76,7 +78,6 @@ describe('FlightLiveCard', () => {
expect(screen.getByText('+35 min')).toBeInTheDocument();
expect(screen.getByText('Altitude')).toBeInTheDocument();
expect(screen.getByText('A359 D-AIXA')).toBeInTheDocument();
- expect(screen.getByText('Live positions: adsb.lol (ODbL)')).toBeInTheDocument();
});
it('FE-PLANNER-FLIGHTLIVE-002: renders nothing while TREK follows no state for the leg', () => {
@@ -106,7 +107,7 @@ describe('FlightLiveCard', () => {
expect(screen.queryByText('Altitude')).not.toBeInTheDocument();
});
- it('FE-PLANNER-FLIGHTLIVE-004: explains a flight the feed cannot find, and the missing gate only around boarding', () => {
+ it('FE-PLANNER-FLIGHTLIVE-004: shows nothing without live data, and the missing gate only around boarding', () => {
seed(
leg({
phase: 'unknown',
@@ -117,11 +118,8 @@ describe('FlightLiveCard', () => {
last_seen_at: null,
})
);
- const { unmount } = render(<FlightLiveCard tripId={1} reservationId={6} legIndex={0} />);
- expect(screen.getByText('No live data')).toBeInTheDocument();
- expect(screen.queryByText(/Gate, terminal and baggage belt/)).not.toBeInTheDocument();
- // Nothing heard, so the feed is not credited either.
- expect(screen.queryByText('Live positions: adsb.lol (ODbL)')).not.toBeInTheDocument();
+ const { container, unmount } = render(<FlightLiveCard tripId={1} reservationId={6} legIndex={0} />);
+ expect(container).toBeEmptyDOMElement();
unmount();
const now = Date.now();
seed(
@@ -156,7 +154,7 @@ describe('strips and plan lines', () => {
seed(leg());
render(
<>
- <FlightLiveStrip tripId={1} reservationId={6} />
+ <FlightLiveStrip tripId={1} reservationId={6} type="flight" />
<MFlightLiveStrip tripId={1} reservationId={6} onOpen={() => {}} />
</>
);
@@ -179,7 +177,7 @@ describe('strips and plan lines', () => {
const res = { id: 6, type: 'flight' } as Reservation;
const { container } = render(
<>
- <FlightLiveStrip tripId={1} reservationId={6} />
+ <FlightLiveStrip tripId={1} reservationId={6} type="flight" />
<PlanFlightLiveLine tripId={1} res={res} />
<MPlanFlightLine tripId={1} reservationId={6} legIndex={0} />
<PlanFlightLiveLine tripId={1} res={{ ...res, type: 'train' }} />
@@ -188,14 +186,3 @@ describe('strips and plan lines', () => {
expect(container).toBeEmptyDOMElement();
});
});
-
-describe('FlightArc', () => {
- it('FE-PLANNER-FLIGHTLIVE-008: draws the flown part only once under way, and the aircraft on request', () => {
- const { container, rerender } = render(
- <FlightArc progress={0} showPlane={false} track="#999" flown="#00f" plane="#00f" />
- );
- expect(container.querySelectorAll('path')).toHaveLength(1);
- rerender(<FlightArc progress={0.5} showPlane track="#999" flown="#00f" plane="#00f" />);
- expect(container.querySelectorAll('path')).toHaveLength(3);
- });
-});
diff --git a/client/src/components/Planner/flightLive/FlightLiveCard.tsx b/client/src/components/Planner/flightLive/FlightLiveCard.tsx
index f105dbebc..3ae0d0cfd 100644
--- a/client/src/components/Planner/flightLive/FlightLiveCard.tsx
+++ b/client/src/components/Planner/flightLive/FlightLiveCard.tsx
@@ -1,142 +1,167 @@
-import { Info, Radio } from 'lucide-react';
+import { Clock, Info } from 'lucide-react';
import { useTranslation } from '../../../i18n';
import type { DelayTone } from '../../../utils/flightLiveModel';
-import FlightArc from './FlightArc';
+import { Field } from '../bookings/bookingParts';
+import FlightMiniMap, { FLIGHT_MAP_CREDIT } from './FlightMiniMap';
import { useFlightLiveCard, type FlightTimeCell } from './useFlightLiveCard';
-const DELAY_CHIP: Record<DelayTone, string> = {
- ok: 'bg-success-soft text-success',
- minor: 'bg-warning-soft text-warning',
- major: 'bg-danger-soft text-danger',
+type CardTone = 'live' | 'done' | 'planned';
+
+/** The dialog head's pill, one size down: this head sits inside the dialog, under the real one. */
+const PILL =
+ 'inline-flex flex-none items-center gap-1 rounded-full bg-surface-card px-2 py-0.5 text-caption font-semibold text-content shadow-sm';
+
+const DELAY_TONE: Record<DelayTone, string> = {
+ ok: 'text-success',
+ minor: 'text-warning',
+ major: 'text-danger',
+};
+
+/** The head band's tint and the status dot, in the stage's colour like a booking dialog's head. */
+const HEAD: Record<CardTone, { band: string; dot: string }> = {
+ live: { band: 'bg-[color-mix(in_srgb,var(--info)_11%,transparent)]', dot: 'bg-info' },
+ done: { band: 'bg-[color-mix(in_srgb,var(--success)_11%,transparent)]', dot: 'bg-success' },
+ planned: { band: 'bg-surface-tertiary', dot: 'bg-content-faint' },
};
interface FlightLiveCardProps {
tripId: number;
reservationId: number;
legIndex: number;
- /** "Flight 2 of 3" above the card, for a booking with stopovers. */
+ /** "Flight 2 of 3" in the head, for a booking with stopovers. */
legLabel?: string;
}
-function TimeBlock({
+/** The time that counts on a white tile, the planned one struck beside it; both ends' tiles are the same size. */
+function TimeTile({ cell, end }: { cell: FlightTimeCell; end?: boolean }) {
+ return (
+ <span
+ className={`mt-auto flex w-full items-baseline gap-1.5 rounded-lg bg-surface-card px-2.5 py-1.5 tabular-nums shadow-sm ${end ? 'justify-end' : 'justify-start'}`}
+ >
+ {cell.planned && <s className="text-caption text-content-faint">{cell.planned}</s>}
+ <span className="text-subtitle font-semibold leading-tight text-content">{cell.value}</span>
+ </span>
+ );
+}
+
+/** One end of the pass: its label, the airport code large, the city, and its time at the foot. */
+function End({
+ label,
code,
city,
cell,
end,
}: {
+ label: string;
code: string;
city: string | null;
cell: FlightTimeCell;
end?: boolean;
}) {
return (
- <div className={`flex min-w-0 flex-col ${end ? 'items-end text-end' : 'items-start text-start'}`}>
- <span className="font-geist text-title font-bold leading-none tracking-[-0.02em] text-content">{code}</span>
+ <div className={`relative z-[1] flex min-w-0 flex-col ${end ? 'items-end text-end' : 'items-start text-start'}`}>
+ <span className="font-geist text-caption font-semibold uppercase tracking-[0.08em] text-content-faint">
+ {label}
+ </span>
+ <span className="mt-1 font-geist text-title font-bold leading-none tracking-[-0.02em] text-content">{code}</span>
{city && (
- <span dir="auto" className="mt-1 max-w-full truncate text-caption text-content-faint">
+ <span
+ dir="auto"
+ className="mt-1 line-clamp-2 max-w-full break-words text-caption leading-snug text-content-muted"
+ >
{city}
</span>
)}
- <span className="mt-2.5 flex items-baseline gap-1.5 tabular-nums">
- {cell.planned && <s className="text-caption text-content-faint">{cell.planned}</s>}
- <span className="text-subtitle font-semibold text-content">{cell.value}</span>
- </span>
- {cell.note && <span className="text-caption text-content-muted">{cell.note}</span>}
+ <span className="h-3 flex-none" />
+ <TimeTile cell={cell} end={end} />
</div>
);
}
/**
- * A flight's live state in the booking dialog: what is happening now in one
- * line, both airports with their times, the route as an arc with the aircraft
- * on it, and the numbers of the moment. Renders nothing while TREK follows no
- * state for this leg, so the dialog keeps its plain schedule tiles.
+ * A flight's live state in the booking dialog, built from the dialog's own
+ * parts: a tinted head with pills (where the flight stands, what comes next,
+ * the delay) like the dialog's head; the pass with a small real map of the
+ * route behind it and both times on tiles; then the numbers of the moment as
+ * the dialog's fields. Renders nothing while TREK has no live state to show
+ * for this leg, so the dialog keeps its plain schedule tiles.
*/
export default function FlightLiveCard({ tripId, reservationId, legIndex, legLabel }: FlightLiveCardProps) {
const { t } = useTranslation();
const card = useFlightLiveCard(tripId, reservationId, legIndex);
if (!card) return null;
const { leg, view } = card;
- const quiet = view.stage === 'past' || view.stage === 'unknown';
+ const head = HEAD[card.tone];
return (
<section
- className="rounded-xl border border-edge bg-surface-card p-4"
+ className="overflow-hidden rounded-xl border border-edge bg-surface-card"
aria-label={`${leg.flight_number} ${card.headline}`}
>
- {legLabel && (
- <div className="mb-2 font-geist text-caption font-semibold uppercase tracking-[0.06em] text-content-faint">
- {legLabel}
- </div>
- )}
- <header className="flex items-start gap-2.5">
- <span className="relative mt-[7px] flex h-2.5 w-2.5 flex-none">
- {card.live && (
- <span className="absolute inset-0 rounded-full bg-accent opacity-60 motion-safe:animate-ping" />
- )}
- <span
- className={`relative h-2.5 w-2.5 rounded-full ${card.live ? 'bg-accent' : view.stage === 'landed' ? 'bg-success' : 'bg-content-faint'}`}
- />
+ <header className={`flex flex-wrap items-center gap-1.5 px-3 py-2 ${head.band}`}>
+ {legLabel && (
+ <span className="me-1 font-geist text-caption font-semibold uppercase tracking-[0.08em] text-content-faint">
+ {legLabel}
+ </span>
+ )}
+ <span className={PILL}>
+ <span className={`h-1.5 w-1.5 flex-none rounded-full ${head.dot}`} />
+ {card.headline}
</span>
- <div className="min-w-0 flex-1">
- <div className="text-subtitle font-semibold leading-snug text-content">{card.headline}</div>
- {card.detail && <div className="text-caption text-content-muted">{card.detail}</div>}
- </div>
- {card.delay && (
- <span
- className={`flex-none rounded-full px-2.5 py-1 text-caption font-semibold tabular-nums ${DELAY_CHIP[card.delay.tone]}`}
- >
- {card.delay.text}
+ {card.detail && (
+ <span className={PILL}>
+ <Clock size={11} strokeWidth={2.2} className="text-content-faint" />
+ <span className="font-medium text-content-muted">{card.detail}</span>
</span>
)}
+ {card.delay && (
+ <span className={`${PILL} ms-auto tabular-nums ${DELAY_TONE[card.delay.tone]}`}>{card.delay.text}</span>
+ )}
</header>
- <div className="mt-4 grid grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)_minmax(0,1fr)] items-start gap-3">
- <TimeBlock code={leg.origin.code} city={leg.origin.name} cell={card.dep} />
- <div className="flex flex-col items-center pt-1">
- <FlightArc
+ <div className="p-4">
+ <div className="relative grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] items-stretch gap-3 overflow-hidden rounded-lg bg-surface-tertiary px-4 py-3.5">
+ <FlightMiniMap
+ leg={leg}
progress={view.progress}
- showPlane={!quiet}
+ showPlane={view.stage !== 'upcoming' && view.stage !== 'soon'}
dimPlane={view.stale}
- track="var(--text-faint)"
- flown="var(--accent)"
- plane={view.stage === 'landed' ? 'var(--text-muted)' : 'var(--accent)'}
- className="max-w-[260px]"
+ credits={card.attribution ? [card.attribution, FLIGHT_MAP_CREDIT] : [FLIGHT_MAP_CREDIT]}
+ inset={0.36}
+ className="!absolute inset-0 [--fm-ahead:var(--text-muted)] [--fm-code:var(--text-muted)] [--fm-end:var(--bg-card)] [--fm-flown:var(--info)] [--fm-halo:var(--bg-card)] [--fm-plane:var(--info)]"
+ />
+ <End label={t('reservations.span.departure')} code={leg.origin.code} city={leg.origin.name} cell={card.dep} />
+ <div className="relative z-[1] flex items-end justify-center">
+ <span className="rounded-full bg-surface-card px-2 py-0.5 font-geist text-caption font-semibold tracking-[0.04em] text-content-muted shadow-sm">
+ {leg.flight_number}
+ </span>
+ </div>
+ <End
+ label={t('reservations.span.arrival')}
+ code={leg.destination.code}
+ city={leg.destination.name}
+ cell={card.arr}
+ end
/>
- <span className="mt-1 font-geist text-caption font-semibold tracking-[0.04em] text-content-muted">
- {leg.flight_number}
- </span>
- </div>
- <TimeBlock code={leg.destination.code} city={leg.destination.name} cell={card.arr} end />
- </div>
-
- {card.stats.length > 0 && (
- <div className="mt-4 grid grid-cols-2 gap-2 sm:grid-cols-4">
- {card.stats.map((s) => (
- <div key={s.label} className="min-w-0 rounded-lg bg-surface-tertiary px-2.5 py-2">
- <div className="truncate text-caption text-content-faint">{s.label}</div>
- <div className="truncate text-body font-semibold tabular-nums text-content">{s.value}</div>
- </div>
- ))}
</div>
- )}
- {card.gateHint && (
- <p className="mt-3 flex items-start gap-1.5 text-caption text-content-faint">
- <Info size={13} strokeWidth={2} className="mt-px flex-none" />
- {t('flightLive.noGateHint')}
- </p>
- )}
+ {card.stats.length > 0 && (
+ <div className="mt-3 grid auto-cols-fr grid-flow-col gap-2">
+ {card.stats.map((s) => (
+ <Field key={s.label} label={s.label} tabular>
+ {s.value}
+ </Field>
+ ))}
+ </div>
+ )}
- {card.footnote && (
- <footer className="mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 text-caption text-content-faint">
- <span className="inline-flex items-center gap-1.5">
- <Radio size={12} strokeWidth={2} className={view.stale ? 'text-warning' : ''} />
- {card.footnote}
- </span>
- {card.attribution && <span className="ms-auto">{card.attribution}</span>}
- </footer>
- )}
+ {card.gateHint && (
+ <p className="mt-3 flex items-start gap-1.5 text-caption text-content-faint">
+ <Info size={13} strokeWidth={2} className="mt-px flex-none" />
+ {t('flightLive.noGateHint')}
+ </p>
+ )}
+ </div>
</section>
);
}
diff --git a/client/src/components/Planner/flightLive/FlightLiveStrip.tsx b/client/src/components/Planner/flightLive/FlightLiveStrip.tsx
index 9b7fff5ee..0f002e506 100644
--- a/client/src/components/Planner/flightLive/FlightLiveStrip.tsx
+++ b/client/src/components/Planner/flightLive/FlightLiveStrip.tsx
@@ -4,21 +4,11 @@ import { useCurrentFlightLegIndex, useFlightLiveCard } from './useFlightLiveCard
const DELAY_TEXT: Record<DelayTone, string> = { ok: 'text-success', minor: 'text-warning', major: 'text-danger' };
-/** The status dot: pulsing accent while the aircraft moves, green once landed, faint otherwise. */
-function Dot({ live, landed, size }: { live: boolean; landed: boolean; size: string }) {
- return (
- <span className={`relative flex flex-none ${size}`}>
- {live && <span className="absolute inset-0 rounded-full bg-accent opacity-60 motion-safe:animate-ping" />}
- <span
- className={`relative rounded-full ${size} ${live ? 'bg-accent' : landed ? 'bg-success' : 'bg-content-faint'}`}
- />
- </span>
- );
-}
-
interface FlightLiveStripProps {
tripId: number;
reservationId: number;
+ /** The booking's type: anything but a flight renders nothing, so a card can hand every booking in. */
+ type: string;
className?: string;
}
@@ -28,20 +18,24 @@ interface FlightLiveStripProps {
* picture is one click away in the booking dialog. Nothing far ahead of the
* flight (the card shows its date already), nothing once it is long over.
*/
-export default function FlightLiveStrip({ tripId, reservationId, className = '' }: FlightLiveStripProps) {
+export default function FlightLiveStrip({ tripId, reservationId, type, className = '' }: FlightLiveStripProps) {
const legIndex = useCurrentFlightLegIndex(tripId, reservationId);
- if (legIndex == null) return null;
+ if (type !== 'flight' || legIndex == null) return null;
return <Strip tripId={tripId} reservationId={reservationId} legIndex={legIndex} className={className} />;
}
-function Strip({ tripId, reservationId, legIndex, className }: FlightLiveStripProps & { legIndex: number }) {
+function Strip({
+ tripId,
+ reservationId,
+ legIndex,
+ className,
+}: Omit<FlightLiveStripProps, 'type'> & { legIndex: number }) {
const card = useFlightLiveCard(tripId, reservationId, legIndex);
- if (!card || card.view.stage === 'past' || card.view.stage === 'upcoming') return null;
+ if (!card || card.view.stage === 'upcoming') return null;
const { view } = card;
return (
<div className={`flex min-w-0 flex-col gap-1.5 rounded-lg bg-surface-tertiary px-2.5 py-[7px] ${className}`}>
<div className="flex min-w-0 items-center gap-2">
- <Dot live={card.live} landed={view.stage === 'landed'} size="h-2 w-2" />
<span className="min-w-0 flex-1 truncate text-caption font-semibold text-content">{card.line}</span>
{card.delay && card.delay.tone !== 'ok' && (
<span className={`flex-none text-caption font-semibold tabular-nums ${DELAY_TEXT[card.delay.tone]}`}>
@@ -84,10 +78,9 @@ export function PlanFlightLiveLine({
function PlanLine({ tripId, reservationId, legIndex }: { tripId: number; reservationId: number; legIndex: number }) {
const card = useFlightLiveCard(tripId, reservationId, legIndex);
const stage = card?.view.stage;
- if (!card || stage === 'past' || stage === 'upcoming') return null;
+ if (!card || stage === 'upcoming') return null;
return (
<div className="mt-1 flex min-w-0 items-center gap-1.5 text-caption">
- <Dot live={card.live} landed={stage === 'landed'} size="h-1.5 w-1.5" />
<span className={`min-w-0 truncate font-semibold ${card.live ? 'text-content' : 'text-content-muted'}`}>
{card.line}
</span>
diff --git a/client/src/components/Planner/flightLive/FlightMiniMap.tsx b/client/src/components/Planner/flightLive/FlightMiniMap.tsx
new file mode 100644
index 000000000..607386226
--- /dev/null
+++ b/client/src/components/Planner/flightLive/FlightMiniMap.tsx
@@ -0,0 +1,226 @@
+import type { FlightLiveLeg } from '@trek/shared';
+import L from 'leaflet';
+import { useEffect, useMemo, useState } from 'react';
+import { CircleMarker, MapContainer, Marker, Polyline, Tooltip, useMap } from 'react-leaflet';
+import { OFM_DARK, OFM_POSITRON } from '../../../constants/mapDefaults';
+import { useIsDark } from '../../../hooks/useIsDark';
+import { greatCircle, splitRoute, type LatLng } from '../../../utils/flightRoute';
+import VectorBasemap from '../../Map/VectorBasemap';
+import './flightMiniMap.css';
+
+/** Who made the map under the route; named on the map itself, as the tiles' licence asks. */
+export const FLIGHT_MAP_CREDIT = '© OpenFreeMap © OpenMapTiles © OpenStreetMap';
+
+/** An airliner seen from above, nose up, in a 24 box. */
+const PLANE_PATH =
+ 'M12 2c.9 0 1.3.7 1.3 1.6v4.2l6.3 4.8v2.1l-6.3-2.3v4.1l2.4 1.7v1.6l-3.7-1-3.7 1v-1.6l2.4-1.7v-4.1l-6.3 2.3v-2.1l6.3-4.8V3.6C10.7 2.7 11.1 2 12 2Z';
+
+function planeIcon(heading: number, dim: boolean): L.DivIcon {
+ return L.divIcon({
+ className: 'flight-mini-plane',
+ iconSize: [20, 20],
+ iconAnchor: [10, 10],
+ html: `<svg viewBox="0 0 24 24" width="20" height="20" style="transform:rotate(${Math.round(heading)}deg);opacity:${dim ? 0.55 : 1}"><path d="${PLANE_PATH}"/></svg>`,
+ });
+}
+
+/** Where along the route the aircraft really is: the route point nearest to its reported position. */
+function progressOf(route: LatLng[], at: LatLng | null, fallback: number): number {
+ if (!at) return fallback;
+ let best = 0;
+ let bestD = Infinity;
+ route.forEach((p, i) => {
+ const d = (p.lat - at.lat) ** 2 + (((p.lng - at.lng + 540) % 360) - 180) ** 2;
+ if (d < bestD) {
+ bestD = d;
+ best = i;
+ }
+ });
+ return best / (route.length - 1);
+}
+
+/**
+ * Frames the whole route in the free middle of the box, right away and again a
+ * moment later for a box whose fonts were still settling. `inset` is the share
+ * of the width kept clear on either side, where the card lays its airports and
+ * times over the map; the map itself runs on under them, faded.
+ */
+function FitRoute({ route, inset, onReady }: { route: LatLng[]; inset: number; onReady: () => void }) {
+ const map = useMap();
+ useEffect(() => {
+ // No invalidateSize: the dialog and the sheet slide in by transform, which leaves
+ // the layout size alone, and a resize here makes the GL layer schedule a frame
+ // that can outlive the map when React mounts it twice.
+ const fit = () => {
+ const side = Math.round(map.getSize().x * inset) + 10;
+ map.fitBounds(L.latLngBounds(route.map((p) => [p.lat, p.lng])), {
+ paddingTopLeft: [side, 22],
+ paddingBottomRight: [side, 46],
+ animate: false,
+ });
+ };
+ fit();
+ const id = window.setTimeout(() => {
+ fit();
+ onReady();
+ }, 180);
+ return () => window.clearTimeout(id);
+ }, [map, route, inset, onReady]);
+ return null;
+}
+
+/** The slice of a MapLibre map this file touches. */
+interface GlMap {
+ getStyle(): { layers?: { id: string; type: string }[] } | undefined;
+ setLayoutProperty(id: string, key: string, value: string): void;
+ on(event: string, fn: () => void): void;
+ off(event: string, fn: () => void): void;
+}
+
+/**
+ * Hides the basemap's place names. Under a faded route at world scale they are
+ * clutter ("Italy" beside a Frankfurt dot), and the two airport codes on the
+ * route say all there is. The GL map only exists once its layer attached, so
+ * this waits for it, and hides again on each restyle (dark mode).
+ */
+function HideLabels() {
+ const map = useMap();
+ useEffect(() => {
+ let gl: GlMap | null = null;
+ const hide = () => {
+ for (const layer of gl?.getStyle()?.layers ?? []) {
+ if (layer.type === 'symbol') gl?.setLayoutProperty(layer.id, 'visibility', 'none');
+ }
+ };
+ const find = () => {
+ if (gl) return;
+ map.eachLayer((layer) => {
+ const found = (layer as unknown as { getMaplibreMap?: () => GlMap }).getMaplibreMap?.();
+ if (found && !gl) {
+ gl = found;
+ gl.on('styledata', hide);
+ hide();
+ }
+ });
+ };
+ find();
+ map.on('layeradd', find);
+ return () => {
+ map.off('layeradd', find);
+ gl?.off('styledata', hide);
+ };
+ }, [map]);
+ return null;
+}
+
+/** One end of the route: a ring with the airport code under it. */
+function RouteEnd({ at, code }: { at: LatLng; code: string }) {
+ return (
+ <CircleMarker
+ center={[at.lat, at.lng]}
+ radius={3.5}
+ pathOptions={{ className: 'flight-mini-end', interactive: false }}
+ >
+ <Tooltip permanent direction="bottom" offset={[0, 3]} className="flight-mini-code">
+ {code}
+ </Tooltip>
+ </CircleMarker>
+ );
+}
+
+interface FlightMiniMapProps {
+ leg: FlightLiveLeg;
+ /** Share of the way flown, used while the feed reports no position. */
+ progress: number;
+ /** The aircraft only while it is on its way or just down; never for a flight still at the gate. */
+ showPlane: boolean;
+ dimPlane: boolean;
+ /** The licences behind the picture (live data, map), kept on the map as its hover text and for screen readers. */
+ credits: string[];
+ /** Share of the width on either side kept clear of the route, for what the card lays over the map there. */
+ inset?: number;
+ className?: string;
+}
+
+/**
+ * The flight on a real map, small and quiet: the great circle between the two
+ * airports, solid where it is flown and dotted where it is left, the aircraft
+ * on the line as far as the feed last saw it, turned along the route. Nothing on it reacts to a
+ * touch, it is a picture. The edges fade into the surface on all four sides
+ * (flightMiniMap.css), and the map fades in once it is framed, so it never
+ * shows a jump from the world view to the route. Colours come in as the custom
+ * properties --fm-flown, --fm-ahead, --fm-end, --fm-plane and --fm-code.
+ */
+export default function FlightMiniMap({
+ leg,
+ progress,
+ showPlane,
+ dimPlane,
+ credits,
+ inset = 0,
+ className = '',
+}: FlightMiniMapProps) {
+ const dark = useIsDark();
+ // The quiet OpenFreeMap styles rather than the user's basemap: under a faded route any busier map is noise.
+ const style = dark ? OFM_DARK : OFM_POSITRON;
+ const [ready, setReady] = useState(false);
+ const onReady = useMemo(() => () => setReady(true), []);
+
+ const { origin, destination, position } = leg;
+ const route = useMemo(
+ () => greatCircle({ lat: origin.lat, lng: origin.lng }, { lat: destination.lat, lng: destination.lng }),
+ [origin.lat, origin.lng, destination.lat, destination.lng]
+ );
+ // The reported position only says how far along the flight is; the aircraft
+ // itself sits on the drawn line, nose along it, so it never floats beside it.
+ const split = useMemo(
+ () => splitRoute(route, progressOf(route, position ? { lat: position.lat, lng: position.lng } : null, progress)),
+ [route, position, progress]
+ );
+ const planeAt = split.at;
+ const icon = useMemo(() => planeIcon(split.heading, dimPlane), [split, dimPlane]);
+
+ return (
+ <div
+ className={`flight-mini-map relative overflow-hidden transition-opacity duration-700 ease-out ${ready ? 'opacity-100' : 'opacity-0'} ${className}`}
+ title={credits.join('\n')}
+ >
+ <span className="sr-only">{credits.join(', ')}</span>
+ <MapContainer
+ center={[route[0].lat, route[0].lng]}
+ zoom={2}
+ zoomSnap={0.25}
+ zoomControl={false}
+ attributionControl={false}
+ dragging={false}
+ scrollWheelZoom={false}
+ doubleClickZoom={false}
+ touchZoom={false}
+ boxZoom={false}
+ keyboard={false}
+ worldCopyJump={false}
+ zoomAnimation={false}
+ fadeAnimation={false}
+ markerZoomAnimation={false}
+ // A picture in a box of fixed size: window resizes do not concern it.
+ trackResize={false}
+ className="h-full w-full bg-transparent"
+ >
+ <VectorBasemap style={style} />
+ <HideLabels />
+ <FitRoute route={route} inset={inset} onReady={onReady} />
+ <Polyline
+ positions={split.ahead.map((p) => [p.lat, p.lng])}
+ pathOptions={{ className: 'flight-mini-ahead', interactive: false }}
+ />
+ <Polyline
+ positions={split.flown.map((p) => [p.lat, p.lng])}
+ pathOptions={{ className: 'flight-mini-flown', interactive: false }}
+ />
+ <RouteEnd at={route[0]} code={origin.code} />
+ <RouteEnd at={route[route.length - 1]} code={destination.code} />
+ {showPlane && <Marker position={[planeAt.lat, planeAt.lng]} icon={icon} interactive={false} keyboard={false} />}
+ </MapContainer>
+ </div>
+ );
+}
diff --git a/client/src/components/Planner/flightLive/flightMiniMap.css b/client/src/components/Planner/flightLive/flightMiniMap.css
new file mode 100644
index 000000000..028d726d2
--- /dev/null
+++ b/client/src/components/Planner/flightLive/flightMiniMap.css
@@ -0,0 +1,92 @@
+/* The flight mini map (FlightMiniMap.tsx). Leaflet draws its lines and markers
+ as SVG and HTML it builds itself, so their colours come from custom
+ properties the card sets on the box: --fm-flown, --fm-ahead, --fm-plane. */
+
+/* Fades the map into the surface on all four sides: two crossed linear masks,
+ intersected, so the middle with the route is fully there, the map stays
+ faint under the airports and times laid over it, and every edge runs out. */
+.flight-mini-map {
+ -webkit-mask-image:
+ linear-gradient(
+ to right,
+ transparent 4%,
+ rgb(0 0 0 / 0.35) 24%,
+ #000 38%,
+ #000 62%,
+ rgb(0 0 0 / 0.35) 76%,
+ transparent 96%
+ ),
+ linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
+ -webkit-mask-composite: source-in;
+ mask-image:
+ linear-gradient(
+ to right,
+ transparent 4%,
+ rgb(0 0 0 / 0.35) 24%,
+ #000 38%,
+ #000 62%,
+ rgb(0 0 0 / 0.35) 76%,
+ transparent 96%
+ ),
+ linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
+ mask-composite: intersect;
+}
+
+.flight-mini-map .leaflet-container {
+ background: transparent;
+ cursor: default;
+}
+
+.flight-mini-map .flight-mini-flown {
+ stroke: var(--fm-flown);
+ stroke-width: 2.5;
+ stroke-linecap: round;
+ fill: none;
+}
+
+.flight-mini-map .flight-mini-ahead {
+ stroke: var(--fm-ahead);
+ stroke-width: 1.75;
+ stroke-dasharray: 2 5;
+ stroke-linecap: round;
+ fill: none;
+}
+
+.flight-mini-map .flight-mini-end {
+ stroke: var(--fm-flown);
+ stroke-width: 2;
+ fill: var(--fm-end);
+ fill-opacity: 1;
+}
+
+.flight-mini-map .flight-mini-plane {
+ background: none;
+ border: 0;
+}
+
+.flight-mini-map .flight-mini-plane svg {
+ fill: var(--fm-plane);
+ /* A light outline lifts the aircraft off the line and the map under it. */
+ stroke: var(--fm-halo, #fff);
+ stroke-width: 1.6;
+ paint-order: stroke;
+ stroke-linejoin: round;
+ filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.3));
+}
+
+/* The airport codes at the two ends of the route, quiet text without Leaflet's tooltip box. */
+.flight-mini-map .leaflet-tooltip.flight-mini-code {
+ padding: 0;
+ border: 0;
+ background: none;
+ box-shadow: none;
+ color: var(--fm-code);
+ font-family: var(--font-geist, inherit);
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.06em;
+}
+
+.flight-mini-map .leaflet-tooltip.flight-mini-code::before {
+ display: none;
+}
diff --git a/client/src/components/Planner/flightLive/useFlightLiveCard.ts b/client/src/components/Planner/flightLive/useFlightLiveCard.ts
index 79ffc434a..3331bd375 100644
--- a/client/src/components/Planner/flightLive/useFlightLiveCard.ts
+++ b/client/src/components/Planner/flightLive/useFlightLiveCard.ts
@@ -11,6 +11,7 @@ import {
splitDuration,
type DelayTone,
type FlightLiveView,
+ type FlightStage,
} from '../../../utils/flightLiveModel';
type T = ReturnType<typeof useTranslation>['t'];
@@ -18,10 +19,8 @@ type T = ReturnType<typeof useTranslation>['t'];
export interface FlightTimeCell {
/** The time that counts now: observed, estimated or planned. */
value: string;
- /** The planned time, only when it differs from `value`. */
+ /** The planned time, only when it differs from `value`, shown struck beside it. */
planned: string | null;
- /** Shown under the time: "estimated", "actual" or nothing. */
- note: string | null;
}
interface FlightStat {
@@ -32,9 +31,9 @@ interface FlightStat {
interface FlightLiveCard {
leg: FlightLiveLeg;
view: FlightLiveView;
- /** The big line: "Departs in 2 h 10 min", "In the air", "Landed". */
+ /** Where the flight stands: "Scheduled", "In the air", "Landed". */
headline: string;
- /** The quieter line under it, or null. */
+ /** What comes next: "Departs in 2 h 10 min", "Lands in 5 h", or null. */
detail: string | null;
/** Both in one line for the strips and plan rows, in the language's own joining. */
line: string;
@@ -42,22 +41,28 @@ interface FlightLiveCard {
dep: FlightTimeCell;
arr: FlightTimeCell;
stats: FlightStat[];
- /** "Updated 2 min ago" with the feed's credit, or null before any data. */
- footnote: string | null;
+ /** Who the live data came from, credited quietly on the map once the feed has seen this flight. */
attribution: string | null;
/** Around boarding, where a traveller looks for a gate open data does not have. */
gateHint: boolean;
- /** True while the aircraft is moving, for the pulsing status dot. */
+ /** True while the aircraft is moving. */
live: boolean;
+ /** The colour family of the stage, for the tinted head of the card. */
+ tone: 'live' | 'done' | 'planned';
}
-/** The current time, ticking every `ms` while mounted, for countdowns that move. */
-function useNow(ms: number): number {
+/**
+ * The current time, ticking every `ms` while `active`, for countdowns that move.
+ * Idle without a flight to show, so a booking TREK follows no state for sets
+ * no timer at all.
+ */
+function useNow(ms: number, active: boolean): number {
const [now, setNow] = useState(() => Date.now());
useEffect(() => {
+ if (!active) return;
const id = window.setInterval(() => setNow(Date.now()), ms);
return () => window.clearInterval(id);
- }, [ms]);
+ }, [ms, active]);
return now;
}
@@ -75,21 +80,23 @@ function delayText(minutes: number | null, t: T): { text: string; tone: DelayTon
return { text: t('flightLive.onTime'), tone: 'ok' };
}
+/** The stages a card speaks for; without live data (past, unknown) there is no card. */
+type ShownStage = Exclude<FlightStage, 'past' | 'unknown'>;
+
function headlineOf(
+ stage: ShownStage,
view: FlightLiveView,
leg: FlightLiveLeg,
t: T,
time: (ms: number, tz: string | null) => string
): { headline: string; detail: string | null } {
- switch (view.stage) {
+ switch (stage) {
case 'upcoming':
case 'soon':
return {
- headline:
- view.countdownMs != null
- ? t('flightLive.departsIn', { time: durationText(view.countdownMs, t) })
- : t('flightLive.scheduled'),
- detail: view.stage === 'soon' ? t('flightLive.watching') : null,
+ headline: t('flightLive.scheduled'),
+ detail:
+ view.countdownMs != null ? t('flightLive.departsIn', { time: durationText(view.countdownMs, t) }) : null,
};
case 'taxiing':
return { headline: t('flightLive.taxiing'), detail: t('flightLive.atAirport', { code: leg.origin.code }) };
@@ -109,32 +116,31 @@ function headlineOf(
})
: null,
};
- case 'past':
- return { headline: t('flightLive.over'), detail: null };
- case 'unknown':
- return { headline: t('flightLive.noSignal'), detail: t('flightLive.noSignalHint') };
}
}
+/** One end's time: what counts now (observed or estimated), the planned one beside it when they differ. */
function timeCell(
actual: number | null,
planned: number | null,
tz: string | null,
- estimate: boolean,
- time: (ms: number, tz: string | null) => string,
- t: T
+ time: (ms: number, tz: string | null) => string
): FlightTimeCell {
const shown = actual ?? planned;
- if (shown == null) return { value: '--:--', planned: null, note: null };
+ if (shown == null) return { value: '--:--', planned: null };
const value = time(shown, tz);
const plannedText = planned != null ? time(planned, tz) : null;
- return {
- value,
- planned: actual != null && plannedText !== value ? plannedText : null,
- note: actual == null ? null : estimate ? t('flightLive.estimated') : t('flightLive.actual'),
- };
+ return { value, planned: actual != null && plannedText !== value ? plannedText : null };
}
+const TONE: Record<ShownStage, FlightLiveCard['tone']> = {
+ upcoming: 'planned',
+ soon: 'planned',
+ taxiing: 'live',
+ airborne: 'live',
+ landed: 'done',
+};
+
/** Altitude, speed and distance in the user's units while in the air, and the aircraft when known. */
function statsOf(leg: FlightLiveLeg, view: FlightLiveView, imperial: boolean, locale: string, t: T): FlightStat[] {
const stats: FlightStat[] = [];
@@ -164,18 +170,8 @@ function statsOf(leg: FlightLiveLeg, view: FlightLiveView, imperial: boolean, lo
return stats;
}
-/** "Updated 2 min ago", or the age of the last signal once it is stale; null before the feed ever heard it. */
-function footnoteOf(leg: FlightLiveLeg, view: FlightLiveView, now: number, t: T): string | null {
- if (!leg.last_seen_at) return null;
- const age = now - Date.parse(leg.last_seen_at);
- return view.stale
- ? t('flightLive.lastSignal', { time: durationText(age, t) })
- : t('flightLive.updated', { time: durationText(Math.max(60_000, age), t) });
-}
-
/** In the air and on the ground the arrival delay counts, before take-off the departure delay. */
function delayOf(view: FlightLiveView, t: T): { text: string; tone: DelayTone } | null {
- if (view.stage === 'past' || view.stage === 'unknown') return null;
const flying = view.stage === 'airborne' || view.stage === 'landed';
return delayText(flying ? (view.arrDelay ?? view.depDelay) : view.depDelay, t);
}
@@ -192,13 +188,14 @@ export function useFlightLiveCard(tripId: number, reservationId: number, legInde
const leg = useFlightLiveLeg(tripId, reservationId, legIndex);
const attribution = useFlightLiveAttribution(tripId);
// A second-level countdown is noise; the minute tick is what a traveller reads.
- const now = useNow(30_000);
+ const now = useNow(30_000, !!leg);
if (!leg) return null;
const view = flightLiveView(leg, now);
+ // No live data to show: the flight is long over, or the feed never heard it. Nothing at all then.
+ if (view.stage === 'past' || view.stage === 'unknown') return null;
const time = (ms: number, tz: string | null) => airportTime(ms, tz, locale, timeFormat);
- const { headline, detail } = headlineOf(view, leg, t, time);
- const footnote = footnoteOf(leg, view, now, t);
+ const { headline, detail } = headlineOf(view.stage, view, leg, t, time);
return {
leg,
view,
@@ -206,14 +203,14 @@ export function useFlightLiveCard(tripId: number, reservationId: number, legInde
detail,
line: detail && view.stage === 'airborne' ? t('flightLive.headlineDetail', { headline, detail }) : headline,
delay: delayOf(view, t),
- dep: timeCell(view.depActual, view.depPlanned, leg.origin.timezone, false, time, t),
- arr: timeCell(view.arrExpected, view.arrPlanned, leg.destination.timezone, view.arrIsEstimate, time, t),
+ dep: timeCell(view.depActual, view.depPlanned, leg.origin.timezone, time),
+ arr: timeCell(view.arrExpected, view.arrPlanned, leg.destination.timezone, time),
stats: statsOf(leg, view, imperial, locale, t),
- footnote,
// The feed is credited only for data it gave.
- attribution: footnote ? attribution : null,
+ attribution: leg.last_seen_at ? attribution : null,
gateHint: view.stage === 'soon' || view.stage === 'taxiing',
live: view.stage === 'airborne' || view.stage === 'taxiing',
+ tone: TONE[view.stage],
};
}
@@ -223,6 +220,6 @@ export function useFlightLiveCard(tripId: number, reservationId: number, legInde
*/
export function useCurrentFlightLegIndex(tripId: number, reservationId: number): number | null {
const legs = useFlightLiveLegs(tripId, reservationId);
- const now = useNow(60_000);
+ const now = useNow(60_000, legs.length > 0);
return currentLeg(legs, now)?.leg_index ?? null;
}
diff --git a/client/src/components/Planner/flightLive/useFlightLiveSync.ts b/client/src/components/Planner/flightLive/useFlightLiveSync.ts
index 46a127e26..5ece90eff 100644
--- a/client/src/components/Planner/flightLive/useFlightLiveSync.ts
+++ b/client/src/components/Planner/flightLive/useFlightLiveSync.ts
@@ -1,3 +1,4 @@
+import type { FlightLiveLeg } from '@trek/shared';
import { useEffect } from 'react';
import { useFlightLiveStore, watchFlightLive } from '../../../store/flightLiveStore';
import { toMs } from '../../../utils/flightLiveModel';
@@ -7,12 +8,25 @@ const IDLE_MS = 10 * 60_000;
const BEFORE_MS = 3 * 60 * 60_000;
const AFTER_MS = 2 * 60 * 60_000;
-/** True while one of the trip's legs is inside its watch window, where minutes matter. */
+const legsOf = (tripId: number): FlightLiveLeg[] =>
+ Object.values(useFlightLiveStore.getState().trips[tripId]?.legs ?? {});
+const departureOf = (leg: FlightLiveLeg) => toMs(leg.departed_at) ?? toMs(leg.scheduled_departure);
+const arrivalOf = (leg: FlightLiveLeg) =>
+ toMs(leg.landed_at) ?? toMs(leg.estimated_arrival) ?? toMs(leg.scheduled_arrival);
+
+/** True while one of the trip's flights still lies ahead or is under way: only then is re-reading worth it. */
+function anyToFollow(tripId: number, now: number): boolean {
+ return legsOf(tripId).some((leg) => {
+ const arr = arrivalOf(leg);
+ return leg.phase !== 'landed' && arr != null && now <= arr + AFTER_MS;
+ });
+}
+
+/** True while one of the trip's flights is inside its watch window, where minutes matter. */
function anyActive(tripId: number, now: number): boolean {
- const legs = Object.values(useFlightLiveStore.getState().trips[tripId]?.legs ?? {});
- return legs.some((leg) => {
- const dep = toMs(leg.departed_at) ?? toMs(leg.scheduled_departure);
- const arr = toMs(leg.landed_at) ?? toMs(leg.estimated_arrival) ?? toMs(leg.scheduled_arrival);
+ return legsOf(tripId).some((leg) => {
+ const dep = departureOf(leg);
+ const arr = arrivalOf(leg);
return dep != null && arr != null && now >= dep - BEFORE_MS && now <= arr + AFTER_MS && leg.phase !== 'landed';
});
}
@@ -21,37 +35,36 @@ function anyActive(tripId: number, now: number): boolean {
* Keeps the open trip's live flight states current: one read when the trip has
* flights, the server's `flight:live` pushes in between, and a quiet re-read
* (every minute while a flight is near, every ten otherwise) as the safety net
- * for a missed push. Nothing runs while the tab is hidden; coming back reads
- * once. Mounted once per open trip by the planner, on desktop and phone alike.
+ * for a missed push, but only while a flight still lies ahead: a trip whose
+ * flights are all over is read once and left alone. Nothing runs while the tab
+ * is hidden; coming back reads once. Mounted once per open trip by the
+ * planner, on desktop and phone alike.
*/
export function useFlightLiveSync(tripId: number, hasFlights: boolean): void {
useEffect(() => {
if (!hasFlights || !Number.isFinite(tripId)) return;
- const load = () => void useFlightLiveStore.getState().load(tripId);
- load();
- const stopWatching = watchFlightLive(tripId);
-
let timer = 0;
+ let stopped = false;
+ const load = () => useFlightLiveStore.getState().load(tripId);
const schedule = () => {
window.clearTimeout(timer);
- timer = window.setTimeout(
- () => {
- if (!document.hidden) load();
- schedule();
- },
- anyActive(tripId, Date.now()) ? ACTIVE_MS : IDLE_MS
- );
+ const now = Date.now();
+ if (stopped || !anyToFollow(tripId, now)) return;
+ timer = window.setTimeout(tick, anyActive(tripId, now) ? ACTIVE_MS : IDLE_MS);
};
- schedule();
+ const tick = () => {
+ if (document.hidden) schedule();
+ else void load().then(schedule);
+ };
+ void load().then(schedule);
+ const stopWatching = watchFlightLive(tripId);
const onVisible = () => {
- if (!document.hidden) {
- load();
- schedule();
- }
+ if (!document.hidden) void load().then(schedule);
};
document.addEventListener('visibilitychange', onVisible);
return () => {
+ stopped = true;
window.clearTimeout(timer);
stopWatching();
document.removeEventListener('visibilitychange', onVisible);
diff --git a/client/src/mobile/screens/admin/MAdminSettingsSection.tsx b/client/src/mobile/screens/admin/MAdminSettingsSection.tsx
index fe5fc25e3..61997bd12 100644
--- a/client/src/mobile/screens/admin/MAdminSettingsSection.tsx
+++ b/client/src/mobile/screens/admin/MAdminSettingsSection.tsx
@@ -188,24 +188,13 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio
</MAdminCard>
{/* Live flight status: open ADS-B data, no key, on by default (desktop parity). */}
- <MAdminCard>
- <MAdminCardHead
- title={t('flightLive.adminTitle')}
- hint={managed ? t('flightLive.adminHintManaged') : t('flightLive.adminHint')}
- />
- <MAdminRow
- title={t('flightLive.adminToggle')}
- hint={flightLiveLocked ? t('flightLive.envLocked') : undefined}
- trailing={
- <MToggle
- checked={flightLive}
- ariaLabel={t('flightLive.adminToggle')}
- disabled={flightLiveLocked}
- onChange={(v) => void handleToggleAuthSetting('flight_live_enabled', v, setFlightLive)}
- />
- }
- />
- </MAdminCard>
+ <FlightLiveCard
+ t={t}
+ managed={!!managed}
+ on={flightLive}
+ locked={flightLiveLocked}
+ onChange={(v) => void handleToggleAuthSetting('flight_live_enabled', v, setFlightLive)}
+ />
{/* Allowed file types */}
<MAdminCard>
@@ -440,3 +429,23 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio
</div>
)
}
+
+/** The live flight status switch, locked with a word when the server environment holds it. */
+function FlightLiveCard({ t, managed, on, locked, onChange }: {
+ t: TranslationFn
+ managed: boolean
+ on: boolean
+ locked: boolean
+ onChange: (on: boolean) => void
+}) {
+ return (
+ <MAdminCard>
+ <MAdminCardHead title={t('flightLive.adminTitle')} hint={managed ? t('flightLive.adminHintManaged') : t('flightLive.adminHint')} />
+ <MAdminRow
+ title={t('flightLive.adminToggle')}
+ hint={locked ? t('flightLive.envLocked') : undefined}
+ trailing={<MToggle checked={on} ariaLabel={t('flightLive.adminToggle')} disabled={locked} onChange={onChange} />}
+ />
+ </MAdminCard>
+ )
+}
diff --git a/client/src/mobile/screens/trip/MFlightLiveStrip.tsx b/client/src/mobile/screens/trip/MFlightLiveStrip.tsx
index 19689f35f..5d3ca9bb2 100644
--- a/client/src/mobile/screens/trip/MFlightLiveStrip.tsx
+++ b/client/src/mobile/screens/trip/MFlightLiveStrip.tsx
@@ -9,24 +9,6 @@ const DELAY_COLOR: Record<DelayTone, string> = {
const LIVE = 'var(--m-st-info)';
-/** The status dot: pulsing blue while the aircraft moves, green once landed, faint otherwise. */
-function Dot({ live, landed, size }: { live: boolean; landed: boolean; size: string }) {
- return (
- <span className={`relative flex flex-none ${size}`}>
- {live && (
- <span
- className="absolute inset-0 rounded-full opacity-60 motion-safe:animate-ping"
- style={{ background: LIVE }}
- />
- )}
- <span
- className={`relative rounded-full ${size}`}
- style={{ background: live ? LIVE : landed ? 'var(--m-st-confirmed)' : 'var(--m-faint)' }}
- />
- </span>
- );
-}
-
interface MFlightLiveStripProps {
tripId: number;
reservationId: number;
@@ -51,7 +33,7 @@ export default function MFlightLiveStrip({ tripId, reservationId, onOpen, classN
function Strip({ tripId, reservationId, legIndex, onOpen, className }: MFlightLiveStripProps & { legIndex: number }) {
const card = useFlightLiveCard(tripId, reservationId, legIndex);
- if (!card || card.view.stage === 'past' || card.view.stage === 'upcoming') return null;
+ if (!card || card.view.stage === 'upcoming') return null;
const { view } = card;
return (
<button
@@ -60,7 +42,6 @@ function Strip({ tripId, reservationId, legIndex, onOpen, className }: MFlightLi
className={`flex min-w-0 flex-col gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px] text-start ${className}`}
>
<span className="flex w-full min-w-0 items-center gap-2">
- <Dot live={card.live} landed={view.stage === 'landed'} size="h-[7px] w-[7px]" />
<span className="min-w-0 flex-1 truncate text-caption font-semibold text-m-ink">{card.line}</span>
{card.delay && card.delay.tone !== 'ok' && (
<span
@@ -102,10 +83,9 @@ export function MPlanFlightLine({
}) {
const card = useFlightLiveCard(tripId, reservationId, legIndex);
const stage = card?.view.stage;
- if (!card || stage === 'past' || stage === 'upcoming') return null;
+ if (!card || stage === 'upcoming') return null;
return (
<div className="mt-[2px] flex min-w-0 items-center gap-[6px] font-geist text-caption">
- <Dot live={card.live} landed={stage === 'landed'} size="h-[6px] w-[6px]" />
<span className="min-w-0 truncate font-semibold" style={{ color: card.live ? LIVE : 'var(--m-muted)' }}>
{card.line}
</span>
diff --git a/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx b/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx
index 03e86a6eb..39f2efd03 100644
--- a/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx
+++ b/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx
@@ -1,46 +1,73 @@
-import { Info, Radio } from 'lucide-react';
-import FlightArc from '../../../../components/Planner/flightLive/FlightArc';
+import { Clock, Info } from 'lucide-react';
+import FlightMiniMap, { FLIGHT_MAP_CREDIT } from '../../../../components/Planner/flightLive/FlightMiniMap';
import { useFlightLiveCard, type FlightTimeCell } from '../../../../components/Planner/flightLive/useFlightLiveCard';
import { useTranslation } from '../../../../i18n';
import type { DelayTone } from '../../../../utils/flightLiveModel';
import { INNER_CLS, StatBox } from './MTripSheetUi';
-const DELAY_CHIP: Record<DelayTone, string> = {
- ok: 'bg-[color-mix(in_srgb,var(--m-st-confirmed)_16%,transparent)] text-[color:var(--m-st-confirmed)]',
- minor: 'bg-[color-mix(in_srgb,var(--m-st-pending)_18%,transparent)] text-[color:var(--m-st-pending)]',
- major: 'bg-[color-mix(in_srgb,var(--m-st-danger)_16%,transparent)] text-[color:var(--m-st-danger)]',
+type CardTone = 'live' | 'done' | 'planned';
+
+const DELAY_TONE: Record<DelayTone, string> = {
+ ok: 'text-[color:var(--m-st-confirmed)]',
+ minor: 'text-[color:var(--m-st-pending)]',
+ major: 'text-[color:var(--m-st-danger)]',
+};
+
+/** The head band's tint and the status dot, in the stage's colour. */
+const HEAD: Record<CardTone, { band: string; dot: string }> = {
+ live: { band: 'bg-[color-mix(in_srgb,var(--m-st-info)_12%,transparent)]', dot: 'bg-[color:var(--m-st-info)]' },
+ done: {
+ band: 'bg-[color-mix(in_srgb,var(--m-st-confirmed)_12%,transparent)]',
+ dot: 'bg-[color:var(--m-st-confirmed)]',
+ },
+ planned: { band: 'bg-[color:var(--m-ic)]', dot: 'bg-[color:var(--m-faint)]' },
};
-const LIVE = 'var(--m-st-info)';
+const BADGE =
+ 'inline-flex flex-none items-center gap-[5px] rounded-full bg-[color:var(--m-inner)] px-[7px] py-[2px] font-geist text-caption font-bold shadow-sm';
-function Airport({
+/** The time that counts on a tile, the planned one struck beside it; both ends' tiles are the same size. */
+function TimeTile({ cell, end }: { cell: FlightTimeCell; end?: boolean }) {
+ return (
+ <span
+ className={`mt-auto flex w-full items-baseline gap-[5px] rounded-[10px] bg-[color:var(--m-inner)] px-[9px] py-[6px] tabular-nums shadow-sm ${end ? 'justify-end' : 'justify-start'}`}
+ >
+ {cell.planned && <s className="font-geist text-caption text-m-faint">{cell.planned}</s>}
+ <span className="font-geist text-subtitle font-bold leading-tight text-m-ink">{cell.value}</span>
+ </span>
+ );
+}
+
+/** One end of the pass: its label, the airport code large, the city, and its time at the foot. */
+function End({
+ label,
code,
city,
cell,
end,
}: {
+ label: string;
code: string;
city: string | null;
cell: FlightTimeCell;
end?: boolean;
}) {
return (
- <div className={`flex min-w-0 flex-col ${end ? 'items-end text-end' : 'items-start text-start'}`}>
- <span className="font-geist text-title font-bold leading-none tracking-[-0.03em] text-m-ink">{code}</span>
+ <div className={`relative z-[1] flex min-w-0 flex-col ${end ? 'items-end text-end' : 'items-start text-start'}`}>
+ <span className="font-geist text-caption font-bold uppercase tracking-[.08em] text-m-faint">{label}</span>
+ <span className="mt-[3px] font-geist text-title font-bold leading-none tracking-[-0.03em] text-m-ink">
+ {code}
+ </span>
{city && (
- <span dir="auto" className="mt-[3px] max-w-full truncate text-caption text-m-faint">
+ <span
+ dir="auto"
+ className="mt-[3px] line-clamp-2 max-w-full break-words text-caption leading-snug text-m-muted"
+ >
{city}
</span>
)}
- {cell.planned && <s className="mt-[7px] font-geist text-caption tabular-nums text-m-faint">{cell.planned}</s>}
- <span
- className={`${cell.planned ? '' : 'mt-[7px]'} font-geist text-subtitle font-bold tabular-nums leading-tight text-m-ink`}
- >
- {cell.value}
- </span>
- {cell.note && (
- <span className="text-caption font-medium uppercase tracking-[.05em] text-m-muted">{cell.note}</span>
- )}
+ <span className="h-[10px] flex-none" />
+ <TimeTile cell={cell} end={end} />
</div>
);
}
@@ -53,98 +80,86 @@ interface MFlightLiveCardProps {
}
/**
- * The live flight card of the phone's transport sheet: the moment in one line,
- * the two airports large with their times, the route as an arc with the
- * aircraft on it, and the numbers of the moment as the sheet's own stat boxes.
- * Same data as the desktop card (useFlightLiveCard), laid out for a thumb.
+ * The live flight card of the phone's transport sheet, laid out like the
+ * desktop card (useFlightLiveCard) from the sheet's own parts: a tinted head
+ * with badges (where the flight stands, what comes next, the delay), the pass
+ * with the small route map behind it and both times on tiles, then the numbers
+ * of the moment as the sheet's stat boxes. Nothing without live data.
*/
export default function MFlightLiveCard({ tripId, reservationId, legIndex, legLabel }: MFlightLiveCardProps) {
const { t } = useTranslation();
const card = useFlightLiveCard(tripId, reservationId, legIndex);
if (!card) return null;
const { leg, view } = card;
- const quiet = view.stage === 'past' || view.stage === 'unknown';
+ const head = HEAD[card.tone];
return (
<section
- className={`mt-[14px] rounded-[18px] px-[14px] pb-3 pt-[13px] ${INNER_CLS}`}
+ className={`mt-[14px] overflow-hidden rounded-[18px] ${INNER_CLS}`}
aria-label={`${leg.flight_number} ${card.headline}`}
>
- {legLabel && (
- <div className="mb-[6px] font-geist text-caption font-bold uppercase tracking-[.08em] text-m-faint">
- {legLabel}
- </div>
- )}
- <div className="flex items-start gap-[9px]">
- <span className="relative mt-[7px] flex h-2 w-2 flex-none">
- {card.live && (
- <span
- className="absolute inset-0 rounded-full opacity-60 motion-safe:animate-ping"
- style={{ background: LIVE }}
- />
- )}
- <span
- className="relative h-2 w-2 rounded-full"
- style={{
- background: card.live ? LIVE : view.stage === 'landed' ? 'var(--m-st-confirmed)' : 'var(--m-faint)',
- }}
- />
+ <div className={`flex items-center gap-[5px] px-[10px] py-[7px] ${head.band}`}>
+ {legLabel && (
+ <span className="me-[2px] font-geist text-caption font-bold uppercase tracking-[.08em] text-m-faint">
+ {legLabel}
+ </span>
+ )}
+ <span className={`${BADGE} text-m-ink`}>
+ <span className={`h-[6px] w-[6px] flex-none rounded-full ${head.dot}`} />
+ {card.headline}
</span>
- <div className="min-w-0 flex-1">
- <div className="text-body font-semibold leading-snug text-m-ink">{card.headline}</div>
- {card.detail && <div className="mt-px text-caption text-m-muted">{card.detail}</div>}
- </div>
- {card.delay && (
- <span
- className={`flex-none rounded-full px-[9px] py-[3px] font-geist text-caption font-bold tabular-nums ${DELAY_CHIP[card.delay.tone]}`}
- >
- {card.delay.text}
+ {card.detail && (
+ <span className={`${BADGE} min-w-0 flex-initial font-semibold text-m-muted`}>
+ <Clock size={10} strokeWidth={2.2} className="flex-none" />
+ <span className="truncate">{card.detail}</span>
</span>
)}
+ {card.delay && (
+ <span className={`${BADGE} ms-auto tabular-nums ${DELAY_TONE[card.delay.tone]}`}>{card.delay.text}</span>
+ )}
</div>
- <div className="mt-[14px] grid grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)_minmax(0,1fr)] items-start gap-2">
- <Airport code={leg.origin.code} city={leg.origin.name} cell={card.dep} />
- <div className="flex flex-col items-center pt-[2px]">
- <FlightArc
+ <div className="px-[12px] pb-3 pt-[12px]">
+ <div className="relative grid grid-cols-[minmax(0,1fr)_minmax(0,0.6fr)_minmax(0,1fr)] items-stretch gap-2 overflow-hidden rounded-[14px] bg-[color:var(--m-ic)] px-3 py-[11px]">
+ <FlightMiniMap
+ leg={leg}
progress={view.progress}
- showPlane={!quiet}
+ showPlane={view.stage !== 'upcoming' && view.stage !== 'soon'}
dimPlane={view.stale}
- track="var(--m-faint)"
- flown={view.stage === 'landed' ? 'var(--m-muted)' : LIVE}
- plane={view.stage === 'landed' ? 'var(--m-muted)' : 'var(--m-ink)'}
+ credits={card.attribution ? [card.attribution, FLIGHT_MAP_CREDIT] : [FLIGHT_MAP_CREDIT]}
+ inset={0.36}
+ className="!absolute inset-0 [--fm-ahead:var(--m-muted)] [--fm-code:var(--m-muted)] [--fm-end:var(--m-inner)] [--fm-flown:var(--m-st-info)] [--fm-halo:var(--m-inner)] [--fm-plane:var(--m-st-info)]"
+ />
+ <End label={t('reservations.span.departure')} code={leg.origin.code} city={leg.origin.name} cell={card.dep} />
+ <div className="relative z-[1] flex items-end justify-center">
+ <span className="rounded-full bg-[color:var(--m-inner)] px-[7px] py-px font-geist text-caption font-bold tracking-[.06em] text-m-muted shadow-sm">
+ {leg.flight_number}
+ </span>
+ </div>
+ <End
+ label={t('reservations.span.arrival')}
+ code={leg.destination.code}
+ city={leg.destination.name}
+ cell={card.arr}
+ end
/>
- <span className="mt-[2px] font-geist text-caption font-bold tracking-[.06em] text-m-muted">
- {leg.flight_number}
- </span>
- </div>
- <Airport code={leg.destination.code} city={leg.destination.name} cell={card.arr} end />
- </div>
-
- {card.stats.length > 0 && (
- <div className="mt-3 grid grid-cols-2 gap-[6px]">
- {card.stats.map((s) => (
- <StatBox key={s.label} value={s.value} label={s.label} />
- ))}
</div>
- )}
- {card.gateHint && (
- <p className="mt-[10px] flex items-start gap-[6px] text-caption text-m-faint">
- <Info size={12} strokeWidth={2} className="mt-px flex-none" />
- {t('flightLive.noGateHint')}
- </p>
- )}
+ {card.stats.length > 0 && (
+ <div className="mt-[10px] grid grid-cols-2 gap-[6px]">
+ {card.stats.map((s) => (
+ <StatBox key={s.label} value={s.value} label={s.label} />
+ ))}
+ </div>
+ )}
- {card.footnote && (
- <div className="mt-[10px] flex flex-wrap items-center gap-x-2 gap-y-[2px] font-geist text-caption text-m-faint">
- <span className="inline-flex items-center gap-1">
- <Radio size={11} strokeWidth={2} style={view.stale ? { color: 'var(--m-st-pending)' } : undefined} />
- {card.footnote}
- </span>
- {card.attribution && <span className="ms-auto">{card.attribution}</span>}
- </div>
- )}
+ {card.gateHint && (
+ <p className="mt-[10px] flex items-start gap-[6px] text-caption text-m-faint">
+ <Info size={12} strokeWidth={2} className="mt-px flex-none" />
+ {t('flightLive.noGateHint')}
+ </p>
+ )}
+ </div>
</section>
);
}
diff --git a/client/src/native/widgetFlight.ts b/client/src/native/widgetFlight.ts
index c492f625a..cfd112c08 100644
--- a/client/src/native/widgetFlight.ts
+++ b/client/src/native/widgetFlight.ts
@@ -72,6 +72,34 @@ export function pickWidgetLeg(legs: FlightLiveLeg[], nowMs: number): FlightLiveL
);
}
+/** What the feed observed about a leg, for the widget: each part only when it is known. */
+function observed(
+ leg: FlightLiveLeg,
+ depSeconds: number,
+ time: (ms: number, tz: string | null) => string
+): Partial<WidgetFlight> {
+ const landed = toMs(leg.landed_at);
+ const expected = landed ?? (leg.phase === 'airborne' ? toMs(leg.estimated_arrival) : null);
+ const lateBy = leg.departure_delay_min ?? 0;
+ const delay = leg.arrival_delay_min ?? leg.departure_delay_min;
+ const aircraft = [leg.aircraft?.type, leg.aircraft?.registration].filter(Boolean).join(' ');
+ return {
+ ...(leg.departed_at
+ ? { depActual: sec(toMs(leg.departed_at)) }
+ : lateBy > 0
+ ? { depExpected: depSeconds + lateBy * 60 }
+ : {}),
+ ...(leg.phase === 'airborne' ? { airborne: true } : {}),
+ ...(expected != null
+ ? { arrExpected: sec(expected), arrTimeExpected: time(expected, leg.destination.timezone) }
+ : {}),
+ ...(landed != null ? { landed: true } : {}),
+ ...(delay != null ? { delay } : {}),
+ ...(aircraft ? { aircraft } : {}),
+ ...(leg.last_seen_at ? { seen: sec(toMs(leg.last_seen_at)) } : {}),
+ };
+}
+
export function widgetFlight(
legs: FlightLiveLeg[],
nowMs: number,
@@ -83,10 +111,6 @@ export function widgetFlight(
const arr = leg ? toMs(leg.scheduled_arrival) : null;
if (!leg || dep == null || arr == null) return undefined;
const time = (ms: number, tz: string | null) => airportTime(ms, tz, clock.locale, clock.timeFormat);
- const landed = toMs(leg.landed_at);
- const expected = landed ?? (leg.phase === 'airborne' ? toMs(leg.estimated_arrival) : null);
- const aircraft = [leg.aircraft?.type, leg.aircraft?.registration].filter(Boolean).join(' ');
- const delay = leg.arrival_delay_min ?? leg.departure_delay_min;
return {
number: leg.flight_number,
from: leg.origin.code,
@@ -95,20 +119,9 @@ export function widgetFlight(
...(leg.destination.name ? { toCity: leg.destination.name } : {}),
dep: Math.round(dep / 1000),
arr: Math.round(arr / 1000),
- ...(leg.departed_at ? { depActual: sec(toMs(leg.departed_at)) } : {}),
- ...(!leg.departed_at && leg.departure_delay_min != null && leg.departure_delay_min > 0
- ? { depExpected: Math.round(dep / 1000) + leg.departure_delay_min * 60 }
- : {}),
- ...(leg.phase === 'airborne' ? { airborne: true } : {}),
- ...(expected != null
- ? { arrExpected: sec(expected), arrTimeExpected: time(expected, leg.destination.timezone) }
- : {}),
- ...(landed != null ? { landed: true } : {}),
depTime: time(dep, leg.origin.timezone),
arrTime: time(arr, leg.destination.timezone),
- ...(delay != null ? { delay } : {}),
- ...(aircraft ? { aircraft } : {}),
- ...(leg.last_seen_at ? { seen: sec(toMs(leg.last_seen_at)) } : {}),
+ ...observed(leg, Math.round(dep / 1000), time),
path: `${tripPath}?booking=${leg.reservation_id}`,
};
}
diff --git a/client/src/utils/flightLiveModel.ts b/client/src/utils/flightLiveModel.ts
index 381a7827c..4f2669798 100644
--- a/client/src/utils/flightLiveModel.ts
+++ b/client/src/utils/flightLiveModel.ts
@@ -16,7 +16,7 @@ import type { FlightLiveLeg } from '@trek/shared';
* - past: the schedule is over and the feed never confirmed the flight.
* - unknown: the departure time has passed and the callsign never showed up.
*/
-type FlightStage = 'upcoming' | 'soon' | 'taxiing' | 'airborne' | 'landed' | 'past' | 'unknown';
+export type FlightStage = 'upcoming' | 'soon' | 'taxiing' | 'airborne' | 'landed' | 'past' | 'unknown';
/** ok: on time or early; minor: up to half an hour; major: more. */
export type DelayTone = 'ok' | 'minor' | 'major';
diff --git a/client/src/utils/flightRoute.test.ts b/client/src/utils/flightRoute.test.ts
new file mode 100644
index 000000000..126848311
--- /dev/null
+++ b/client/src/utils/flightRoute.test.ts
@@ -0,0 +1,43 @@
+// FE-UTIL-FLIGHTROUTE-001 to FE-UTIL-FLIGHTROUTE-004
+import { describe, expect, it } from 'vitest';
+import { bearing, greatCircle, splitRoute } from './flightRoute';
+
+const FRA = { lat: 50.03, lng: 8.57 };
+const YYZ = { lat: 43.68, lng: -79.63 };
+const NRT = { lat: 35.77, lng: 140.39 };
+const SFO = { lat: 37.62, lng: -122.38 };
+
+describe('flightRoute', () => {
+ it('FE-UTIL-FLIGHTROUTE-001: runs from end to end and bows towards the pole', () => {
+ const route = greatCircle(FRA, YYZ, 32);
+ expect(route).toHaveLength(33);
+ expect(route[0].lat).toBeCloseTo(FRA.lat, 6);
+ expect(route[32].lng).toBeCloseTo(YYZ.lng, 6);
+ // Frankfurt to Toronto passes well north of both, over the North Atlantic towards Greenland.
+ expect(Math.max(...route.map((p) => p.lat))).toBeGreaterThan(55);
+ });
+
+ it('FE-UTIL-FLIGHTROUTE-002: stays one line across the date line', () => {
+ const route = greatCircle(NRT, SFO, 32);
+ for (let i = 1; i < route.length; i++) expect(Math.abs(route[i].lng - route[i - 1].lng)).toBeLessThan(20);
+ // Continued past 180 rather than jumping to -180.
+ expect(route[32].lng).toBeCloseTo(SFO.lng + 360, 6);
+ });
+
+ it('FE-UTIL-FLIGHTROUTE-003: gives the heading at the start', () => {
+ expect(bearing({ lat: 0, lng: 0 }, { lat: 10, lng: 0 })).toBeCloseTo(0, 6);
+ expect(bearing({ lat: 0, lng: 0 }, { lat: 0, lng: 10 })).toBeCloseTo(90, 6);
+ // Westbound across the Atlantic leaves Frankfurt heading north west.
+ expect(bearing(FRA, YYZ)).toBeGreaterThan(270);
+ });
+
+ it('FE-UTIL-FLIGHTROUTE-004: cuts the route where the aircraft is, clamped to its ends', () => {
+ const route = greatCircle(FRA, YYZ, 10);
+ const half = splitRoute(route, 0.5);
+ expect(half.flown.at(-1)).toEqual(half.at);
+ expect(half.ahead[0]).toEqual(half.at);
+ expect(half.flown.length + half.ahead.length).toBe(route.length + 2);
+ expect(splitRoute(route, -1).at).toEqual(route[0]);
+ expect(splitRoute(route, 2).at.lng).toBeCloseTo(route[10].lng, 6);
+ });
+});
diff --git a/client/src/utils/flightRoute.ts b/client/src/utils/flightRoute.ts
new file mode 100644
index 000000000..364525b35
--- /dev/null
+++ b/client/src/utils/flightRoute.ts
@@ -0,0 +1,69 @@
+/** A point on the globe, degrees. */
+export interface LatLng {
+ lat: number;
+ lng: number;
+}
+
+const RAD = Math.PI / 180;
+
+function toVector({ lat, lng }: LatLng): [number, number, number] {
+ const φ = lat * RAD;
+ const λ = lng * RAD;
+ return [Math.cos(φ) * Math.cos(λ), Math.cos(φ) * Math.sin(λ), Math.sin(φ)];
+}
+
+/**
+ * The great circle from `a` to `b` in `steps` equal pieces: the line an
+ * airliner roughly flies, which on a flat map bows towards the pole. The
+ * longitudes run on without a jump, so a route across the date line stays one
+ * line (Leaflet draws 190° as just past 180°) instead of wrapping round the map.
+ */
+export function greatCircle(a: LatLng, b: LatLng, steps = 64): LatLng[] {
+ const va = toVector(a);
+ const vb = toVector(b);
+ const dot = Math.min(1, Math.max(-1, va[0] * vb[0] + va[1] * vb[1] + va[2] * vb[2]));
+ const ω = Math.acos(dot);
+ if (ω < 1e-9) return [a, b];
+ const points: LatLng[] = [];
+ let lastLng = a.lng;
+ for (let i = 0; i <= steps; i++) {
+ const t = i / steps;
+ const ka = Math.sin((1 - t) * ω) / Math.sin(ω);
+ const kb = Math.sin(t * ω) / Math.sin(ω);
+ const x = ka * va[0] + kb * vb[0];
+ const y = ka * va[1] + kb * vb[1];
+ const z = ka * va[2] + kb * vb[2];
+ const lat = Math.atan2(z, Math.hypot(x, y)) / RAD;
+ let lng = Math.atan2(y, x) / RAD;
+ while (lng - lastLng > 180) lng -= 360;
+ while (lng - lastLng < -180) lng += 360;
+ lastLng = lng;
+ points.push({ lat, lng });
+ }
+ return points;
+}
+
+/** Initial bearing from `a` towards `b`, degrees clockwise from north. */
+export function bearing(a: LatLng, b: LatLng): number {
+ const φ1 = a.lat * RAD;
+ const φ2 = b.lat * RAD;
+ const Δλ = (b.lng - a.lng) * RAD;
+ const y = Math.sin(Δλ) * Math.cos(φ2);
+ const x = Math.cos(φ1) * Math.sin(φ2) - Math.sin(φ1) * Math.cos(φ2) * Math.cos(Δλ);
+ return (Math.atan2(y, x) / RAD + 360) % 360;
+}
+
+/** The route cut at `progress` (0 to 1): what is flown, what is left, and the point and heading in between. */
+export function splitRoute(
+ route: LatLng[],
+ progress: number
+): { flown: LatLng[]; ahead: LatLng[]; at: LatLng; heading: number } {
+ const last = route.length - 1;
+ const exact = Math.min(1, Math.max(0, progress)) * last;
+ const i = Math.min(last - 1, Math.floor(exact));
+ const f = exact - i;
+ const p = route[i];
+ const q = route[i + 1];
+ const at = { lat: p.lat + (q.lat - p.lat) * f, lng: p.lng + (q.lng - p.lng) * f };
+ return { flown: [...route.slice(0, i + 1), at], ahead: [at, ...route.slice(i + 1)], at, heading: bearing(p, q) };
+}
diff --git a/client/tests/helpers/storeRegistry.ts b/client/tests/helpers/storeRegistry.ts
index af00be6dc..24e7f4211 100644
--- a/client/tests/helpers/storeRegistry.ts
+++ b/client/tests/helpers/storeRegistry.ts
@@ -4,6 +4,7 @@ import { useSharedImportStore } from '../../src/native/sharedFiles';
import { useAddonStore } from '../../src/store/addonStore';
import { useAssistantHintsStore } from '../../src/store/assistantHintsStore';
import { useAuthStore } from '../../src/store/authStore';
+import { useFlightLiveStore } from '../../src/store/flightLiveStore';
import { useInAppNotificationStore } from '../../src/store/inAppNotificationStore';
import { usePaddleObstacleStore } from '../../src/store/paddleObstacleStore';
import { usePermissionsStore } from '../../src/store/permissionsStore';
@@ -48,6 +49,8 @@ export const RESET_STORES: Record<string, ResettableStore> = {
usePaddleObstacleStore,
useTrackMarkToolStore,
useAssistantHintsStore,
+ // Live flight states are per test: a leg seeded by one test must not show up in the next.
+ useFlightLiveStore,
};
/** Not reset so far; moving one into RESET_STORES changes what every file that resets starts from. */
diff --git a/shared/scripts/i18n-parity.mjs b/shared/scripts/i18n-parity.mjs
index 443fad842..37591d9a0 100644
--- a/shared/scripts/i18n-parity.mjs
+++ b/shared/scripts/i18n-parity.mjs
@@ -95,8 +95,18 @@ export const NOT_PLURAL = [
{ key: 'help.center.step', because: 'the position of a step in a guide' },
{ key: 'help.center.stepOf', because: 'the position of a step in a guide' },
{ key: 'help.center.imageAlt', because: 'the position of a step in a guide' },
+ { key: 'flightLive.feet', because: 'a measured altitude with a unit symbol ("37,000 ft"), which does not inflect' },
+ { key: 'flightLive.meters', because: 'a measured altitude with a unit symbol ("11,278 m"), which does not inflect' },
+ { key: 'flightLive.mph', because: 'a measured speed with a unit symbol ("540 mph"), which does not inflect' },
+ { key: 'flightLive.kmh', because: 'a measured speed with a unit symbol ("870 km/h"), which does not inflect' },
+ { key: 'flightLive.mi', because: 'a measured distance with a unit symbol ("2,400 mi"), which does not inflect' },
+ { key: 'flightLive.km', because: 'a measured distance with a unit symbol ("3,900 km"), which does not inflect' },
+ { key: 'flightLive.legOf', because: 'the position of a flight in a booking with stopovers ("Flight 2 of 3")' },
{ key: 'native.widget.dayOf', because: 'the position of a day in the trip ("Day 2 of 5")' },
- { key: 'native.widget.inDays', because: 'filled in by the native widget, which says "Tomorrow" for one day, so the number is always two or more' },
+ {
+ key: 'native.widget.inDays',
+ because: 'filled in by the native widget, which says "Tomorrow" for one day, so the number is always two or more',
+ },
{ key: 'system_notice.pager.goto', because: 'the position of a notice in the pager' },
{ key: 'tours.addedToDay', because: 'the number of the day a tour was added to' },
{ key: 'tours.planner.waypointLabel', because: 'the position of a waypoint on the tour' },
diff --git a/shared/src/i18n/ar/flightLive.ts b/shared/src/i18n/ar/flightLive.ts
index 7fd1886da..b056dc017 100644
--- a/shared/src/i18n/ar/flightLive.ts
+++ b/shared/src/i18n/ar/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'في الموعد',
'flightLive.departsIn': 'الإقلاع بعد {time}',
'flightLive.scheduled': 'مجدولة',
- 'flightLive.watching': 'TREK يترقب الطائرة',
'flightLive.taxiing': 'جاهزة للإقلاع',
'flightLive.atAirport': 'على الأرض في {code}',
'flightLive.airborne': 'في الجو',
'flightLive.landsIn': 'الهبوط بعد {time}',
'flightLive.landed': 'هبطت',
'flightLive.landedAt': 'هبطت الساعة {time} في {code}',
- 'flightLive.over': 'انتهت الرحلة',
- 'flightLive.noSignal': 'لا توجد بيانات مباشرة',
- 'flightLive.noSignalHint': 'شبكة بيانات الطيران المفتوحة لا تعرف هذه الرحلة برقمها.',
'flightLive.estimated': 'متوقع',
- 'flightLive.actual': 'فعلي',
'flightLive.altitude': 'الارتفاع',
'flightLive.feet': '{n} قدم',
'flightLive.meters': '{n} م',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} ميل',
'flightLive.km': '{n} كم',
'flightLive.aircraft': 'الطائرة',
- 'flightLive.lastSignal': 'آخر إشارة قبل {time}',
- 'flightLive.updated': 'تم التحديث قبل {time}',
'flightLive.noGateHint':
'البوابة والمبنى وحزام الأمتعة ليست ضمن بيانات الطيران المفتوحة. أضفها بنفسك إلى الحجز إذا احتجت إليها.',
'flightLive.legOf': 'الرحلة {n} من {total}',
diff --git a/shared/src/i18n/az/flightLive.ts b/shared/src/i18n/az/flightLive.ts
index d4bd31f85..6cf570a6d 100644
--- a/shared/src/i18n/az/flightLive.ts
+++ b/shared/src/i18n/az/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Vaxtında',
'flightLive.departsIn': '{time} sonra uçuş',
'flightLive.scheduled': 'Planlaşdırılıb',
- 'flightLive.watching': 'TREK təyyarəni gözləyir',
'flightLive.taxiing': 'Uçuşa hazırdır',
'flightLive.atAirport': '{code} yerdədir',
'flightLive.airborne': 'Havada',
'flightLive.landsIn': '{time} sonra eniş',
'flightLive.landed': 'Endi',
'flightLive.landedAt': '{time} {code} endi',
- 'flightLive.over': 'Uçuş bitdi',
- 'flightLive.noSignal': 'Canlı məlumat yoxdur',
- 'flightLive.noSignalHint': 'Açıq uçuş məlumat şəbəkəsi bu uçuşu nömrəsinə görə tanımır.',
'flightLive.estimated': 'gözlənilən',
- 'flightLive.actual': 'faktiki',
'flightLive.altitude': 'Hündürlük',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Təyyarə',
- 'flightLive.lastSignal': 'Son siqnal {time} əvvəl',
- 'flightLive.updated': '{time} əvvəl yeniləndi',
'flightLive.noGateHint':
'Qapı, terminal və baqaj lenti açıq uçuş məlumatlarına daxil deyil. Lazım olsa, onları bronlamaya özün əlavə et.',
'flightLive.legOf': 'Uçuş {n} / {total}',
diff --git a/shared/src/i18n/br/flightLive.ts b/shared/src/i18n/br/flightLive.ts
index d246755f2..12c5aaf64 100644
--- a/shared/src/i18n/br/flightLive.ts
+++ b/shared/src/i18n/br/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'No horário',
'flightLive.departsIn': 'Parte em {time}',
'flightLive.scheduled': 'Programado',
- 'flightLive.watching': 'O TREK está de olho no avião',
'flightLive.taxiing': 'Pronto para partir',
'flightLive.atAirport': 'Em solo em {code}',
'flightLive.airborne': 'No ar',
'flightLive.landsIn': 'Pousa em {time}',
'flightLive.landed': 'Pousou',
'flightLive.landedAt': 'Pousou às {time} em {code}',
- 'flightLive.over': 'Voo encerrado',
- 'flightLive.noSignal': 'Sem dados ao vivo',
- 'flightLive.noSignalHint': 'A rede aberta de dados de voo não conhece este voo pelo número.',
'flightLive.estimated': 'estimado',
- 'flightLive.actual': 'real',
'flightLive.altitude': 'Altitude', // same-as-en
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Aeronave',
- 'flightLive.lastSignal': 'Último sinal há {time}',
- 'flightLive.updated': 'Atualizado há {time}',
'flightLive.noGateHint':
'Portão, terminal e esteira de bagagem não fazem parte dos dados de voo abertos. Adicione-os você mesmo à reserva se precisar.',
'flightLive.legOf': 'Voo {n} de {total}',
diff --git a/shared/src/i18n/ca/flightLive.ts b/shared/src/i18n/ca/flightLive.ts
index a54702557..170e89404 100644
--- a/shared/src/i18n/ca/flightLive.ts
+++ b/shared/src/i18n/ca/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Puntual',
'flightLive.departsIn': 'Surt d’aquí a {time}',
'flightLive.scheduled': 'Programat',
- 'flightLive.watching': 'TREK està atent a l’avió',
'flightLive.taxiing': 'A punt per sortir',
'flightLive.atAirport': 'A terra a {code}',
'flightLive.airborne': 'En vol',
'flightLive.landsIn': 'Aterra d’aquí a {time}',
'flightLive.landed': 'Aterrat',
'flightLive.landedAt': 'Ha aterrat a les {time} a {code}',
- 'flightLive.over': 'Vol acabat',
- 'flightLive.noSignal': 'Sense dades en directe',
- 'flightLive.noSignalHint': 'La xarxa oberta de dades de vol no coneix aquest vol pel seu número.',
'flightLive.estimated': 'estimada',
- 'flightLive.actual': 'real',
'flightLive.altitude': 'Altitud',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Avió',
- 'flightLive.lastSignal': 'Darrer senyal fa {time}',
- 'flightLive.updated': 'Actualitzat fa {time}',
'flightLive.noGateHint':
'La porta, la terminal i la cinta d’equipatge no formen part de les dades de vol obertes. Afegeix-les tu a la reserva si les necessites.',
'flightLive.legOf': 'Vol {n} de {total}',
diff --git a/shared/src/i18n/cs/flightLive.ts b/shared/src/i18n/cs/flightLive.ts
index b1291878c..924502aa2 100644
--- a/shared/src/i18n/cs/flightLive.ts
+++ b/shared/src/i18n/cs/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Včas',
'flightLive.departsIn': 'Odlet za {time}',
'flightLive.scheduled': 'Plánováno',
- 'flightLive.watching': 'TREK vyhlíží letadlo',
'flightLive.taxiing': 'Připraveno k odletu',
'flightLive.atAirport': 'Na zemi v {code}',
'flightLive.airborne': 'Ve vzduchu',
'flightLive.landsIn': 'Přistane za {time}',
'flightLive.landed': 'Přistálo',
'flightLive.landedAt': 'Přistálo v {time} v {code}',
- 'flightLive.over': 'Let skončil',
- 'flightLive.noSignal': 'Žádná živá data',
- 'flightLive.noSignalHint': 'Otevřená síť letových dat tento let pod jeho číslem nezná.',
'flightLive.estimated': 'odhad',
- 'flightLive.actual': 'skutečnost',
'flightLive.altitude': 'Výška',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Letadlo',
- 'flightLive.lastSignal': 'Poslední signál před {time}',
- 'flightLive.updated': 'Aktualizováno před {time}',
'flightLive.noGateHint':
'Gate, terminál a pás zavazadel nejsou součástí otevřených letových dat. Pokud je potřebuješ, doplň je do rezervace sám.',
'flightLive.legOf': 'Let {n} z {total}',
diff --git a/shared/src/i18n/de/flightLive.ts b/shared/src/i18n/de/flightLive.ts
index 50a1915a0..d3cb91d05 100644
--- a/shared/src/i18n/de/flightLive.ts
+++ b/shared/src/i18n/de/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Pünktlich',
'flightLive.departsIn': 'Abflug in {time}',
'flightLive.scheduled': 'Geplant',
- 'flightLive.watching': 'TREK hält Ausschau nach der Maschine',
'flightLive.taxiing': 'Bereit zum Abflug',
'flightLive.atAirport': 'Am Boden in {code}',
'flightLive.airborne': 'In der Luft',
'flightLive.landsIn': 'Landung in {time}',
'flightLive.landed': 'Gelandet',
'flightLive.landedAt': 'Gelandet um {time} in {code}',
- 'flightLive.over': 'Flug vorbei',
- 'flightLive.noSignal': 'Keine Live-Daten',
- 'flightLive.noSignalHint': 'Im offenen Flugdatennetz ist dieser Flug unter seiner Nummer nicht zu finden.',
'flightLive.estimated': 'erwartet',
- 'flightLive.actual': 'tatsächlich',
'flightLive.altitude': 'Höhe',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Flugzeug',
- 'flightLive.lastSignal': 'Letztes Signal vor {time}',
- 'flightLive.updated': 'Aktualisiert vor {time}',
'flightLive.noGateHint':
'Gate, Terminal und Gepäckband gehören nicht zu den offenen Flugdaten. Trag sie bei Bedarf selbst in die Buchung ein.',
'flightLive.legOf': 'Flug {n} von {total}',
diff --git a/shared/src/i18n/en/flightLive.ts b/shared/src/i18n/en/flightLive.ts
index f31ee89f9..ec77d1472 100644
--- a/shared/src/i18n/en/flightLive.ts
+++ b/shared/src/i18n/en/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'On time',
'flightLive.departsIn': 'Departs in {time}',
'flightLive.scheduled': 'Scheduled',
- 'flightLive.watching': 'TREK is watching for the aircraft',
'flightLive.taxiing': 'Ready for departure',
'flightLive.atAirport': 'On the ground at {code}',
'flightLive.airborne': 'In the air',
'flightLive.landsIn': 'Lands in {time}',
'flightLive.landed': 'Landed',
'flightLive.landedAt': 'Landed at {time} in {code}',
- 'flightLive.over': 'Flight over',
- 'flightLive.noSignal': 'No live data',
- 'flightLive.noSignalHint': 'The open flight data network does not know this flight under its number.',
'flightLive.estimated': 'estimated',
- 'flightLive.actual': 'actual',
'flightLive.altitude': 'Altitude',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Aircraft',
- 'flightLive.lastSignal': 'Last signal {time} ago',
- 'flightLive.updated': 'Updated {time} ago',
'flightLive.noGateHint':
'Gate, terminal and baggage belt are not part of open flight data. Add them to the booking yourself if you need them.',
'flightLive.legOf': 'Flight {n} of {total}',
diff --git a/shared/src/i18n/es/flightLive.ts b/shared/src/i18n/es/flightLive.ts
index c81284c79..a7e086567 100644
--- a/shared/src/i18n/es/flightLive.ts
+++ b/shared/src/i18n/es/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Puntual',
'flightLive.departsIn': 'Sale en {time}',
'flightLive.scheduled': 'Programado',
- 'flightLive.watching': 'TREK está atento al avión',
'flightLive.taxiing': 'Listo para salir',
'flightLive.atAirport': 'En tierra en {code}',
'flightLive.airborne': 'En el aire',
'flightLive.landsIn': 'Aterriza en {time}',
'flightLive.landed': 'Aterrizado',
'flightLive.landedAt': 'Aterrizó a las {time} en {code}',
- 'flightLive.over': 'Vuelo terminado',
- 'flightLive.noSignal': 'Sin datos en directo',
- 'flightLive.noSignalHint': 'La red abierta de datos de vuelo no conoce este vuelo por su número.',
'flightLive.estimated': 'estimada',
- 'flightLive.actual': 'real',
'flightLive.altitude': 'Altitud',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Avión',
- 'flightLive.lastSignal': 'Última señal hace {time}',
- 'flightLive.updated': 'Actualizado hace {time}',
'flightLive.noGateHint':
'La puerta, la terminal y la cinta de equipaje no forman parte de los datos de vuelo abiertos. Añádelos tú a la reserva si los necesitas.',
'flightLive.legOf': 'Vuelo {n} de {total}',
diff --git a/shared/src/i18n/et/flightLive.ts b/shared/src/i18n/et/flightLive.ts
index 7e9299417..08d469bd0 100644
--- a/shared/src/i18n/et/flightLive.ts
+++ b/shared/src/i18n/et/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Õigel ajal',
'flightLive.departsIn': 'Väljub {time} pärast',
'flightLive.scheduled': 'Plaanitud',
- 'flightLive.watching': 'TREK ootab lennukit',
'flightLive.taxiing': 'Valmis väljumiseks',
'flightLive.atAirport': 'Maapinnal: {code}',
'flightLive.airborne': 'Õhus',
'flightLive.landsIn': 'Maandub {time} pärast',
'flightLive.landed': 'Maandunud',
'flightLive.landedAt': 'Maandus kell {time}: {code}',
- 'flightLive.over': 'Lend on läbi',
- 'flightLive.noSignal': 'Otseandmed puuduvad',
- 'flightLive.noSignalHint': 'Avatud lennuandmete võrk ei tunne seda lendu selle numbri järgi.',
'flightLive.estimated': 'eeldatav',
- 'flightLive.actual': 'tegelik',
'flightLive.altitude': 'Kõrgus',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Lennuk',
- 'flightLive.lastSignal': 'Viimane signaal {time} tagasi',
- 'flightLive.updated': 'Uuendatud {time} tagasi',
'flightLive.noGateHint':
'Värav, terminal ja pagasilint ei kuulu avatud lennuandmete hulka. Lisa need vajadusel ise broneeringule.',
'flightLive.legOf': 'Lend {n}/{total}',
diff --git a/shared/src/i18n/fr/flightLive.ts b/shared/src/i18n/fr/flightLive.ts
index b7d59602a..c815cf3be 100644
--- a/shared/src/i18n/fr/flightLive.ts
+++ b/shared/src/i18n/fr/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'À l’heure',
'flightLive.departsIn': 'Départ dans {time}',
'flightLive.scheduled': 'Prévu',
- 'flightLive.watching': 'TREK guette l’avion',
'flightLive.taxiing': 'Prêt au départ',
'flightLive.atAirport': 'Au sol à {code}',
'flightLive.airborne': 'En vol',
'flightLive.landsIn': 'Atterrit dans {time}',
'flightLive.landed': 'Atterri',
'flightLive.landedAt': 'Atterri à {time} à {code}',
- 'flightLive.over': 'Vol terminé',
- 'flightLive.noSignal': 'Pas de données en direct',
- 'flightLive.noSignalHint': 'Le réseau ouvert de données de vol ne connaît pas ce vol sous son numéro.',
'flightLive.estimated': 'estimé',
- 'flightLive.actual': 'réel',
'flightLive.altitude': 'Altitude', // same-as-en
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Avion',
- 'flightLive.lastSignal': 'Dernier signal il y a {time}',
- 'flightLive.updated': 'Mis à jour il y a {time}',
'flightLive.noGateHint':
'La porte, le terminal et le tapis à bagages ne font pas partie des données de vol ouvertes. Ajoutez-les vous-même à la réservation si besoin.',
'flightLive.legOf': 'Vol {n} sur {total}',
diff --git a/shared/src/i18n/gr/flightLive.ts b/shared/src/i18n/gr/flightLive.ts
index 4dc34e260..91af0ea1f 100644
--- a/shared/src/i18n/gr/flightLive.ts
+++ b/shared/src/i18n/gr/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Στην ώρα της',
'flightLive.departsIn': 'Αναχώρηση σε {time}',
'flightLive.scheduled': 'Προγραμματισμένη',
- 'flightLive.watching': 'Το TREK περιμένει το αεροσκάφος',
'flightLive.taxiing': 'Έτοιμη για αναχώρηση',
'flightLive.atAirport': 'Στο έδαφος στο {code}',
'flightLive.airborne': 'Στον αέρα',
'flightLive.landsIn': 'Προσγείωση σε {time}',
'flightLive.landed': 'Προσγειώθηκε',
'flightLive.landedAt': 'Προσγειώθηκε στις {time} στο {code}',
- 'flightLive.over': 'Η πτήση ολοκληρώθηκε',
- 'flightLive.noSignal': 'Δεν υπάρχουν ζωντανά δεδομένα',
- 'flightLive.noSignalHint': 'Το ανοιχτό δίκτυο δεδομένων πτήσεων δεν γνωρίζει αυτή την πτήση με τον αριθμό της.',
'flightLive.estimated': 'εκτιμώμενη',
- 'flightLive.actual': 'πραγματική',
'flightLive.altitude': 'Ύψος',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Αεροσκάφος',
- 'flightLive.lastSignal': 'Τελευταίο σήμα πριν από {time}',
- 'flightLive.updated': 'Ενημερώθηκε πριν από {time}',
'flightLive.noGateHint':
'Η πύλη, ο τερματικός σταθμός και ο ιμάντας αποσκευών δεν ανήκουν στα ανοιχτά δεδομένα πτήσεων. Πρόσθεσέ τα μόνος σου στην κράτηση αν τα χρειάζεσαι.',
'flightLive.legOf': 'Πτήση {n} από {total}',
diff --git a/shared/src/i18n/he/flightLive.ts b/shared/src/i18n/he/flightLive.ts
index c7bcdec22..6ae90251f 100644
--- a/shared/src/i18n/he/flightLive.ts
+++ b/shared/src/i18n/he/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'בזמן',
'flightLive.departsIn': 'המראה בעוד {time}',
'flightLive.scheduled': 'מתוכננת',
- 'flightLive.watching': 'TREK מחכה למטוס',
'flightLive.taxiing': 'מוכנה להמראה',
'flightLive.atAirport': 'על הקרקע ב־{code}',
'flightLive.airborne': 'באוויר',
'flightLive.landsIn': 'נחיתה בעוד {time}',
'flightLive.landed': 'נחתה',
'flightLive.landedAt': 'נחתה ב־{time} ב־{code}',
- 'flightLive.over': 'הטיסה הסתיימה',
- 'flightLive.noSignal': 'אין נתונים חיים',
- 'flightLive.noSignalHint': 'רשת נתוני הטיסות הפתוחה לא מכירה את הטיסה הזו לפי המספר שלה.',
'flightLive.estimated': 'משוער',
- 'flightLive.actual': 'בפועל',
'flightLive.altitude': 'גובה',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} מ׳',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} ק״מ',
'flightLive.aircraft': 'מטוס',
- 'flightLive.lastSignal': 'אות אחרון לפני {time}',
- 'flightLive.updated': 'עודכן לפני {time}',
'flightLive.noGateHint':
'שער, טרמינל ומסוע מזוודות אינם חלק מנתוני הטיסות הפתוחים. הוסיפו אותם בעצמכם להזמנה אם צריך.',
'flightLive.legOf': 'טיסה {n} מתוך {total}',
diff --git a/shared/src/i18n/hu/flightLive.ts b/shared/src/i18n/hu/flightLive.ts
index 66c4a5831..da61b1305 100644
--- a/shared/src/i18n/hu/flightLive.ts
+++ b/shared/src/i18n/hu/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Pontos',
'flightLive.departsIn': 'Indulás {time} múlva',
'flightLive.scheduled': 'Tervezett',
- 'flightLive.watching': 'A TREK figyeli a gépet',
'flightLive.taxiing': 'Indulásra kész',
'flightLive.atAirport': 'A földön itt: {code}',
'flightLive.airborne': 'A levegőben',
'flightLive.landsIn': 'Leszállás {time} múlva',
'flightLive.landed': 'Leszállt',
'flightLive.landedAt': '{time}-kor leszállt itt: {code}',
- 'flightLive.over': 'A járat véget ért',
- 'flightLive.noSignal': 'Nincs élő adat',
- 'flightLive.noSignalHint': 'A nyílt repülési adathálózat nem ismeri ezt a járatot a számáról.',
'flightLive.estimated': 'várható',
- 'flightLive.actual': 'tényleges',
'flightLive.altitude': 'Magasság',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Repülőgép',
- 'flightLive.lastSignal': 'Utolsó jel {time} ezelőtt',
- 'flightLive.updated': 'Frissítve {time} ezelőtt',
'flightLive.noGateHint':
'A kapu, a terminál és a poggyászszalag nem része a nyílt repülési adatoknak. Szükség esetén add hozzá magad a foglaláshoz.',
'flightLive.legOf': '{n}. járat / {total}',
diff --git a/shared/src/i18n/id/flightLive.ts b/shared/src/i18n/id/flightLive.ts
index e8d953e91..9cedbdca9 100644
--- a/shared/src/i18n/id/flightLive.ts
+++ b/shared/src/i18n/id/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Tepat waktu',
'flightLive.departsIn': 'Berangkat dalam {time}',
'flightLive.scheduled': 'Terjadwal',
- 'flightLive.watching': 'TREK sedang menunggu pesawatnya',
'flightLive.taxiing': 'Siap berangkat',
'flightLive.atAirport': 'Di darat di {code}',
'flightLive.airborne': 'Di udara',
'flightLive.landsIn': 'Mendarat dalam {time}',
'flightLive.landed': 'Mendarat',
'flightLive.landedAt': 'Mendarat pukul {time} di {code}',
- 'flightLive.over': 'Penerbangan selesai',
- 'flightLive.noSignal': 'Tidak ada data langsung',
- 'flightLive.noSignalHint': 'Jaringan data penerbangan terbuka tidak mengenal penerbangan ini dengan nomornya.',
'flightLive.estimated': 'perkiraan',
- 'flightLive.actual': 'aktual',
'flightLive.altitude': 'Ketinggian',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Pesawat',
- 'flightLive.lastSignal': 'Sinyal terakhir {time} lalu',
- 'flightLive.updated': 'Diperbarui {time} lalu',
'flightLive.noGateHint':
'Gerbang, terminal, dan sabuk bagasi tidak termasuk data penerbangan terbuka. Tambahkan sendiri ke pemesanan jika perlu.',
'flightLive.legOf': 'Penerbangan {n} dari {total}',
diff --git a/shared/src/i18n/it/flightLive.ts b/shared/src/i18n/it/flightLive.ts
index 78b75f7d8..f78f352ca 100644
--- a/shared/src/i18n/it/flightLive.ts
+++ b/shared/src/i18n/it/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'In orario',
'flightLive.departsIn': 'Parte tra {time}',
'flightLive.scheduled': 'Programmato',
- 'flightLive.watching': 'TREK è in attesa dell’aereo',
'flightLive.taxiing': 'Pronto alla partenza',
'flightLive.atAirport': 'A terra a {code}',
'flightLive.airborne': 'In volo',
'flightLive.landsIn': 'Atterra tra {time}',
'flightLive.landed': 'Atterrato',
'flightLive.landedAt': 'Atterrato alle {time} a {code}',
- 'flightLive.over': 'Volo concluso',
- 'flightLive.noSignal': 'Nessun dato in tempo reale',
- 'flightLive.noSignalHint': 'La rete aperta dei dati di volo non conosce questo volo con il suo numero.',
'flightLive.estimated': 'stimato',
- 'flightLive.actual': 'effettivo',
'flightLive.altitude': 'Quota',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Aereo',
- 'flightLive.lastSignal': 'Ultimo segnale {time} fa',
- 'flightLive.updated': 'Aggiornato {time} fa',
'flightLive.noGateHint':
'Gate, terminal e nastro bagagli non fanno parte dei dati di volo aperti. Aggiungili tu alla prenotazione se ti servono.',
'flightLive.legOf': 'Volo {n} di {total}',
diff --git a/shared/src/i18n/ja/flightLive.ts b/shared/src/i18n/ja/flightLive.ts
index 1b748d698..f25c8108d 100644
--- a/shared/src/i18n/ja/flightLive.ts
+++ b/shared/src/i18n/ja/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': '定刻',
'flightLive.departsIn': '出発まで{time}',
'flightLive.scheduled': '予定',
- 'flightLive.watching': 'TREK が機体を待っています',
'flightLive.taxiing': '出発準備完了',
'flightLive.atAirport': '{code} の地上',
'flightLive.airborne': '飛行中',
'flightLive.landsIn': '着陸まで{time}',
'flightLive.landed': '着陸済み',
'flightLive.landedAt': '{time} に {code} へ着陸',
- 'flightLive.over': 'フライト終了',
- 'flightLive.noSignal': 'ライブデータなし',
- 'flightLive.noSignalHint': 'オープンなフライトデータ網はこの便を便名で把握していません。',
'flightLive.estimated': '予定',
- 'flightLive.actual': '実績',
'flightLive.altitude': '高度',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': '機体',
- 'flightLive.lastSignal': '最終信号 {time}前',
- 'flightLive.updated': '{time}前に更新',
'flightLive.noGateHint':
'ゲート、ターミナル、手荷物受取所はオープンなフライトデータに含まれません。必要なら予約に自分で追加してください。',
'flightLive.legOf': 'フライト {n}/{total}',
diff --git a/shared/src/i18n/ko/flightLive.ts b/shared/src/i18n/ko/flightLive.ts
index 6202e2028..a017b4c55 100644
--- a/shared/src/i18n/ko/flightLive.ts
+++ b/shared/src/i18n/ko/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': '정시',
'flightLive.departsIn': '{time} 후 출발',
'flightLive.scheduled': '예정',
- 'flightLive.watching': 'TREK이 항공기를 기다리는 중',
'flightLive.taxiing': '출발 준비 완료',
'flightLive.atAirport': '{code} 지상',
'flightLive.airborne': '비행 중',
'flightLive.landsIn': '{time} 후 착륙',
'flightLive.landed': '착륙함',
'flightLive.landedAt': '{time}에 {code} 착륙',
- 'flightLive.over': '비행 종료',
- 'flightLive.noSignal': '실시간 데이터 없음',
- 'flightLive.noSignalHint': '공개 비행 데이터 네트워크가 이 항공편을 편명으로 알지 못합니다.',
'flightLive.estimated': '예상',
- 'flightLive.actual': '실제',
'flightLive.altitude': '고도',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': '항공기',
- 'flightLive.lastSignal': '마지막 신호 {time} 전',
- 'flightLive.updated': '{time} 전 업데이트',
'flightLive.noGateHint':
'게이트, 터미널, 수하물 벨트는 공개 비행 데이터에 없습니다. 필요하면 예약에 직접 추가하세요.',
'flightLive.legOf': '항공편 {n}/{total}',
diff --git a/shared/src/i18n/nl/flightLive.ts b/shared/src/i18n/nl/flightLive.ts
index 6da4c7fdb..82a4d3056 100644
--- a/shared/src/i18n/nl/flightLive.ts
+++ b/shared/src/i18n/nl/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Op tijd',
'flightLive.departsIn': 'Vertrekt over {time}',
'flightLive.scheduled': 'Gepland',
- 'flightLive.watching': 'TREK let op het toestel',
'flightLive.taxiing': 'Klaar voor vertrek',
'flightLive.atAirport': 'Aan de grond in {code}',
'flightLive.airborne': 'In de lucht',
'flightLive.landsIn': 'Landt over {time}',
'flightLive.landed': 'Geland',
'flightLive.landedAt': 'Om {time} geland in {code}',
- 'flightLive.over': 'Vlucht voorbij',
- 'flightLive.noSignal': 'Geen livegegevens',
- 'flightLive.noSignalHint': 'Het open vluchtdatanetwerk kent deze vlucht niet onder zijn nummer.',
'flightLive.estimated': 'verwacht',
- 'flightLive.actual': 'werkelijk',
'flightLive.altitude': 'Hoogte',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Toestel',
- 'flightLive.lastSignal': 'Laatste signaal {time} geleden',
- 'flightLive.updated': '{time} geleden bijgewerkt',
'flightLive.noGateHint':
'Gate, terminal en bagageband horen niet bij open vluchtgegevens. Voeg ze zelf aan de boeking toe als je ze nodig hebt.',
'flightLive.legOf': 'Vlucht {n} van {total}',
diff --git a/shared/src/i18n/pl/flightLive.ts b/shared/src/i18n/pl/flightLive.ts
index 41ff1e36e..916f94138 100644
--- a/shared/src/i18n/pl/flightLive.ts
+++ b/shared/src/i18n/pl/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Punktualnie',
'flightLive.departsIn': 'Odlot za {time}',
'flightLive.scheduled': 'Planowany',
- 'flightLive.watching': 'TREK wypatruje samolotu',
'flightLive.taxiing': 'Gotowy do odlotu',
'flightLive.atAirport': 'Na ziemi w {code}',
'flightLive.airborne': 'W powietrzu',
'flightLive.landsIn': 'Lądowanie za {time}',
'flightLive.landed': 'Wylądował',
'flightLive.landedAt': 'Wylądował o {time} w {code}',
- 'flightLive.over': 'Lot zakończony',
- 'flightLive.noSignal': 'Brak danych na żywo',
- 'flightLive.noSignalHint': 'Otwarta sieć danych lotniczych nie zna tego lotu pod jego numerem.',
'flightLive.estimated': 'szacowany',
- 'flightLive.actual': 'rzeczywisty',
'flightLive.altitude': 'Wysokość',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Samolot',
- 'flightLive.lastSignal': 'Ostatni sygnał {time} temu',
- 'flightLive.updated': 'Zaktualizowano {time} temu',
'flightLive.noGateHint':
'Bramka, terminal i taśma bagażowa nie należą do otwartych danych lotniczych. W razie potrzeby dodaj je sam do rezerwacji.',
'flightLive.legOf': 'Lot {n} z {total}',
diff --git a/shared/src/i18n/ru/flightLive.ts b/shared/src/i18n/ru/flightLive.ts
index 0a41d684a..0f2dc74b7 100644
--- a/shared/src/i18n/ru/flightLive.ts
+++ b/shared/src/i18n/ru/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Вовремя',
'flightLive.departsIn': 'Вылет через {time}',
'flightLive.scheduled': 'По расписанию',
- 'flightLive.watching': 'TREK ждёт появления самолёта',
'flightLive.taxiing': 'Готов к вылету',
'flightLive.atAirport': 'На земле в {code}',
'flightLive.airborne': 'В воздухе',
'flightLive.landsIn': 'Посадка через {time}',
'flightLive.landed': 'Приземлился',
'flightLive.landedAt': 'Приземлился в {time} в {code}',
- 'flightLive.over': 'Рейс завершён',
- 'flightLive.noSignal': 'Нет данных в реальном времени',
- 'flightLive.noSignalHint': 'Открытая сеть данных о полётах не знает этот рейс по его номеру.',
'flightLive.estimated': 'ожидается',
- 'flightLive.actual': 'фактически',
'flightLive.altitude': 'Высота',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} м',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} км',
'flightLive.aircraft': 'Самолёт',
- 'flightLive.lastSignal': 'Последний сигнал {time} назад',
- 'flightLive.updated': 'Обновлено {time} назад',
'flightLive.noGateHint':
'Выход, терминал и лента выдачи багажа не входят в открытые данные о полётах. При необходимости добавьте их в бронирование сами.',
'flightLive.legOf': 'Рейс {n} из {total}',
diff --git a/shared/src/i18n/sk/flightLive.ts b/shared/src/i18n/sk/flightLive.ts
index 7bff6d22f..d7feab418 100644
--- a/shared/src/i18n/sk/flightLive.ts
+++ b/shared/src/i18n/sk/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Načas',
'flightLive.departsIn': 'Odlet o {time}',
'flightLive.scheduled': 'Plánovaný',
- 'flightLive.watching': 'TREK vyzerá lietadlo',
'flightLive.taxiing': 'Pripravené na odlet',
'flightLive.atAirport': 'Na zemi v {code}',
'flightLive.airborne': 'Vo vzduchu',
'flightLive.landsIn': 'Pristane o {time}',
'flightLive.landed': 'Pristálo',
'flightLive.landedAt': 'Pristálo o {time} v {code}',
- 'flightLive.over': 'Let sa skončil',
- 'flightLive.noSignal': 'Žiadne živé údaje',
- 'flightLive.noSignalHint': 'Otvorená sieť letových údajov tento let pod jeho číslom nepozná.',
'flightLive.estimated': 'odhad',
- 'flightLive.actual': 'skutočnosť',
'flightLive.altitude': 'Výška',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Lietadlo',
- 'flightLive.lastSignal': 'Posledný signál pred {time}',
- 'flightLive.updated': 'Aktualizované pred {time}',
'flightLive.noGateHint':
'Brána, terminál a pás batožiny nie sú súčasťou otvorených letových údajov. Ak ich potrebuješ, doplň ich do rezervácie sám.',
'flightLive.legOf': 'Let {n} z {total}',
diff --git a/shared/src/i18n/sv/flightLive.ts b/shared/src/i18n/sv/flightLive.ts
index 2dae463fe..a39357ef8 100644
--- a/shared/src/i18n/sv/flightLive.ts
+++ b/shared/src/i18n/sv/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'I tid',
'flightLive.departsIn': 'Avgår om {time}',
'flightLive.scheduled': 'Planerad',
- 'flightLive.watching': 'TREK håller utkik efter planet',
'flightLive.taxiing': 'Redo för avgång',
'flightLive.atAirport': 'På marken i {code}',
'flightLive.airborne': 'I luften',
'flightLive.landsIn': 'Landar om {time}',
'flightLive.landed': 'Landat',
'flightLive.landedAt': 'Landade {time} i {code}',
- 'flightLive.over': 'Flygningen är över',
- 'flightLive.noSignal': 'Ingen livedata',
- 'flightLive.noSignalHint': 'Det öppna flygdatanätet känner inte till den här flygningen under dess nummer.',
'flightLive.estimated': 'beräknad',
- 'flightLive.actual': 'faktisk',
'flightLive.altitude': 'Höjd',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Flygplan',
- 'flightLive.lastSignal': 'Senaste signal för {time} sedan',
- 'flightLive.updated': 'Uppdaterad för {time} sedan',
'flightLive.noGateHint':
'Gate, terminal och bagageband ingår inte i öppna flygdata. Lägg till dem i bokningen själv om du behöver dem.',
'flightLive.legOf': 'Flyg {n} av {total}',
diff --git a/shared/src/i18n/th/flightLive.ts b/shared/src/i18n/th/flightLive.ts
index 4a0b4022a..1fa95633a 100644
--- a/shared/src/i18n/th/flightLive.ts
+++ b/shared/src/i18n/th/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'ตรงเวลา',
'flightLive.departsIn': 'ออกเดินทางในอีก {time}',
'flightLive.scheduled': 'ตามกำหนด',
- 'flightLive.watching': 'TREK กำลังรอเครื่องบิน',
'flightLive.taxiing': 'พร้อมออกเดินทาง',
'flightLive.atAirport': 'อยู่บนพื้นที่ {code}',
'flightLive.airborne': 'อยู่บนฟ้า',
'flightLive.landsIn': 'ลงจอดในอีก {time}',
'flightLive.landed': 'ลงจอดแล้ว',
'flightLive.landedAt': 'ลงจอดเวลา {time} ที่ {code}',
- 'flightLive.over': 'เที่ยวบินจบแล้ว',
- 'flightLive.noSignal': 'ไม่มีข้อมูลสด',
- 'flightLive.noSignalHint': 'เครือข่ายข้อมูลการบินแบบเปิดไม่รู้จักเที่ยวบินนี้จากหมายเลข',
'flightLive.estimated': 'โดยประมาณ',
- 'flightLive.actual': 'จริง',
'flightLive.altitude': 'ความสูง',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} ม.',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} กม.',
'flightLive.aircraft': 'เครื่องบิน',
- 'flightLive.lastSignal': 'สัญญาณล่าสุดเมื่อ {time} ที่แล้ว',
- 'flightLive.updated': 'อัปเดตเมื่อ {time} ที่แล้ว',
'flightLive.noGateHint': 'ประตู อาคาร และสายพานกระเป๋าไม่อยู่ในข้อมูลการบินแบบเปิด เพิ่มเองในการจองหากต้องการ',
'flightLive.legOf': 'เที่ยวบิน {n} จาก {total}',
'flightLive.adminTitle': 'สถานะเที่ยวบินสด',
diff --git a/shared/src/i18n/tr/flightLive.ts b/shared/src/i18n/tr/flightLive.ts
index ce542447b..1cd8f2a00 100644
--- a/shared/src/i18n/tr/flightLive.ts
+++ b/shared/src/i18n/tr/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Zamanında',
'flightLive.departsIn': '{time} sonra kalkış',
'flightLive.scheduled': 'Planlandı',
- 'flightLive.watching': 'TREK uçağı gözlüyor',
'flightLive.taxiing': 'Kalkışa hazır',
'flightLive.atAirport': '{code} yerde',
'flightLive.airborne': 'Havada',
'flightLive.landsIn': '{time} sonra iniş',
'flightLive.landed': 'İndi',
'flightLive.landedAt': '{time} saatinde {code} indi',
- 'flightLive.over': 'Uçuş bitti',
- 'flightLive.noSignal': 'Canlı veri yok',
- 'flightLive.noSignalHint': 'Açık uçuş veri ağı bu uçuşu numarasıyla tanımıyor.',
'flightLive.estimated': 'tahmini',
- 'flightLive.actual': 'gerçek',
'flightLive.altitude': 'İrtifa',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Uçak',
- 'flightLive.lastSignal': 'Son sinyal {time} önce',
- 'flightLive.updated': '{time} önce güncellendi',
'flightLive.noGateHint':
'Kapı, terminal ve bagaj bandı açık uçuş verilerinde yer almaz. Gerekirse bunları rezervasyona kendin ekle.',
'flightLive.legOf': 'Uçuş {n}/{total}',
diff --git a/shared/src/i18n/uk/flightLive.ts b/shared/src/i18n/uk/flightLive.ts
index 601fe155c..f0f0a3d77 100644
--- a/shared/src/i18n/uk/flightLive.ts
+++ b/shared/src/i18n/uk/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Вчасно',
'flightLive.departsIn': 'Виліт через {time}',
'flightLive.scheduled': 'За розкладом',
- 'flightLive.watching': 'TREK чекає на появу літака',
'flightLive.taxiing': 'Готовий до вильоту',
'flightLive.atAirport': 'На землі в {code}',
'flightLive.airborne': 'У повітрі',
'flightLive.landsIn': 'Посадка через {time}',
'flightLive.landed': 'Приземлився',
'flightLive.landedAt': 'Приземлився о {time} в {code}',
- 'flightLive.over': 'Рейс завершено',
- 'flightLive.noSignal': 'Немає даних у реальному часі',
- 'flightLive.noSignalHint': 'Відкрита мережа даних про польоти не знає цей рейс за його номером.',
'flightLive.estimated': 'очікується',
- 'flightLive.actual': 'фактично',
'flightLive.altitude': 'Висота',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} м',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} км',
'flightLive.aircraft': 'Літак',
- 'flightLive.lastSignal': 'Останній сигнал {time} тому',
- 'flightLive.updated': 'Оновлено {time} тому',
'flightLive.noGateHint':
'Вихід, термінал і стрічка видачі багажу не входять до відкритих даних про польоти. За потреби додайте їх до бронювання самі.',
'flightLive.legOf': 'Рейс {n} з {total}',
diff --git a/shared/src/i18n/vi/flightLive.ts b/shared/src/i18n/vi/flightLive.ts
index f332cbe18..6a8245408 100644
--- a/shared/src/i18n/vi/flightLive.ts
+++ b/shared/src/i18n/vi/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': 'Đúng giờ',
'flightLive.departsIn': 'Khởi hành sau {time}',
'flightLive.scheduled': 'Theo lịch',
- 'flightLive.watching': 'TREK đang chờ máy bay xuất hiện',
'flightLive.taxiing': 'Sẵn sàng khởi hành',
'flightLive.atAirport': 'Trên mặt đất tại {code}',
'flightLive.airborne': 'Đang bay',
'flightLive.landsIn': 'Hạ cánh sau {time}',
'flightLive.landed': 'Đã hạ cánh',
'flightLive.landedAt': 'Hạ cánh lúc {time} tại {code}',
- 'flightLive.over': 'Chuyến bay đã kết thúc',
- 'flightLive.noSignal': 'Không có dữ liệu trực tiếp',
- 'flightLive.noSignalHint': 'Mạng dữ liệu chuyến bay mở không biết chuyến bay này theo số hiệu.',
'flightLive.estimated': 'dự kiến',
- 'flightLive.actual': 'thực tế',
'flightLive.altitude': 'Độ cao',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} m',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} km',
'flightLive.aircraft': 'Máy bay',
- 'flightLive.lastSignal': 'Tín hiệu cuối {time} trước',
- 'flightLive.updated': 'Cập nhật {time} trước',
'flightLive.noGateHint':
'Cửa, nhà ga và băng chuyền hành lý không có trong dữ liệu chuyến bay mở. Hãy tự thêm vào đặt chỗ nếu cần.',
'flightLive.legOf': 'Chuyến {n}/{total}',
diff --git a/shared/src/i18n/zh-TW/flightLive.ts b/shared/src/i18n/zh-TW/flightLive.ts
index 1a0d8a05c..fd40fdf37 100644
--- a/shared/src/i18n/zh-TW/flightLive.ts
+++ b/shared/src/i18n/zh-TW/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': '準點',
'flightLive.departsIn': '{time}後起飛',
'flightLive.scheduled': '預定',
- 'flightLive.watching': 'TREK 正在等候飛機出現',
'flightLive.taxiing': '準備起飛',
'flightLive.atAirport': '在 {code} 地面',
'flightLive.airborne': '飛行中',
'flightLive.landsIn': '{time}後降落',
'flightLive.landed': '已降落',
'flightLive.landedAt': '{time} 降落於 {code}',
- 'flightLive.over': '航班已結束',
- 'flightLive.noSignal': '無即時資料',
- 'flightLive.noSignalHint': '開放航班資料網路無法依航班號辨識此航班。',
'flightLive.estimated': '預計',
- 'flightLive.actual': '實際',
'flightLive.altitude': '高度',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} 公尺',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} 公里',
'flightLive.aircraft': '飛機',
- 'flightLive.lastSignal': '最後訊號 {time}前',
- 'flightLive.updated': '{time}前更新',
'flightLive.noGateHint': '登機門、航廈和行李轉盤不屬於開放航班資料。如有需要,請自行加入訂位。',
'flightLive.legOf': '第 {n} 段,共 {total} 段',
'flightLive.adminTitle': '即時航班狀態',
diff --git a/shared/src/i18n/zh/flightLive.ts b/shared/src/i18n/zh/flightLive.ts
index d22206a24..6f0205a1b 100644
--- a/shared/src/i18n/zh/flightLive.ts
+++ b/shared/src/i18n/zh/flightLive.ts
@@ -9,18 +9,13 @@ const flightLive: TranslationStrings = {
'flightLive.onTime': '准点',
'flightLive.departsIn': '{time}后起飞',
'flightLive.scheduled': '计划中',
- 'flightLive.watching': 'TREK 正在等待飞机出现',
'flightLive.taxiing': '准备起飞',
'flightLive.atAirport': '在 {code} 地面',
'flightLive.airborne': '飞行中',
'flightLive.landsIn': '{time}后降落',
'flightLive.landed': '已降落',
'flightLive.landedAt': '{time} 降落于 {code}',
- 'flightLive.over': '航班已结束',
- 'flightLive.noSignal': '无实时数据',
- 'flightLive.noSignalHint': '开放航班数据网络无法按航班号识别此航班。',
'flightLive.estimated': '预计',
- 'flightLive.actual': '实际',
'flightLive.altitude': '高度',
'flightLive.feet': '{n} ft',
'flightLive.meters': '{n} 米',
@@ -31,8 +26,6 @@ const flightLive: TranslationStrings = {
'flightLive.mi': '{n} mi',
'flightLive.km': '{n} 公里',
'flightLive.aircraft': '飞机',
- 'flightLive.lastSignal': '最后信号 {time}前',
- 'flightLive.updated': '{time}前更新',
'flightLive.noGateHint': '登机口、航站楼和行李转盘不属于开放航班数据。如有需要,请自行添加到预订中。',
'flightLive.legOf': '第 {n} 段,共 {total} 段',
'flightLive.adminTitle': '实时航班状态',
diff --git a/wiki/Transport-Flights-Trains-Cars.md b/wiki/Transport-Flights-Trains-Cars.md
index 834e2a9cc..9c685c73c 100644
--- a/wiki/Transport-Flights-Trains-Cars.md
+++ b/wiki/Transport-Flights-Trains-Cars.md
@@ -136,13 +136,13 @@ From the plan, **Edit** on a transport needs the right to edit days; on the Tran
TREK follows every booked flight on its day, with no API key and at no cost: the server asks the open ADS-B networks [adsb.lol](https://www.adsb.lol/) (and [adsb.fi](https://adsb.fi/) on a self-hosted install) where the aircraft flying the booked flight number is, from three hours before departure until two hours after arrival.
-- **The booking detail** on the desktop and the transport sheet on the phone show a boarding pass: what is happening now ("Departs in 2 h 10 min", "In the air", "Landed"), both airports with the planned and the expected or actual times, the route as an arc with the aircraft on it, and altitude, speed, remaining distance and aircraft while it flies.
+- **The booking detail** on the desktop and the transport sheet on the phone show a live card: where the flight stands ("Scheduled", "In the air", "Landed") with what comes next ("Lands in 5 h 40 min") and the delay, both airports with their times (the planned one struck when it moved), a small map of the real route with the aircraft on it, and altitude, speed, remaining distance and aircraft while it flies. Hover the map for the data and map credits.
- **Booking cards and the day plan** say the same in one line, with a progress bar while the flight is in the air and the delay beside it.
- **The trip map** draws the aircraft at its live position, turned to its heading; click it to open the booking.
- **Notifications** report take-off, landing and a departure 15 minutes or more late, to the booking's travellers (or the whole trip), each once. Each traveller picks the channels under Settings → Notifications.
- **The apps** have a Flight widget and turn the travel day's Live Activity into a boarding pass around a flight.
-Delays and the arrival estimate are worked out from the aircraft's positions. Gate, terminal and baggage belt are not part of open data; add them to the booking if you need them. A flight whose airline flies under another callsign, or a codeshare, may not be found: the booking then says "No live data". Only the flight's callsign leaves the server. An admin can switch the feature off under **Admin → Settings → Live flight status**, or with `FLIGHT_LIVE_ENABLED` (see [Environment-Variables](Environment-Variables#live-flight-status)).
+Delays and the arrival estimate are worked out from the aircraft's positions. Gate, terminal and baggage belt are not part of open data; add them to the booking if you need them. A flight whose airline flies under another callsign, or a codeshare, may not be found: the booking then shows no live card and keeps its plain schedule. Only the flight's callsign leaves the server. An admin can switch the feature off under **Admin → Settings → Live flight status**, or with `FLIGHT_LIVE_ENABLED` (see [Environment-Variables](Environment-Variables#live-flight-status)).
## On the map