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 <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-16 14:59:17 -08:00
1 parent 4b350cb9ae
commit b6b7874b97
4 files changed
+51 -4

No files matched your search

+1 -1
View File
@@ -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),
+5 -1
View File
@@ -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(
/<div id="global-context-panel"[\s\S]*?<div class="cyber-panel-body[ "]/,
);
@@ -174,6 +174,10 @@ test('Context header holds only its title, edge switch and collapse control', ()
assert.deepEqual(tags, [
'span.panel-title',
'span.panel-divider',
'button.context-dock-btn',
'span.material-symbols-outlined',
'button.context-dock-btn',
'span.material-symbols-outlined',
'button.panel-edge-btn',
'span.material-symbols-outlined',
'button.panel-collapse-btn',
+30
View File
@@ -217,6 +217,7 @@ const RECOGNIZED = new Set([
'#command-dock.dock-has-two-pinned-trays #control-panel.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content',
]);
const DOCKED_RAIL = 'body.context-docked #right-context-rail';
const ELEMENT_KEYS = ['#cesium-credits', '#command-dock', '#right-context-rail', '.dock-popover-content'];
// Any of these on a modelled element's own box changes the geometry this pin
@@ -412,6 +413,9 @@ test('the model refuses every cascade construct it cannot resolve', () => {
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})`);
+15 -2
View File
@@ -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,