TypeScript
fix(web): make copy PR link discoverable in keybindings (#11826)
Bilal Bakr014016a62344
diff --git a/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts b/apps/web/src/components/settings/KeybindingsSettings.logic.test.tsindex d55b047e663..ff3b30124a7 100644--- a/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts+++ b/apps/web/src/components/settings/KeybindingsSettings.logic.test.ts@@ -37,12 +37,15 @@ describe("KeybindingsSettings.logic", () => {});}});- it("finds the existing URL shortcut in Settings", () => {- const rows = buildKeybindingRows(DEFAULT_RESOLVED_KEYBINDINGS, "PR URL");- expect(rows).toEqual([- expect.objectContaining({ command: "thread.copyReference", key: "mod+shift+c" }),- ]);- });+ it.each(["pu", "pull request", "copy link", "thread id"])(+ "finds the copy link shortcut with %s",+ (query) => {+ const rows = buildKeybindingRows(DEFAULT_RESOLVED_KEYBINDINGS, query);+ expect(rows).toContainEqual(+ expect.objectContaining({ command: "thread.copyReference", key: "mod+shift+c" }),+ );+ },+ );it("builds searchable rows with readable key and when values", () => {const rows = buildKeybindingRows([diff --git a/apps/web/src/components/settings/KeybindingsSettings.logic.ts b/apps/web/src/components/settings/KeybindingsSettings.logic.tsindex 7119d9ee4e5..a910c7e5535 100644--- a/apps/web/src/components/settings/KeybindingsSettings.logic.ts+++ b/apps/web/src/components/settings/KeybindingsSettings.logic.ts@@ -276,7 +276,7 @@ export function buildKeybindingCommandOptions(}export function commandLabel(command: KeybindingCommand): string {- if (command === "thread.copyReference") return "Thread: Copy PR URL or Thread ID";+ if (command === "thread.copyReference") return "Pull Request: Copy Link or Thread ID";const raw = String(command);if (raw.startsWith("script.") && raw.endsWith(".run")) {return `Run Script: ${titleCaseCommandSegment(raw.slice("script.".length, -".run".length))}`;diff --git a/docs/user/keybindings.md b/docs/user/keybindings.mdindex 55652591053..d5a9b3c920a 100644--- a/docs/user/keybindings.md+++ b/docs/user/keybindings.md@@ -25,7 +25,7 @@ in Settings.With a PR open in the right panel or on the Pull Requests page, use `mod+shift+c`to copy its URL and `mod+shift+k` to copy its number with a `#` prefix.-Both shortcuts can be changed in Settings. Search for “Copy PR URL or Thread ID”+Both shortcuts can be changed in Settings. Search for “Copy Link or Thread ID”or “Copy Number”. They copy the selected PR and leave terminal input alone.## Edit the configuration file