Migrate things into new UI design

This commit is contained in:
James Babcock committed 2026-07-07 00:52:47 -07:00
1 parent 1133f952e9
commit 68ab599856
21 files changed
+1262 -602

No files matched your search

+1 -53
View File
@@ -4,14 +4,11 @@ import { getDashboardPlugin, isBlankDashboardPlugin } from "../dashboard-plugins
import { DashboardSlotId, dashboardSlotIds, isNightscoutSettingsConfigured } from "../dashboard-settings";
import { DashboardInputEvent, LayerContext } from "../layers";
import { MenuLayer } from "../menu";
import { NotificationsListLayer } from "../notifications";
import { createNightscoutSettingsMenuLayer, createSettingsMenuLayer } from "./settings-menus";
import { createNightscoutSettingsMenuLayer } from "./settings-menus";
import { TelepromptLayer } from "../apps/teleprompt";
import { TerminalAppLayer } from "../apps/terminal";
import { TranscribeLayer } from "../apps/transcribe";
import { ScreenTestLayer } from "../apps/screen-test";
import { BuzzerDemoLayer } from "../apps/buzzer-demo";
import { AboutPage } from "./about-page";
import { GrayImage } from "~/graphics/image";
import { shell } from "../shell/shell";
@@ -38,21 +35,6 @@ export function createRootMenuLayer(): MenuLayer {
ctx.stack.push(createAppsMenuLayer());
},
},
{
label: "Notifications",
onSelect: (ctx) => {
ctx.stack.push(new NotificationsListLayer((ctx) => {
ctx.stack.clearToBase();
ctx.stack.push(createRootMenuLayer());
}));
},
},
{
label: "Settings",
onSelect: (ctx) => {
ctx.stack.push(createSettingsMenuLayer());
},
},
...dashboardSlotIds
.filter((slot) => !isBlankDashboardPlugin(getPluginIdForSlot(slot)))
.map((slot) => ({
@@ -64,12 +46,6 @@ export function createRootMenuLayer(): MenuLayer {
image.drawText(rootMenuFont, x, y + 3, pluginLabelForSlot(slot), 200);
},
})),
{
label: "System",
onSelect: (ctx) => {
ctx.stack.push(createSystemMenuLayer());
},
},
],
TOP_LEFT_MENU_LAYOUT,
);
@@ -93,12 +69,6 @@ function createAppsMenuLayer(): MenuLayer {
layer.start(ctx);
},
},
{
label: "Terminal",
onSelect: (ctx) => {
ctx.stack.push(new TerminalAppLayer(ctx.actions));
},
},
{
label: "Screen test",
onSelect: (ctx) => {
@@ -116,28 +86,6 @@ function createAppsMenuLayer(): MenuLayer {
);
}
function createSystemMenuLayer(): MenuLayer {
return new MenuLayer(
"System",
[
{
label: "About",
onSelect: (ctx) => {
ctx.stack.push(new AboutPage());
},
},
{
label: "Quit / Disconnect",
onSelect: async (ctx) => {
ctx.stack.clearToBase();
await ctx.actions.disconnect();
},
},
],
TOP_LEFT_MENU_LAYOUT,
);
}
function openDashboardSlot(slot: DashboardSlotId, ctx: LayerContext): void {
const pluginId = getPluginIdForSlot(slot);
if (isBlankDashboardPlugin(pluginId)) {