Skip to content

Commit 787cd77

Browse files
authored
Merge pull request #85 from subtype-space/dev
Move on-time verdict into header status line; drop 4th tile (v1.18.3)
2 parents 1eb752a + 61237d5 commit 787cd77

3 files changed

Lines changed: 13 additions & 19 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "subspace-api",
3-
"version": "1.18.2",
3+
"version": "1.18.3",
44
"description": "API service for subtype.space",
55
"repository": {
66
"type": "git",

src/integrations/aerodatabox/renderer.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ export function renderMarkup(
9999
.stat-tile { flex: 1; border: ${s(2)} solid black; border-radius: ${s(10)}; padding: ${s(10)} ${s(6)}; display: flex; flex-direction: column; align-items: center; gap: ${s(3)}; }
100100
.stat-tile-label { font-size: ${s(15)}; font-weight: 700; letter-spacing: 1.5px; }
101101
.stat-tile-value { font-size: ${s(26)}; font-weight: 800; }
102-
/* Arrival on-time verdict tile — no label, word centered + uppercased so it reads as a status flag. */
103-
.stat-tile--status { justify-content: center; }
104-
.stat-tile--status .stat-tile-value { text-transform: uppercase; letter-spacing: 0.5px; }
105102
106103
/* TRMNL X (screen--lg): the taller screen leaves room to breathe, so center the
107104
blocks with a fixed gap (OG stays space-between — its content already fills the
@@ -205,11 +202,7 @@ function renderFullCard(f: FlightDisplayData, baseUrl: string): string {
205202
`<div class="stat-tile"><span class="stat-tile-label">${tile.label}</span><span class="stat-tile-value">${tile.value}</span></div>`
206203
)
207204
.join('')
208-
// On-time verdict fills the (formerly V/S) 4th slot — a label-less status tile, shown whenever known.
209-
const statusHtml = f.delayString
210-
? `<div class="stat-tile stat-tile--status"><span class="stat-tile-value">${escapeHtml(f.delayString)}</span></div>`
211-
: ''
212-
const tilesHtml = baseHtml + statusHtml
205+
const tilesHtml = baseHtml
213206
const showTiles = tilesHtml !== ''
214207

215208
return `
@@ -220,7 +213,7 @@ function renderFullCard(f: FlightDisplayData, baseUrl: string): string {
220213
<span class="airline-name">${escapeHtml(airlineName)}</span>
221214
<span class="flight-number">${escapeHtml(flightCode)}</span>
222215
<span class="flight-aircraft">${escapeHtml(f.aircraftModel)}</span>
223-
<span class="flight-status">${escapeHtml(f.status)}</span>
216+
<span class="flight-status">${escapeHtml(f.status)}${f.delayString ? ` <span class="flight-adherence">· ${escapeHtml(f.delayString)}</span>` : ''}</span>
224217
</div>
225218
</div>
226219
<div class="flight-arc-wrap">

test/integrations/aerodatabox/renderers.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,22 @@ describe('renderMarkup', () => {
170170
expect(mixedOut).not.toContain('was 14:46') // minor early arrival -> gated out
171171
})
172172

173-
it('shows the on-time verdict as the 4th full-card tile (label-less), and hides it when unknown', () => {
174-
// assert on the tile element, not the always-present .stat-tile--status CSS rule
173+
it('shows the on-time verdict in the header status line (not a 4th tile), and hides it when unknown', () => {
175174
const delayed = renderMarkup({ ...sampleFlight, delayString: 'Delayed' }, 'full', 0, 'https://example.com')
176-
expect(delayed).toContain('class="stat-tile stat-tile--status"')
177-
expect(delayed).toContain('>Delayed<')
178-
expect(delayed).toContain('>ALT<') // sits alongside the telemetry tiles
179-
// unknown -> no status tile
175+
// adherence rides in the header next to the flight phase, keeping the tile row a clean 3
176+
expect(delayed).toContain('class="flight-adherence"')
177+
expect(delayed).toContain('Delayed')
178+
expect(delayed).not.toContain('stat-tile--status') // the old 4th tile is gone
179+
expect(delayed).toContain('>ALT<') // uniform ALT/SPD/HDG telemetry row remains
180+
// unknown -> no adherence in the header
180181
const unknown = renderMarkup({ ...sampleFlight, delayString: null }, 'full', 0, 'https://example.com')
181-
expect(unknown).not.toContain('class="stat-tile stat-tile--status"')
182+
expect(unknown).not.toContain('class="flight-adherence"')
182183
})
183184

184185
it('does not surface delayString on half variants (the "was" anchors carry the delay there)', () => {
185186
const out = renderMarkup({ ...sampleFlight, delayString: 'Delayed' }, 'half_horizontal', 0, 'https://example.com')
186-
expect(out).not.toContain('>Delayed<')
187-
expect(out).not.toContain('class="stat-tile stat-tile--status"')
187+
expect(out).not.toContain('flight-adherence')
188+
expect(out).not.toContain('Delayed') // status is 'Cruising'; adherence never rendered on halves
188189
})
189190

190191
it('counts down to departure (DEPARTS IN) pre-takeoff, then to arrival (ARRIVING IN)', () => {

0 commit comments

Comments
 (0)