From 16fc0bcfb6ad07a3843f8e283795d492eefa50cc Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sat, 3 Oct 2026 01:29:59 -0700 Subject: [PATCH] Fix padding in notifications; reorder settings in Customization section
Prompts Used User: On the single notification view (focusing a notification on the bottom bar, or in the notifications app), the page title "Notification" and the notification itself can overlap, depending on configured font size. Opus 5.5: > I fixed the overlap in the single-notification view, but I haven't checked it on the glasses. The build and typecheck pass. > > **Cause:** In `drawDetailContent` (`app/ui/notifications.ts`), the "Notification" title was drawn at y=21, but the icon and the app-name/time line under it were at fixed spots (y=36 and y=42). Only the body text below them moved with the font. Small-font line heights go up to 21px, and once the line height passes about 15px, the title runs into the app-name line. > > **Fix:** The header now sits below the title's text line: 3px below it, then a row as tall as the icon or the text line, whichever is bigger. The app name is centred vertically against the icon, and the body starts 4px below that row. At the 12px default everything lands exactly where it did before, so only larger fonts look different. The menu on the right was never affected. > > This covers both places you hit it: the bottom-bar tray and the Notifications app's detail view. The pop-up for a new notification uses the same view, so it gets the fix too. > > One thing I left alone: this title sits at (24, 21), but list screens like the Notifications list put their title at (18, 10). So the title jumps a little when you open a notification from the list. Moving it to (18, 10) would make the two match and give large fonts about 11px more room. Say if you want that.
User: Thanks. Next up, in the Customization section of the Settings app, reorder the settings so that Font is first. Opus 5.5: > Font is now the first row in Settings > Customization, whichever app-switcher position is set (left/right, bottom or popup). The other rows keep their order: app switcher position, then the bottom/popup-only rows, then Battery indicators, Animations and Time format. > > The change is in `customizationRows()` in `app/ui/dashboard/settings-menus.ts`. Nothing else relies on the row order, and the build passes. I haven't installed it on a device.
--- app/ui/dashboard/settings-menus.ts | 10 +++++----- app/ui/notifications.ts | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/ui/dashboard/settings-menus.ts b/app/ui/dashboard/settings-menus.ts index f261bd58..56142f2e 100644 --- a/app/ui/dashboard/settings-menus.ts +++ b/app/ui/dashboard/settings-menus.ts @@ -241,6 +241,8 @@ function settingsSections(): SettingsSection[] { * stable list between paints. */ function customizationRows(): () => MenuItem[] { + // Opens the modal font picker (face, weight, size) for UI text. + const font = uiFontPickerMenuItem(); // Left / right / bottom edge, or popup; the dashboard controller moves or // resizes windows on change. const position = enumSettingMenuItem(appSwitcherPositionSetting); @@ -261,12 +263,10 @@ function customizationRows(): () => MenuItem[] { animationsMenuItem(), // Controls the top-bar clock (24-hour vs 12-hour). enumSettingMenuItem(timeFormatSetting), - // Opens the modal font picker (face, weight, size) for UI text. - uiFontPickerMenuItem(), ]; - const bottomRows = [position, depth, statusBar, ...rest]; - const popupRows = [position, depth, statusBar, statusBarVisibility, windowBorder, ...rest]; - const sideRows = [position, ...rest]; + const bottomRows = [font, position, depth, statusBar, ...rest]; + const popupRows = [font, position, depth, statusBar, statusBarVisibility, windowBorder, ...rest]; + const sideRows = [font, position, ...rest]; return () => { switch (appSwitcherPositionSetting.get()) { case "bottom": diff --git a/app/ui/notifications.ts b/app/ui/notifications.ts index 37bae622..3a3da2ba 100644 --- a/app/ui/notifications.ts +++ b/app/ui/notifications.ts @@ -3,7 +3,7 @@ import { formatRelativeTime } from "~/util/date-util"; import { getDefaultSmallFont } from "../graphics/ui-fonts"; import { truncateText, wrapText } from "../graphics/textwrap"; import { GrayImage, type UiFont } from "../graphics/image"; -import { LIST_ROW_TEXT_INSET, lineStep, listRowHeight } from "./metrics"; +import { LIST_ROW_TEXT_INSET, centeredTextY, lineStep, listRowHeight } from "./metrics"; import { ALL_NOTIFICATIONS, dismissNotification, @@ -20,8 +20,6 @@ import { type InputEvent } from "./gestures"; import { type Layer, type LayerContext, type PaintBelow } from "./layers"; import { Menu, type MenuBox } from "./menu-core"; -const PAGE_X = 12; -const PAGE_Y = 12; // Title position, shared with the other list apps (terminal, calendar). const TITLE_X = 18; const TITLE_Y = 10; @@ -42,6 +40,10 @@ const DETAIL_MENU_ROW_GAP = 3; const DETAIL_MENU_TEXT_X = 8; const DETAIL_MENU_TEXT_Y = 4; const DETAIL_CONTENT_X = 24; +const DETAIL_TITLE_Y = 21; +/** Gaps below the title's line box and below the icon/app-name header row. */ +const DETAIL_HEADER_GAP = 3; +const DETAIL_BODY_GAP = 4; // Disable-source confirmation: actions on top, the explanation below them. const CONFIRM_X = 24; const CONFIRM_Y = 8; @@ -428,13 +430,17 @@ function drawDetailContent( const contentX = DETAIL_CONTENT_X; const menuX = width - DETAIL_MENU_WIDTH - 24; const contentWidth = menuX - contentX - 20; - image.drawText(font, PAGE_X + 12, PAGE_Y + 9, "Notification", 220); + image.drawText(font, contentX, DETAIL_TITLE_Y, "Notification", 220); + // The header row (icon + app name) and the body stack below the title's + // line box, so a large UI font pushes them down instead of overlapping. + const headerTop = DETAIL_TITLE_Y + font.lineHeight + DETAIL_HEADER_GAP; + const headerHeight = Math.max(ICON_SIZE, font.lineHeight); let appLineX = contentX; if (icon) { - image.bitBlt(icon, contentX, 36, { transparentZero: true }); + image.bitBlt(icon, contentX, headerTop + ((headerHeight - ICON_SIZE) >> 1), { transparentZero: true }); appLineX = contentX + ICON_SIZE + ICON_TEXT_GAP; } - image.drawText(font, appLineX, 42, `${notification.appName || notification.packageName} ${formatRelativeTime(notification.postTime)}`, 150); + image.drawText(font, appLineX, centeredTextY(font, headerTop, headerHeight), `${notification.appName || notification.packageName} ${formatRelativeTime(notification.postTime)}`, 150); const lines: string[] = []; lines.push(...wrapText(font, notification.title || "(untitled)", contentWidth)); @@ -450,7 +456,7 @@ function drawDetailContent( } const step = lineStep(font); - const bodyTop = 48 + font.lineHeight + 4; + const bodyTop = headerTop + headerHeight + DETAIL_BODY_GAP; const maxLines = Math.max(1, ((height - bodyTop - step) / step) | 0); for (let index = 0; index < Math.min(lines.length, maxLines); index++) { const line = lines[index]!;