mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 19:07:41 +00:00
* feat(tab-bar): customizable icon row for the + menu's create actions (#40359) The + menu's New Terminal/Browser/Markdown/Open Markdown/Mobile Emulator rows become one row of icons. A gear at its end opens a customizer to reorder (drag or Alt+Up/Down), hide, and assign shortcuts to each item; the icon strip scrolls sideways when plugin file types overfill it. A turned-off Mobile Emulator shows under Hidden and can be turned back on from there, and the intro callout's Hide now only removes it from the menu (with Undo). Shortcut validation and saving move into useKeybindingActionEditor, shared with the Settings shortcuts pane. * fix(tab-bar): address review on the + menu icon row - Move Reset Order and All Keyboard Shortcuts into a ⋮ menu in the customizer header. - Give the floating panel its own layout and no emulator Off item (newTabMenuSurface). - Escape closes the menu while an icon tooltip is shown; recording ends once focus leaves it. - Row is labelled as a whole with aria-activedescendant on the chosen icon; e2e selectors target the icon buttons. - Don't persist a turned-off emulator as hidden; normalize layouts on settings load. - Reuse tab-strip resize/wheel helpers, share the recorder-focus hook, split the icon strip, use ShortcutKeyCombo in tooltips and an allowed elevation for dragged rows. * fix(tab-bar): keep the create row React Compiler-clean and stop swallowing wheel when it fits * fix(tab-bar): address CodeRabbit review on the + menu icon row - Return both layouts in the paired-client settings projection. - Keep unavailable items at their saved slot when re-saving a layout. - Ignore shortcut saves that finish after a newer recording session started. - Make the customizer scrollable; announce the chosen icon via a live region. - Confirm the intro's Hide only after the write succeeds. - Render compact recorder chips with ShortcutKeyCombo.
52 lines
1.9 KiB
TypeScript
52 lines
1.9 KiB
TypeScript
import { expect } from './orca-app'
|
|
import type { PairedElectronClient } from './paired-electron-client'
|
|
import { focusActiveTerminalInput, getTerminalContent, waitForActivePanePtyId } from './terminal'
|
|
|
|
function terminalMarkerCommand(marker: string): string {
|
|
const encoded = [...marker]
|
|
.map((character) => `\\${character.charCodeAt(0).toString(8).padStart(3, '0')}`)
|
|
.join('')
|
|
return `printf '${encoded}\\n'`
|
|
}
|
|
|
|
export async function assertPairedTerminalCreation(
|
|
client: PairedElectronClient,
|
|
marker: string
|
|
): Promise<{ ptyId: string; tabId: string }> {
|
|
const before = await client.page.evaluate(() => {
|
|
const state = window.__store?.getState()
|
|
const worktreeId = state?.activeWorktreeId
|
|
return worktreeId ? (state?.tabsByWorktree[worktreeId] ?? []).map((tab) => tab.id) : []
|
|
})
|
|
await client.page.getByRole('button', { name: 'New tab' }).click({ force: true })
|
|
await client.page
|
|
.getByRole('menu')
|
|
.getByRole('button', { name: /New Terminal/i })
|
|
.first()
|
|
.click({ force: true })
|
|
let tabId = ''
|
|
await expect
|
|
.poll(
|
|
async () => {
|
|
tabId = await client.page.evaluate((oldIds) => {
|
|
const state = window.__store?.getState()
|
|
const worktreeId = state?.activeWorktreeId
|
|
return (
|
|
(worktreeId ? state?.tabsByWorktree[worktreeId] : [])?.find(
|
|
(tab) => !oldIds.includes(tab.id)
|
|
)?.id ?? ''
|
|
)
|
|
}, before)
|
|
return tabId
|
|
},
|
|
{ timeout: 30_000, message: 'Paired New Terminal did not create a HUB-owned tab' }
|
|
)
|
|
.not.toBe('')
|
|
const ptyId = await waitForActivePanePtyId(client.page, 30_000)
|
|
await focusActiveTerminalInput(client.page)
|
|
await client.page.keyboard.insertText(terminalMarkerCommand(marker))
|
|
await client.page.keyboard.press('Enter')
|
|
await expect.poll(() => getTerminalContent(client.page), { timeout: 30_000 }).toContain(marker)
|
|
return { ptyId, tabId }
|
|
}
|