Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.
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 @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KeybindingCommand, number>(
[...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 {
Expand Down
Loading