From cc4b69fb80100970e8bcf7b3cf19cfcbc9994cb5 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sat, 22 Aug 2026 21:53:54 -0700 Subject: [PATCH] UI tweaks --- app/apps/developer/accelerometer-demo.ts | 1 - app/apps/developer/buzzer-demo.ts | 3 +-- app/apps/developer/developer-app.ts | 3 +++ app/apps/developer/resource-usage.ts | 4 ++-- app/ui/dashboard-settings.ts | 2 +- app/ui/font-picker.ts | 3 +-- app/ui/menu.ts | 11 +++++++++-- app/ui/shell/assistant.ts | 2 +- app/ui/shell/voice-input.ts | 2 +- 9 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/apps/developer/accelerometer-demo.ts b/app/apps/developer/accelerometer-demo.ts index 56d14700..2c1d11c4 100644 --- a/app/apps/developer/accelerometer-demo.ts +++ b/app/apps/developer/accelerometer-demo.ts @@ -116,7 +116,6 @@ export class AccelerometerDemoLayer implements Layer { image.drawText(small, 22, 82, "accelerometer at all — experimental.", 120); } - image.drawText(small, 20, height - 16, `${GESTURE_DOUBLE_CLICK} back`, 110); return image; } diff --git a/app/apps/developer/buzzer-demo.ts b/app/apps/developer/buzzer-demo.ts index 9f0d9309..08642ca7 100644 --- a/app/apps/developer/buzzer-demo.ts +++ b/app/apps/developer/buzzer-demo.ts @@ -16,7 +16,7 @@ import { const HEADER_HEIGHT = 30; const LIST_X = 20; -const FOOTER_HEIGHT = 22; +const FOOTER_HEIGHT = 0; function sleep(ms: number): Promise { return new Promise((resolve) => setTimeout(resolve, ms)); @@ -58,7 +58,6 @@ export class BuzzerDemoLayer implements Layer { image.drawText(font, LIST_X + 110, y + 1, effect.desc, selected ? 180 : 120); } - image.drawText(font, 20, height - 16, `${GESTURE_SCROLL} select ${GESTURE_CLICK} play ${GESTURE_DOUBLE_CLICK} back`, 110); return image; } diff --git a/app/apps/developer/developer-app.ts b/app/apps/developer/developer-app.ts index 44326911..aeac1b9c 100644 --- a/app/apps/developer/developer-app.ts +++ b/app/apps/developer/developer-app.ts @@ -25,6 +25,9 @@ const MENU_LAYOUT = { showBorder: false, minHeight: 0, maxHeight: appViewportSize("min").height - 16, + // These menus are pages, not popups: "Debug tests" replaces the root menu + // visually instead of letting the taller root show through beneath it. + opaque: true, }; /** A row that opens a nested page: the label plus a right-edge ">". */ diff --git a/app/apps/developer/resource-usage.ts b/app/apps/developer/resource-usage.ts index 27df5ea1..5e7cbad4 100644 --- a/app/apps/developer/resource-usage.ts +++ b/app/apps/developer/resource-usage.ts @@ -78,7 +78,7 @@ export class ResourceUsageLayer implements Layer { image.drawText( font, width - 16 - font.measureText(`CPU ${formatPercent(latest.cpuPercent)} threads ${latest.threads}`), - 37, + 47 - font.lineHeight, `CPU ${formatPercent(latest.cpuPercent)} threads ${latest.threads}`, 155, ); @@ -105,7 +105,7 @@ export class ResourceUsageLayer implements Layer { ]); image.drawText(font, 16, height - 16, `-60s`, 80); - const nowLabel = `now ${GESTURE_DOUBLE_CLICK} back`; + const nowLabel = `now`; image.drawText(font, width - 16 - font.measureText(nowLabel), height - 16, nowLabel, 110); return image; } diff --git a/app/ui/dashboard-settings.ts b/app/ui/dashboard-settings.ts index 3f9694db..58324389 100644 --- a/app/ui/dashboard-settings.ts +++ b/app/ui/dashboard-settings.ts @@ -324,7 +324,7 @@ export const voiceProviderSetting = new ConfigSettingEnum({ const wakeWordActionLabels: Record = { "voice-input": "Voice Input", - off: "Off", + off: "Ignore", "turn-screen-on": "Turn Screen On", }; diff --git a/app/ui/font-picker.ts b/app/ui/font-picker.ts index 6f45ee86..c7388eed 100644 --- a/app/ui/font-picker.ts +++ b/app/ui/font-picker.ts @@ -142,7 +142,6 @@ export class FontPickerLayer implements Layer { const info = `Line height: ${preview.lineHeight}px`; image.drawText(font, rowX - 4, previewTop + 8 + preview.lineHeight + 6, info, 110); - image.drawText(font, rowX - 4, height - font.lineHeight - 8, `scroll select click change ${GESTURE_DOUBLE_CLICK} cancel`, 90); return image; } @@ -215,7 +214,7 @@ export class FontPickerLayer implements Layer { this.draft.kind === "bitmap" ? Math.max(0, this.options.bitmapFaces.findIndex((b) => b.face === (this.draft as { face: BitmapFace }).face)) : this.options.bitmapFaces.length + this.families.indexOf(this.draft.family); - openModalMenu(ctx, "Font", items, Math.max(0, currentIndex)); + openModalMenu(ctx, "Font Face", items, Math.max(0, currentIndex)); } /** Switch families, carrying the weight (nearest available) and size over. */ diff --git a/app/ui/menu.ts b/app/ui/menu.ts index 304c1b42..8dcc1f16 100644 --- a/app/ui/menu.ts +++ b/app/ui/menu.ts @@ -26,6 +26,12 @@ export type MenuLayout = { minHeight?: number; /** Height cap before the menu starts scrolling. Default: the full screen. */ maxHeight?: number; + /** + * Paint as a standalone page: the layers below stay in the stack for back + * navigation but are not composited underneath. Default: false — the menu + * renders over whatever is below it (modal/window menus). + */ + opaque?: boolean; }; export type MenuItemRenderArgs = { @@ -192,7 +198,8 @@ export class MenuLayer implements Layer { paint(ctx: LayerContext, paintBelow: PaintBelow): GrayImage { const font = getDefaultSmallFont(); const rowHeight = listRowHeight(font); - const image = paintBelow(); + const base = ctx.stack.getBaseSize(); + const image = this.layout.opaque ? new GrayImage(base.width, base.height, 0) : paintBelow(); const { x, y, width } = this.layout; const chromeTop = (this.title ? menuTitleHeight(font) : 0) + MENU_BODY_PADDING; const minHeight = this.layout.minHeight ?? DEFAULT_MENU_MIN_HEIGHT; @@ -333,7 +340,7 @@ export class TextPageLayer implements Layer { private readonly body: string, ) {} - paint(ctx: LayerContext): GrayImage { + paint(_ctx: LayerContext): GrayImage { const font = getDefaultSmallFont(); const image = new GrayImage(G2_LENS_WIDTH, G2_LENS_HEIGHT, 0); image.drawText(font, 18, 14, this.title, 220); diff --git a/app/ui/shell/assistant.ts b/app/ui/shell/assistant.ts index 837fce90..9accaacc 100644 --- a/app/ui/shell/assistant.ts +++ b/app/ui/shell/assistant.ts @@ -129,7 +129,7 @@ export class AssistantLayer implements Layer { image.drawText(font, left + 4, rowY + 2, rows[i]!, selected ? 255 : 200); } } else { - image.drawText(font, left, top + DIALOG_H - 14, `${GESTURE_DOUBLE_CLICK} cancel`, 110); + image.drawText(font, left, top + DIALOG_H - 14, `${GESTURE_DOUBLE_CLICK} cancel`, 110 - font.lineHeight); } return image; } diff --git a/app/ui/shell/voice-input.ts b/app/ui/shell/voice-input.ts index 62f1926d..6491f6c7 100644 --- a/app/ui/shell/voice-input.ts +++ b/app/ui/shell/voice-input.ts @@ -268,7 +268,7 @@ export class VoiceInputLayer implements Layer { image.drawText(font, left + 4, rowY + 2, row.label, row.dim ? 90 : selected ? 255 : 200); } } else { - image.drawText(font, left, top + DIALOG_H - 14, this.hintText(), 110); + image.drawText(font, left, top + DIALOG_H - 14, this.hintText(), 110-font.lineHeight); } return image; }