From 3ec769af7ec398b8ec403310088f015ec9c32dfd Mon Sep 17 00:00:00 2001 From: Zakk Date: Sat, 26 Sep 2026 12:04:49 +1000 Subject: [PATCH] fix(settings): give the custom geodata URL fields their full width on phones At 320-360px the six URL fields in Geodata > Custom URLs shared their row with the up/down move buttons, leaving each field only about 100-165px wide next to a full label. Let the field wrap onto its own row below 600px, so the input takes the full row and the move buttons drop to a row of their own beneath it, instead of squeezing the field down to a sliver. --- e2e/geodata.spec.ts | 24 +++++++++++++++++++++++ src/features/settings/GeodataSettings.tsx | 1 + src/ui/styles/page-layout.css | 7 +++++++ 3 files changed, 32 insertions(+) diff --git a/e2e/geodata.spec.ts b/e2e/geodata.spec.ts index 0f7f7b27..18fcd58f 100644 --- a/e2e/geodata.spec.ts +++ b/e2e/geodata.spec.ts @@ -247,6 +247,30 @@ test('URLs written from the config file carry a note until the page stores its o expect((await api.runtimeSettings()).geodata!.geosite.urls).toEqual(full.urls.geosite); }); +for (const width of [320, 360]) + test(`at ${width}px the custom URL field spans the dialog, and the move buttons sit below it`, async ({page}) => { + await page.setViewportSize({width, height: 800}); + await mockBackend(page); + await page.goto('/#/settings'); + await pick(page, 'settings.geodataSource', t('settings.geodataCustom')); + const dialog = page.getByRole('dialog', {name: t('settings.geodataCustomUrls')}); + const first = dialog.getByLabel(t('settings.geodataUrlLabel', {kind: 'geosite', n: '1'}), {exact: true}); + const {toolbarWidth, wrapWidth, buttonsBelowInput} = await first.evaluate(input => { + const toolbar = input.closest('.rp-toolbar')!; + const wrap = input.closest('.rp-input')!; + const wrapBox = wrap.getBoundingClientRect(); + const buttons = [...toolbar.querySelectorAll('button')]; + return { + toolbarWidth: toolbar.getBoundingClientRect().width, + wrapWidth: wrapBox.width, + buttonsBelowInput: buttons.every(b => b.getBoundingClientRect().top >= wrapBox.bottom - 1) + }; + }); + // The field fills its own row; the move buttons no longer share it, so they cannot squeeze the field to a sliver. + expect(wrapWidth).toBeCloseTo(toolbarWidth, 0); + expect(buttonsBelowInput).toBe(true); + }); + test('without configurable sources the page keeps the plain geodata table in the actions card', async ({page}) => { const {capabilities} = await mockBackend(page); delete capabilities.resources.geodata.configurable_sources; diff --git a/src/features/settings/GeodataSettings.tsx b/src/features/settings/GeodataSettings.tsx index 3afe65d4..c62edcea 100644 --- a/src/features/settings/GeodataSettings.tsx +++ b/src/features/settings/GeodataSettings.tsx @@ -130,6 +130,7 @@ export function GeodataSettingsCard() {