Various UI tweaks

Fix missing submenu indicators and change their appearance. Clean up
styling in the Terminal app and move Settings to the top-level menu.
Remove right padding from the bottom bar.
This commit is contained in:
James Babcock committed 2026-10-02 12:19:25 -07:00
1 parent eff32d4a5a
commit 295922effd
12 files changed
+95 -96

No files matched your search

+3 -3
View File
@@ -302,10 +302,10 @@ test('the switcher row lays out windows, free space, notifications, widgets, bat
assert.deepEqual(Array.from(parts, (p) => [p.shellKey, p.depth ?? 0]), [[1, 0], [2, -2]]);
const [row, status] = parts;
// Right to left from the row's end (x=608), centred under its separator
// line (y=366): "Thu Oct 2 9:41" (56px) 10px in; the battery block (label
// line (y=366): "Thu Oct 2 9:41" (56px) flush with it; the battery block (label
// 20 + gap 5 + gauge 21) 16px before it; the 30px widget 10px before that;
// then the two notification icons, 8px clear of the widget.
const clockX = 608 - 10 - 56, batteryLeft = clockX - 16 - 46, trayLeft = batteryLeft - 40, iconsLeft = trayLeft - 8 - 56 + 4;
const clockX = 608 - 56, batteryLeft = clockX - 16 - 46, trayLeft = batteryLeft - 40, iconsLeft = trayLeft - 8 - 56 + 4;
assert.deepEqual([status.x, status.y, status.image.width, status.image.height], [iconsLeft, 367, 608 - iconsLeft, 35]);
const at = (p, x, y) => p.image.withDrawsBaked().pixels[(y - p.y) * p.image.width + x - p.x];
// The clock's text runs 8 rows down the top bar's layout, which sits 5 rows into the row.
@@ -332,7 +332,7 @@ test('many windows scroll in what the notification icons leave them', () => {
const [row, status] = chrome.paintParts();
// Clock only (no batteries or widgets): notifications end 8px before its
// 8px lead-in, and stop where three window slots plus margins remain.
const trayLeft = 608 - 10 - 56 - 8, floor = 32 + 20 + 3 * 40 - 8 + 8;
const trayLeft = 608 - 56 - 8, floor = 32 + 20 + 3 * 40 - 8 + 8;
const max = Math.floor((trayLeft - 8 - floor + 4) / 28);
assert.equal(requested.at(-1), max);
const iconsLeft = trayLeft - 8 - max * 28 + 4;
+5 -5
View File
@@ -1,10 +1,10 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const { layoutHubHeader } = require('../.test-build/app/apps/terminal/hub-header.js');
const { HUB_TITLE_X, layoutHubHeader } = require('../.test-build/app/apps/terminal/hub-header.js');
const font = size => ({ measureText: text => [...text].length * size, getGlyph: () => ({ dwidthX: size }) });
test('terminal short status stays inline; exact-fit status does not move the list', () => {
const f = font(7), title = 'Terminal', status = 'Connected.';
const width = 18 + f.measureText(title) + 16 + f.measureText(status) + 12;
const width = HUB_TITLE_X + f.measureText(title) + 16 + f.measureText(status) + 12;
const header = layoutHubHeader(f, title, status, width, 18);
assert.equal(header.y, 10); assert.equal(header.listTop, 34); assert.deepEqual(header.lines, [status]);
assert.equal(layoutHubHeader(f, title, status, width - 1, 18).y, 28);
@@ -14,16 +14,16 @@ test('terminal long error wraps in full-width block and moves menu below all lin
for (const size of [5, 7, 12, 20]) for (const width of [320, 576, 640]) {
const f = font(size), step = size * 2;
const header = layoutHubHeader(f, 'Terminal - Connections', status, width, step);
assert.equal(header.x, 18); assert.equal(header.y, 10 + step);
assert.equal(header.x, HUB_TITLE_X); assert.equal(header.y, 10 + step);
assert.equal(header.lines.join(' '), status);
assert.ok(header.lines.every(line => f.measureText(line) <= width - 30));
assert.ok(header.lines.every(line => f.measureText(line) <= width - HUB_TITLE_X - 12));
assert.ok(header.listTop >= header.y + header.lines.length * step);
assert.equal(header.listTop, 16 + step * (1 + header.lines.length));
}
});
test('terminal explicit newlines and long unbroken messages remain complete', () => {
const h = layoutHubHeader(font(7), 'Terminal', 'First\nSecond', 640, 18);
assert.equal(h.x, 18); assert.deepEqual(h.lines, ['First', 'Second']);
assert.equal(h.x, HUB_TITLE_X); assert.deepEqual(h.lines, ['First', 'Second']);
const word = 'x'.repeat(200);
const wrapped = layoutHubHeader(font(7), 'Terminal', word, 320, 18);
assert.equal(wrapped.lines.join(''), word);