diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 97c5c93f2..268d7c613 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -555,6 +555,9 @@ body.panel .list { border: 0; border-radius: 10px; box-shadow: var(--card-edge); .row { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 5px 9px 5px 11px; } body.window .row { min-height: 48px; padding: 7px 12px 7px 14px; gap: 12px; } .row + .row, .editor + .row, .row + .editor { border-top: 1px solid var(--line-2); } +/* Settings' agent-pref link box sits between two rows, empty but for a search: + the row after it, and its own first row, still get their line (the owner, 10-22) */ +#agentPrefLinks + .row, .row + #agentPrefLinks > .row:first-child { border-top: 1px solid var(--line-2); } .row .ic { width: 18px; height: 18px; } body.window .row .ic { width: 22px; height: 22px; } .row .name { font-weight: 500; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } @@ -3411,7 +3414,10 @@ body:not(.side-nav) #view-settings .set-head.stuck::before { box-shadow: 0 1px 0 /* a built-in page a plugin's page replaces steps aside in the sidebar */ #nav button[data-replaced] { display: none !important; } img.nav-ic { border-radius: 3px; object-fit: contain; } -.row.pref { min-height: 50px; padding: 8px 12px 8px 14px; gap: 14px; } +/* one space above and below every row's content, a row with a line under its + name too: the window's 7px for every row made those read cramped beside the + one-line rows, which min-height centred (the owner, 10-22) */ +.row.pref, body.window .row.pref { min-height: 48px; padding: 12px 12px 12px 14px; gap: 14px; } .row.pref .who { flex: 1 1 auto; } .row.pref .sub { margin-top: 2px; color: var(--fg-2); } .row.pref.font-row { flex-wrap: wrap; gap: 8px 14px; } @@ -3439,7 +3445,7 @@ img.nav-ic { border-radius: 3px; object-fit: contain; } #otelList .otel-stacked .segs { margin-left: 0; max-width: 100%; flex-wrap: wrap; } #otelList .otel-env { padding: 12px 14px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); } -.session-terminal-select, .pref-pick { max-width: min(230px, 45%); height: 29px; color: var(--fg); } +.session-terminal-select, .pref-pick { max-width: min(230px, 45%); height: 26px; color: var(--fg); } .session-terminal-select:focus-visible, .pref-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .row.pref .segs { flex: none; margin-left: auto; } .proxy-segs { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; min-width: 0; max-width: 100%; } diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 710a54f10..309464e02 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -23882,10 +23882,12 @@ function hold(h) { // what was clicked moves it down rather than scrolling the view to follow // it. Turning automatic updates off grew the Version row above the // switch once the save answered, and the view slid 2px off its top (#2134). - // Only while what was clicked stays under the pointer, moved by less than - // half its height: a day picked on Routing brings its stage in above the - // bar (~138px), and the bar is held where it was clicked (#961) - if (h.top && want > 0 && Math.abs(d) < a[0].getBoundingClientRect().height / 2) want = 0; + // Only while what was clicked moved by less than its height, a line come + // in above it: a day picked on Routing brings its stage in above the bar + // (~138px), and the bar is held where it was clicked (#961). Half its + // height was too little once a settings row kept 12px above and below its + // words: the Version row's line grew it 12px past a 22px switch (10-22) + if (h.top && want > 0 && Math.abs(d) < a[0].getBoundingClientRect().height) want = 0; // a view at its top when clicked stays there rather than be given room // to scroll down: a chip saved in the panel's Profiles came in above the // button held, and room made for the button slid the chip up under the diff --git a/internal/gui/tests/reset-reminder.test.cjs b/internal/gui/tests/reset-reminder.test.cjs index 6a832ff03..60b112be1 100644 --- a/internal/gui/tests/reset-reminder.test.cjs +++ b/internal/gui/tests/reset-reminder.test.cjs @@ -9,7 +9,7 @@ const fs = require("node:fs/promises"); const path = require("node:path"); const { test } = require("node:test"); const { chromium, webkit } = require("playwright"); -const { watchSettingsReads, settingsDrawn } = require("./reader.cjs"); +const { watchSettingsReads, settingsDrawn, reach } = require("./reader.cjs"); const assets = path.resolve(__dirname, "../assets"); @@ -83,19 +83,25 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await page.locator("#resetReminderSegs .opt.on").textContent(), w.off); assert.equal(await page.locator("#resetReminderRow select").count(), 0); - await page.locator("#resetReminderRow").scrollIntoViewIfNeeded(); - await page.waitForTimeout(200); - const top = await page.locator("#view-settings").evaluate((v) => v.scrollTop); + // each control wheeled wholly into sight, clear of the tabs and the + // window's foot, before it is clicked: Playwright's own scroll to one + // cut off moved the page, not the click (10-22, taller rows) + const scrolled = () => page.locator("#view-settings").evaluate((v) => v.scrollTop); + await reach(page, opts.nth(2)); + let top = await scrolled(); await opts.nth(2).click(); assert.equal((await posted(1)).resetReminder, 24); await page.waitForTimeout(300); assert.equal(await page.locator("#resetReminderSegs .opt.on").textContent(), w.h(24)); + assert.equal(await scrolled(), top, "the click moved the page"); // another setting saved later keeps it + await reach(page, page.locator("#currencySegs .opt", { hasText: w.cny })); + top = await scrolled(); await page.locator("#currencySegs .opt", { hasText: w.cny }).click(); assert.equal((await posted(2)).resetReminder, 24, "kept by another save"); await page.waitForTimeout(300); - assert.equal(await page.locator("#view-settings").evaluate((v) => v.scrollTop), top, "no click moved the page"); + assert.equal(await scrolled(), top, "no click moved the page"); await opts.nth(0).click(); assert.equal((await posted(3)).resetReminder, 0, "Off saves 0"); diff --git a/internal/gui/tests/settings-general.test.cjs b/internal/gui/tests/settings-general.test.cjs index e2d85e00d..3a6358a3b 100644 --- a/internal/gui/tests/settings-general.test.cjs +++ b/internal/gui/tests/settings-general.test.cjs @@ -12,7 +12,11 @@ // - Language is a button (never a native