Add centered/popup version of app switcher; plus various UI tweaks

This commit is contained in:
James Babcock committed 2026-10-02 23:36:51 -07:00
1 parent 295922effd
commit 96e155ebb0
12 files changed
+810 -190

No files matched your search

+17 -11
View File
@@ -71,7 +71,7 @@ import { loadPersistedOpenApps, savePersistedOpenApps } from "../ui/shell/open-a
import { appViewportRect, isOnSwitcherEdge, sidebarStripVisible, type WindowHeightMode } from "../ui/shell/geometry";
import { type LayerActions, type TextSettingsEditToggle } from "../ui/layers";
import { type KeyboardInputSession } from "../ui/shell/keyboard-input";
import { appSwitcherPositionSetting, statusBarPositionSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayModeSetting, navigateDisplayModeSetting, navigateVerticalPositionSetting, terminalDisplayModeSetting, terminalVerticalPositionSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, verticalPositionSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings";
import { appSwitcherPositionSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayModeSetting, navigateDisplayModeSetting, navigateVerticalPositionSetting, terminalDisplayModeSetting, terminalVerticalPositionSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, verticalPositionSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings";
import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization";
import {
getInstalledEvenHubAppById,
@@ -183,18 +183,23 @@ const LAUNCHABLE_APPS = ALL_APPS.filter((app) => app.showInLauncher !== false);
/**
* The global settings window viewport sizes depend on: the display mode,
* whether the app switcher takes width beside windows or height below them,
* and, below them, whether the status bar joins it (dropping the top bar).
* whether the app switcher takes width beside windows, height below them
* or neither (a popup), and the chrome rows each window loses to it: below
* them, whether the status bar joins the row (dropping the top bar); with a
* popup, whether the status bar keeps rows of its own and the window frame
* (where the status bar goes only moves windows).
*/
function viewportSizesKey(): string {
const switcher = appSwitcherPositionSetting.get() !== "bottom" ? "strip"
: statusBarPositionSetting.get() === "switcher" ? "row+status" : "row";
const position = appSwitcherPositionSetting.get();
const switcher = position === "bottom" ? `row|${statusBarPositionSetting.get()}`
: position === "popup" ? `popup|${statusBarVisibilitySetting.get()}|${windowBorderSetting.get()}`
: "strip";
return `${displayModeSetting.get()}|${switcher}`;
}
/** The global settings that move window surfaces without resizing them. */
function windowPlacementKey(): string {
return `${verticalPositionSetting.get()}|${appSwitcherPositionSetting.get()}`;
return `${verticalPositionSetting.get()}|${appSwitcherPositionSetting.get()}|${statusBarPositionSetting.get()}`;
}
function createInitialDisplayPreview(): ImageSource | null {
@@ -525,17 +530,18 @@ class DashboardController {
}
// Vertical-position changes (and moving the app switcher between the left
// and right edges) move every window surface and the chrome that aligns
// with them; the values are tracked so unrelated setting changes don't
// trigger a full reposition.
// and right edges, or a popup switcher's status bar between the top and
// bottom) move every window surface and the chrome that aligns with them;
// the values are tracked so unrelated setting changes don't trigger a full
// reposition.
private lastWindowPlacement = windowPlacementKey();
private lastViewportSizes = viewportSizesKey();
/**
* Display mode changed (Settings > Display, or the phone page's picker),
* or the app switcher moved to or from the bottom edge: every window's
* viewport size changes. In-process windows re-measure in place; workers
* or the app switcher or its chrome changed what windows lose to them
* (see viewportSizesKey): every window's viewport size changes. In-process windows re-measure in place; workers
* that support resizing receive the new viewport. Other worker windows are
* closed and launched again at the new size.
*/