# fix\(web\): right panel shortcuts on non-Latin layouts and terminal close dialog UX · PR \#13428 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/13428)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: closed

Source repository: Unavailable fork

Source branch: t3code/fix-terminal-hotkeys-dialog

Target branch: main

Head commit: 7f92a102ed098ad829e0dde6513b0e1a73c2ad2b

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/13428)

[Commits](https://git.cafe/pingdotgg/t3code/pull/13428/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/13428/diffs?format=markdown)

## Description

---

Fixes #13427

## What Changed

1. **Right Panel Launcher Shortcuts on Non-Latin Keyboard Layouts**:
   - Added physical key code matching (`event.code?.match(/^Key([A-Z])$/)`) as a fallback in `surfaceShortcutActionForKey` so shortcuts like `T` work on non-Latin keyboard layouts (e.g. Ukrainian `е` -> `KeyT`).
   - Focused the right panel empty launcher container when opened (`open={props.open}`) and only listen globally while the panel is actually open.
   - Updated `ChatView.tsx` `shouldTypeToFocusComposer` to check physical key codes against surface launcher keys, preventing composer from capturing launcher keys when non-Latin layouts are active.

2. **Terminal Close Confirmation Dialog UX**:
   - Added optional `checkbox` option to `requestConfirmDialog` and `ConfirmDialogOptions` in `packages/contracts/src/ipc.ts` and `apps/web/src/confirmDialog.ts`.
   - Added `confirmTerminalClose` boolean setting (default `true`) in `packages/contracts/src/settings.ts`, allowing users to toggle terminal close confirmation on/off under General Settings.
   - Attached "Don't ask again" checkbox to terminal close confirmation dialog and persisted `{ confirmTerminalClose: false }` if checked on confirm.
   - In `ConfirmDialogHost.tsx`:
     - Defaulted initial focus and Enter action to the `Confirm` button via `initialFocus` and `autoFocus`.
     - Added arrow key navigation: `ArrowLeft` / `ArrowRight` between Confirm and Cancel buttons; `ArrowUp` / `ArrowDown` between buttons and the "Don't ask again" checkbox.

## Why

- Users on non-Latin keyboard layouts could not trigger launcher shortcuts (such as `Cmd+Opt+B` then `T` for Terminal) because `event.key` produces non-ASCII characters, which also caused the chat composer to mistakenly capture the keystroke via type-to-focus.
- Terminal close confirmation lacked a "Don't ask again" option, forcing users who repeatedly open/close terminals to dismiss confirmation every time.
- Defaulting Enter to Cancel made keyboard dismissal inefficient, and lack of arrow-key navigation prevented a full keyboard workflow in the confirmation dialog.

## UI Changes

- Added "Don't ask again" checkbox in terminal close confirmation dialog.
- Added "Terminal close confirmation" toggle with dirty state tracking and reset under Settings -> General -> Confirmations.

## Checklist

- [x] This PR is small and focused
- [x] I explained what changed and why
- [x] I included before/after screenshots for any UI changes

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added a Terminal close confirmation setting, enabled by default, with a “Don’t ask again” option in the confirmation dialog.
  * Added a searchable General setting for terminal-close confirmation; restoring defaults re-enables confirmations.
* **Improvements**
  * Right-panel keyboard shortcuts now work across keyboard layouts and activate only while the panel is open.
  * Confirmation dialogs support checkboxes, arrow-key focus navigation, and initial focus on the Confirm button.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
