keep the phone credit line on screen

On phones the credit line kept white-space: nowrap, so map plus outline credits ran past the right edge and cut off the Data attribution link. Cesium's credit block is absolutely positioned inside #cesium-credits, so the box needs a real width for the credits to wrap: give it the screen width divided by its 0.8 scale, overriding the dock's width: auto !important the way the phone offset already does. Desktop keeps its one-line rule.
This commit is contained in:
manjunath committed 2026-10-30 23:55:10 +05:30
1 parent 38226ac33d
commit c61ddb38c2
3 files changed
+22 -1

No files matched your search

+3
View File
@@ -30,3 +30,6 @@
- Skip Nominatim place and outline lookups when the server reports that no
Nominatim endpoint is configured, so a default install sends no request it
would refuse (Manjunath, #842).
- Keep the phone credit line on screen when map and outline credits make it
longer, wrapping it within the screen instead of running off the edge
(Manjunath, #842).
+10
View File
@@ -499,6 +499,16 @@ test('the phone shell keeps the required attribution visible', () => {
idleCredit,
/display:\s*none|visibility:\s*hidden|opacity:\s*0/,
);
// A long credit line (map plus outline credits) wraps inside the screen:
// the box needs a real width for Cesium's absolutely positioned credit
// block, set before the 0.8 scale, so it is divided by it.
assert.match(idleCredit, /white-space: normal;/);
assert.match(
idleCredit,
/[^-]width: calc\(\(100vw - 20px\) \/ 0\.8\) !important;/,
);
assert.match(idleCredit, /max-width: none !important;/);
assert.match(idleCredit, /scale: 0\.8;/);
// Open sheet: above everything the sheet covers, drawn above the sheets.
const sheetCredit = rule(
'body.mobile-shell[data-mobile-sheet]:not(.recording-mode):not(.cockpit-mode):not(.ui-clean-view) #cesium-credits',
+9 -1
View File
@@ -378,7 +378,15 @@ body.mobile-shell:not(.recording-mode):not(.cockpit-mode):not(.ui-clean-view)
right: auto;
bottom: calc(var(--mobile-tab-space) + 106px) !important;
left: 10px;
max-width: calc(100vw - 20px);
/* Cesium's credit block is absolutely positioned inside this box, so the
box needs a real width (a max-width alone leaves it 0 wide) for the
credits to wrap at the screen width rather than one word per line. The
width applies before the 0.8 scale, keeping the scaled line 10px from the
right edge, so every credit and "Data attribution" stay on screen. Like
the offset above, it must beat the dock's width: auto !important. */
width: calc((100vw - 20px) / 0.8) !important;
max-width: none !important;
white-space: normal;
transform-origin: left bottom;
scale: 0.8;
}