From b6b7874b97d45a4c2cf14075d7664577a01df738 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 14 Nov 2026 18:53:03 -0800 Subject: [PATCH] Keep the map credits clear of expanded Context Expanded, Context covers the right edge from top to bottom, so the credit row now ends short of it. The credit model knows the expanded column and pins the gap, the header test lists the new search and expand buttons, and the controls tolerate operations without an annotation resolver. Co-authored-by: Manjunath Paparaju --- src/app/controls.js | 2 +- src/contextTabKeyboard.test.mjs | 6 +++++- src/creditAttribution.test.mjs | 30 ++++++++++++++++++++++++++++++ src/ui/styles/context-dock.css | 17 +++++++++++++++-- 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/app/controls.js b/src/app/controls.js index 6cd2d7bfc..bb53381c4 100644 --- a/src/app/controls.js +++ b/src/app/controls.js @@ -38,7 +38,7 @@ export function createApplicationControls({ ...services, ...operations.surface.controlServices, searchAndFlyTo: operations.searchAndFlyTo, - pickWorldFromScreen: operations.annotationResolver.pickWorldFromScreen, + pickWorldFromScreen: operations.annotationResolver?.pickWorldFromScreen, fetchRegionalBrief: (...args) => operations.requests.regional.getBrief(...args), ...catalogControlServices(catalog), diff --git a/src/contextTabKeyboard.test.mjs b/src/contextTabKeyboard.test.mjs index 9ebd0e384..4d5872199 100644 --- a/src/contextTabKeyboard.test.mjs +++ b/src/contextTabKeyboard.test.mjs @@ -152,7 +152,7 @@ test('Context async action buttons remain focused while busy', () => { assert.match(clearButton, /:aria-busy=/); }); -test('Context header holds only its title, edge switch and collapse control', () => { +test('Context header holds its title, search, expand, edge switch and collapse control', () => { const panel = html.match( /
{ for (const { rule, part } of ownBoxEntries()) { const guarded = rule.decls.filter((decl) => GUARDED_PROPS.has(decl.prop)); if (!guarded.length) continue; + // Expanded Context covers the right edge top to bottom; the credit row + // stops short of it instead (the docked-Context test below). + if (part === DOCKED_RAIL) continue; if (!RECOGNIZED.has(part)) { complaints.push(`unrecognized selector positions a modelled element: "${part}" (${guarded.map((d) => d.prop).join(', ')})`); continue; @@ -603,6 +607,32 @@ test('the full-width context rail clears the required credit at every modelled v assert.deepEqual(failures, [], `context rail re-enters the credit band at ${failures.join(', ')}`); }); +test('expanded Context and the credit row never overlap', () => { + const docked = RULES.filter((rule) => rule.parts.includes(DOCKED_RAIL)); + assert.equal(docked.length, 1, 'expanded Context has exactly one rule for its column'); + assert.deepEqual(docked[0].media, [], 'the expanded column applies at every width'); + const decl = (prop) => docked[0].decls.find((d) => d.prop === prop)?.value; + assert.equal(decl('right'), '0'); + assert.equal(decl('width'), 'var(--context-dock-width)'); + // The credit row starts under 3rem from the left and may run to its + // max-width: with 3rem and the column's width taken off, it ends short of + // the column. + for (const base of [CREDIT_SELECTORS[1], MINIMAL_HUD_CREDIT]) { + const selector = base.replace('body:not(', 'body.context-docked:not('); + assert.ok(compareSpecificity(specificity(selector), specificity(base)) > 0); + for (const width of WIDTHS) { + const left = resolve([base], 'left', width, 'credit').decl.value; + const rem = /^(\d*\.?\d+)rem$/.exec(left); + assert.ok(rem && Number(rem[1]) < 3, `at ${width}px the credit starts at ${left}`); + assert.equal( + resolve([base, selector], 'max-width', width, 'docked credit').decl.value, + 'calc(100vw - 3rem - var(--context-dock-width))', + `at ${width}px the credit row can run under expanded Context`, + ); + } + } +}); + test('the dock anchor changes at 720px — the 2vh cancellation is band-limited', () => { const lift = 'var(--world-timeline-lift, 0px)'; assert.equal(resolve(['#command-dock'], 'bottom', 800, 'dock').decl.value, `calc(2vh + ${lift})`); diff --git a/src/ui/styles/context-dock.css b/src/ui/styles/context-dock.css index 7e07f08e2..2720cd470 100644 --- a/src/ui/styles/context-dock.css +++ b/src/ui/styles/context-dock.css @@ -16,11 +16,23 @@ body.context-docked #right-context-rail { height: 100vh !important; } +/* The map credits stay readable beside the column: their row ends short of + it. creditAttribution.test.mjs pins this. */ +body.context-docked:not(.ui-clean-view):not(.recording-mode) #cesium-credits, +body.context-docked:not(.ui-clean-view):not(.recording-mode):has( + #intel-hud[data-variant='minimal'].active + ) + #cesium-credits { + max-width: calc(100vw - 3rem - var(--context-dock-width)); +} + body.context-docked #right-context-rail > .gev-panel-rail { display: none; } -body.context-docked #right-context-rail > :not(#global-context-panel):not(.gev-panel-rail) { +body.context-docked + #right-context-rail + > :not(#global-context-panel):not(.gev-panel-rail) { display: none !important; } @@ -165,7 +177,8 @@ body.mobile-shell .context-dock-btn { /* While a search is typed, what cannot match steps aside so the matches lead: the weather, the view's own figures, the route and altitude graph, and the layer switches. The radius stays: it sets how far the search looks. */ -.context-searching :is( +.context-searching + :is( .spot-conditions__weather, .spot-conditions__loading, .spot-conditions__source,