settings: text size gets 115% and 120% between 110% and 125%
WeltAn_X (X, Win11 26H2, 4K at 200%) found 110% still small and 125% crowded. The text size control and Ctrl/Cmd +/- now step through 100/110/115/120/125/150; settings.Validate takes 115 and 120. The control stays one segmented row and fits at the 560px window minimum. Layout at the larger steps: the size is the webview's page zoom, so the page reflows in fewer CSS pixels rather than scaling. A probe at 1920x1032 points (4K at 200%), 1280x760 and the 560x420 minimum, at every size, en and de, both engines, found nothing clipped that depends on the size. In short windows the sidebar's page list scrolls behind the Settings sub-nav, as designed; left alone. Downgrade: an older magpie refuses to save settings while settings.json holds 115 or 120 (davsync doesn't carry settings, so only a downgrade). Run on mote (macOS 27): - gofmt -l internal/settings internal/gui: clean - go test ./internal/settings: ok; go test -tags nogui -run TextSize ./internal/gui: ok; GOOS=windows and GOOS=linux go vet ./internal/settings: ok - full GUI suite (node --test --test-concurrency=5 *.test.cjs, both engines, every language) at this change on91d27452b: 27691 tests, 26664 pass, 1027 fail in 114 files. - those 114 files alone at origin/main93762f968: 1029 fail; at this change rebased on93762f968: 1018 fail. The failing names match (759 vs 769 distinct; the 10 seen only here are siblings in files already red at main, none about text size). Filed as #6709; text-size's WebKit "picked, kept, and stepped" is #6561 (a stale readerAt scrolls Settings back, red the same on main), omarchy is #6027/#4624. - text-size.test.cjs covers the six segments, the 125% click, and the panel stepping 110 -> 115 -> 120 -> 125 -> 120 -> 0 (posts [115,120,125,120,100]); chromium passes it in every language. - rebased oneee217712(13 commits, none near text size) and run again there: go test ./internal/settings ok; text-size.test.cjs 20 pass, 2 fail (the WebKit en case, #6561). Not tried: the real Windows app on a 4K screen at 200%.
This commit is contained in:
@@ -19383,8 +19383,10 @@ const CURRENCIES = [["usd", "$ USD"], ["cny", "¥ CNY"], ["provider", "By provid
|
||||
// The text size is the windows' own zoom, as a browser's Ctrl/Cmd +: the
|
||||
// page is laid out again in larger CSS pixels, so everything it measures is
|
||||
// as at 100%, and magpie sizes the windows around it (textsize.go). None is
|
||||
// under 100%: WebView2 and WebKitGTK zoom no smaller through Wails.
|
||||
const TEXT_SIZES = [100, 110, 125, 150];
|
||||
// under 100%: WebView2 and WebKitGTK zoom no smaller through Wails. 115 and
|
||||
// 120 sit between 110 and 125, where 110 read small and 125 crowded on a 4K
|
||||
// screen at 200% (WeltAn_X on X).
|
||||
const TEXT_SIZES = [100, 110, 115, 120, 125, 150];
|
||||
const textSizeKeys = () => /^Mac/.test(navigator.platform) ? "⌘+ ⌘− ⌘0" : "Ctrl+ Ctrl− Ctrl+0";
|
||||
// --zoom is the text size for what is placed against the window's own
|
||||
// drawing, which does not grow with the page: the Mac's traffic lights.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Run with Node's test runner and Playwright on the module path; see README.md.
|
||||
// The Text size setting (Settings → Preferences, Ctrl/Cmd + − 0): a pick
|
||||
// posts to /api/settings/text-size and stays picked after a reload (boot.js
|
||||
// carries it); the shortcuts step through 100/110/125/150% and back, in the
|
||||
// window and the tray panel, and a click on the control never scrolls the
|
||||
// carries it); the shortcuts step through 100/110/115/120/125/150% and
|
||||
// back, in the window and the tray panel, and a click on the control never scrolls the
|
||||
// page. The zoom itself is the webview's (Go), so here it is as a browser
|
||||
// zoomed: the window's points over the zoom in CSS pixels, deviceScaleFactor
|
||||
// the zoom — and at 150% nothing in any view runs off to the side, the Mac
|
||||
@@ -139,7 +139,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const segs = page.locator("#textSizeSegs .opt");
|
||||
await segs.first().waitFor();
|
||||
assert.equal((await page.locator("#textSizeRow .name").textContent()).trim(), name);
|
||||
assert.deepEqual((await segs.allTextContents()).map((s) => s.trim()), ["100%", "110%", "125%", "150%"]);
|
||||
assert.deepEqual((await segs.allTextContents()).map((s) => s.trim()), ["100%", "110%", "115%", "120%", "125%", "150%"]);
|
||||
assert.equal(await segs.nth(0).evaluate((b) => b.classList.contains("on")), true, "100% starts picked");
|
||||
// the name alone (1ooogle on X), the keys in the choices' tooltip
|
||||
assert.equal(await page.locator("#textSizeRow .sub").count(), 0);
|
||||
@@ -151,7 +151,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
for (let i = 0; i < 20 && !(await settingsTop(page)); i++) { await page.mouse.wheel(0, 30); await page.waitForTimeout(20); }
|
||||
const before = await settingsTop(page);
|
||||
assert(before > 0, "the settings list must scroll");
|
||||
await segs.nth(2).click();
|
||||
await segs.nth(4).click();
|
||||
await page.locator("#textSizeSegs .opt.on", { hasText: "125%" }).waitFor();
|
||||
await page.waitForTimeout(300);
|
||||
assert.equal(await settingsTop(page), before, "picking a text size must not scroll the settings page");
|
||||
@@ -195,11 +195,17 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const mod = await page.evaluate(() => /^Mac/.test(navigator.platform) ? "Meta" : "Control");
|
||||
await page.locator("#view-agents").waitFor();
|
||||
assert.equal(await zoomVar(page), "1.1");
|
||||
await page.keyboard.press(mod + "+Equal");
|
||||
// the steps between 110 and 125 (WeltAn_X on X: 110 small, 125
|
||||
// crowded at 4K and 200%), one at a time
|
||||
for (const n of ["1.15", "1.2", "1.25"]) {
|
||||
await page.keyboard.press(mod + "+Equal");
|
||||
await page.waitForFunction((n) => getComputedStyle(document.documentElement).getPropertyValue("--zoom").trim() === n, n);
|
||||
}
|
||||
await page.keyboard.press(mod + "+Minus");
|
||||
await page.waitForTimeout(200);
|
||||
await page.keyboard.press(mod + "+Digit0");
|
||||
await page.waitForTimeout(200);
|
||||
assert.deepEqual(posts, [125, 100]);
|
||||
assert.deepEqual(posts, [115, 120, 125, 120, 100]);
|
||||
assert.deepEqual(page.errors, []);
|
||||
await page.context().close();
|
||||
});
|
||||
|
||||
@@ -1581,7 +1581,9 @@ var (
|
||||
UpdateEveries = []int{30, 60, 360, 1440}
|
||||
// TextSizes are TextSize's values, in percent. None is under 100: the
|
||||
// webviews' zoom on Windows and Linux (Wails' SetZoom) goes no lower.
|
||||
TextSizes = []int{100, 110, 125, 150}
|
||||
// 115 and 120 are the steps between 110 and 125 (WeltAn_X on X: 110
|
||||
// small, 125 crowded at 4K and 200%).
|
||||
TextSizes = []int{100, 110, 115, 120, 125, 150}
|
||||
)
|
||||
|
||||
// SearchFirst's values: a provider's search first, saved as "", or the
|
||||
|
||||
@@ -61,10 +61,12 @@ func TestRoundTrip(t *testing.T) {
|
||||
if Save(Settings{}) != nil || Load().TextSize != DefaultTextSize() {
|
||||
t.Fatalf("default text size: %+v", Load())
|
||||
}
|
||||
if Save(Settings{TextSize: 125}) != nil || Load().TextSize != 125 {
|
||||
t.Fatal("text size not kept")
|
||||
for _, n := range []int{115, 120, 125} {
|
||||
if Save(Settings{TextSize: n}) != nil || Load().TextSize != n {
|
||||
t.Fatalf("text size %d not kept", n)
|
||||
}
|
||||
}
|
||||
for _, bad := range []int{90, 120, 300, -1} {
|
||||
for _, bad := range []int{90, 105, 130, 300, -1} {
|
||||
if Save(Settings{TextSize: bad}) == nil {
|
||||
t.Fatalf("text size %d accepted", bad)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user