refactor(desktop): ホットキーシステムをreact-hotkeys-hookに全面移行 (#3178)#87
Merged
refactor(desktop): ホットキーシステムをreact-hotkeys-hookに全面移行 (#3178)#87
Conversation
…erset-sh#3178) upstream 1219200 の取り込み: - shared/hotkeys.ts (1042行) + stores/hotkeys/ (357行) を削除 - renderer/hotkeys/ に新システム導入 (react-hotkeys-hook ベース) - useAppHotkey → useHotkey、HotkeyTooltipContent → HotkeyLabel に全面移行 - tRPC hotkeysルーター削除、メニューacceleratorハードコード化 - キーボード設定ページを新システムで書き直し フォーク固有の対応: - BROWSER_RELOAD / BROWSER_HARD_RELOAD を新レジストリに追加 - SEARCH_IN_FILES を新レジストリに追加 - HotkeyCategory に "Browser" カテゴリ追加 - menu.ts のフォーク独自メニュー項目 (Browser Reload) 維持 - browser-shortcut-events.ts 維持 - workspace/page.tsx のコンフリクト解消 (閉じ括弧修正含む)
1. キーバインド競合解消
- BROWSER_RELOAD mac: meta+shift+r → meta+alt+r (REOPEN_TABとの衝突回避)
- BROWSER_HARD_RELOAD win/linux: ctrl+shift+alt+r → ctrl+alt+shift+e (同上)
2. keep-alive workspace二重発火防止
- workspace固有のuseHotkey呼び出しに { enabled: isActive } を追加
- 非アクティブworkspaceではNEW_GROUP/CLOSE_TAB/SPLIT_*等が発火しない
- ナビゲーション系(PREV_TAB等)はガードなし(全workspaceで有効)
3. SEARCH_IN_FILES Windows/Linux競合回避
- ctrl+shift+f → ctrl+shift+h (FIND_IN_TERMINAL等との衝突回避)
1. menu.ts acceleratorとregistry.tsのキー不一致修正
- browserReloadAccelerator: CmdOrCtrl+Shift+R → CmdOrCtrl+Alt+R
- registry.tsのmeta+alt+rと一致するように
2. usePresetHotkeysにenabledオプション追加
- 非アクティブworkspaceでプリセットホットキーが発火しない
- 呼び出し元で { enabled: isActive } を渡す
3. 全useHotkeyにenabled: isActive追加
- PREV_TAB/NEXT_TAB/ALT、JUMP_TO_TAB_1-9
- PREV_PANE/NEXT_PANE
- TOGGLE_SIDEBAR/TOGGLE_EXPAND_SIDEBAR
- PREV_WORKSPACE/NEXT_WORKSPACE
- hidden workspaceでの誤発火を完全に防止
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
upstream 1219200 (superset-sh#3178) のホットキーシステム全面書き換えを取り込み。
変更内容
shared/hotkeys.ts(1042行) +stores/hotkeys/(357行) + tRPC hotkeysルーターrenderer/hotkeys/に react-hotkeys-hook ベースの新モジュールuseAppHotkey→useHotkey、HotkeyTooltipContent→HotkeyLabel、useHotkeyText→useHotkeyDisplayフォーク固有の対応
BROWSER_RELOAD/BROWSER_HARD_RELOAD/SEARCH_IN_FILESを追加HotkeyCategoryに "Browser" カテゴリ追加menu.tsのフォーク独自メニュー項目維持browser-shortcut-events.ts維持コンフリクト解消 (9件)
trpc/routers/index.ts: hotkeysルーター削除menu.ts: フォーク独自メニュー維持 + acceleratorハードコード化_dashboard/layout.tsx: useHotkey import追加v2-workspace/page.tsx: HotkeyLabel移行 + フォーク構造維持workspace/page.tsx: 全面API移行 + 閉じ括弧修正usePresetHotkeys.ts: API移行EmptyTabView.tsx: API移行stores/hotkeys/store.ts: 削除受け入れshared/hotkeys.ts: 削除受け入れTest plan