Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const UI_STRINGS = {
```

The resulting footer strings are:

- `statistics`: `[Tab/Shift-Tab] Switch tab • [Left/Right] Period • [Up/Down] Row • [Enter] Expand • [q/Esc] Close`
- `current`: `[Tab/Shift-Tab] Switch tab • [Left/Right] Provider • [q/Esc] Close`
- `insights`: `[Tab/Shift-Tab] Switch tab • [Left/Right] Period • [q/Esc] Close`
Expand Down
21 changes: 21 additions & 0 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ export const PERIOD_ORDER: UsageWindow[] = [

export const UI_STRINGS = {
dashboardTitle: "Pi Usage Dashboard",
// New per-tab footers (used by the tabbed overlay starting Phase 4)
dashboardFooters: {
statistics: [
"[Tab/Shift-Tab] Switch tab",
"[Left/Right] Period",
"[Up/Down] Row",
"[Enter] Expand",
"[q/Esc] Close",
].join(" • "),
current: [
"[Tab/Shift-Tab] Switch tab",
"[Left/Right] Provider",
"[q/Esc] Close",
].join(" • "),
insights: [
"[Tab/Shift-Tab] Switch tab",
"[Left/Right] Period",
"[q/Esc] Close",
].join(" • "),
},
// Legacy -- removed in Phase 5 when dashboard.ts stops referencing them
dashboardFooter: [
"[Tab/Shift-Tab] Provider",
"[Left/Right] Period",
Expand Down
22 changes: 22 additions & 0 deletions tests/constants.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, expect, it } from "vitest";
import { UI_STRINGS } from "../src/shared/constants.ts";

describe("UI_STRINGS.dashboardFooters", () => {
it("statistics footer matches expected format", () => {
expect(UI_STRINGS.dashboardFooters.statistics).toBe(
"[Tab/Shift-Tab] Switch tab \u2022 [Left/Right] Period \u2022 [Up/Down] Row \u2022 [Enter] Expand \u2022 [q/Esc] Close",
);
});

it("current footer matches expected format", () => {
expect(UI_STRINGS.dashboardFooters.current).toBe(
"[Tab/Shift-Tab] Switch tab \u2022 [Left/Right] Provider \u2022 [q/Esc] Close",
);
});

it("insights footer matches expected format", () => {
expect(UI_STRINGS.dashboardFooters.insights).toBe(
"[Tab/Shift-Tab] Switch tab \u2022 [Left/Right] Period \u2022 [q/Esc] Close",
);
});
});