GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): prefer cmd+k for command palette (#18731) · junmediatek/opencode@0f5626d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/app
    • e2e
      • actions.ts
      • app
        • palette.spec.ts
      • settings
        • settings-keybinds.spec.ts
    • src
      • context
        • command-keybind.test.ts
      • pages/session
        • use-session-commands.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/app/e2e/actions.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/actions.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ export async function runTerminal(page: Page, input: { cmd: string; token: strin
175175
await expect.poll(() => terminalHas(page, { term, token: input.token }), { timeout }).toBe(true)
176176
}
177177

178-
export async function openPalette(page: Page) {
178+
export async function openPalette(page: Page, key = "K") {
179179
await defocus(page)
180-
await page.keyboard.press(`${modKey}+P`)
180+
await page.keyboard.press(`${modKey}+${key}`)
181181

182182
const dialog = page.getByRole("dialog")
183183
await expect(dialog).toBeVisible()
Collapse file

‎packages/app/e2e/app/palette.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/app/palette.spec.ts
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from "../fixtures"
2-
import { openPalette } from "../actions"
2+
import { closeDialog, openPalette } from "../actions"
33

44
test("search palette opens and closes", async ({ page, gotoSession }) => {
55
await gotoSession()
@@ -9,3 +9,12 @@ test("search palette opens and closes", async ({ page, gotoSession }) => {
99
await page.keyboard.press("Escape")
1010
await expect(dialog).toHaveCount(0)
1111
})
12+
13+
test("search palette also opens with cmd+p", async ({ page, gotoSession }) => {
14+
await gotoSession()
15+
16+
const dialog = await openPalette(page, "P")
17+
18+
await closeDialog(page, dialog)
19+
await expect(dialog).toHaveCount(0)
20+
})
Collapse file

‎packages/app/e2e/settings/settings-keybinds.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/settings/settings-keybinds.spec.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ test("changing file open keybind works", async ({ page, gotoSession }) => {
241241
await expect(keybindButton).toBeVisible()
242242

243243
const initialKeybind = await keybindButton.textContent()
244-
expect(initialKeybind).toContain("P")
244+
expect(initialKeybind).toContain("K")
245245

246246
await keybindButton.click()
247247
await expect(keybindButton).toHaveText(/press/i)
Collapse file

‎packages/app/src/context/command-keybind.test.ts‎

Copy file name to clipboardExpand all lines: packages/app/src/context/command-keybind.test.ts
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,11 @@ describe("command keybind helpers", () => {
4040
expect(display.includes("Alt") || display.includes("⌥")).toBe(true)
4141
expect(formatKeybind("none")).toBe("")
4242
})
43+
44+
test("formatKeybind prefers the first combo", () => {
45+
const display = formatKeybind("mod+k,mod+p")
46+
47+
expect(display.includes("K") || display.includes("k")).toBe(true)
48+
expect(display.includes("P") || display.includes("p")).toBe(false)
49+
})
4350
})
Collapse file

‎packages/app/src/pages/session/use-session-commands.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session/use-session-commands.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
255255
id: "file.open",
256256
title: language.t("command.file.open"),
257257
description: language.t("palette.search.placeholder"),
258-
keybind: "mod+p",
258+
keybind: "mod+k,mod+p",
259259
slash: "open",
260260
onSelect: () => dialog.show(() => <DialogSelectFile onOpenFile={showAllFiles} />),
261261
}),

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.