diff --git a/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts b/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts index 7729ce1837541..ea699d0c76f48 100644 --- a/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts +++ b/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts @@ -48,8 +48,8 @@ describe("KeybindingsSettings.logic", () => { ); it("orders Usage bindings and command choices like the page", () => { const expected = [ - "usage.cost", "usage.open", + "usage.cost", "usage.tokens", "usage.limits", "usage.period.day", diff --git a/apps/web/src/components/settings/KeybindingsSettings.logic.ts b/apps/web/src/components/settings/KeybindingsSettings.logic.ts index a06628e5d5052..76d32196fdf40 100644 --- a/apps/web/src/components/settings/KeybindingsSettings.logic.ts +++ b/apps/web/src/components/settings/KeybindingsSettings.logic.ts @@ -15,8 +15,15 @@ import { shortcutKeyFromEvent } from "../../keybindings"; import { isMacPlatform } from "../../lib/utils"; import { METRIC_OPTIONS, WINDOW_OPTIONS } from "../usage/usageShortcuts"; +// Every `usage.*` command needs a place here: the sorts fall back to labels for the rest, and a +// usage command ordered by label against ordered ones makes the comparison inconsistent. const usageCommandOrder = new Map( - [...METRIC_OPTIONS, ...WINDOW_OPTIONS].map((option, index) => [option.command, index]), + ( + [ + "usage.open", + ...[...METRIC_OPTIONS, ...WINDOW_OPTIONS].map((option) => option.command), + ] as const + ).map((command, index) => [command, index]), ); function compareUsageCommands(left: KeybindingCommand, right: KeybindingCommand): number | null {