[PR2/5] feat(upstream): ホットキー型拡張 + Prev/Next Tab・Workspace の unbound 化 (#3422)#160
[PR2/5] feat(upstream): ホットキー型拡張 + Prev/Next Tab・Workspace の unbound 化 (#3422)#160
Conversation
… null keys Pre-requisite for upstream superset-sh#3422 (unbound hotkey defaults). Allows hotkey entries to register with a null chord per platform. FORK NOTE: fork-specific hotkeys (BROWSER_RELOAD, BROWSER_HARD_RELOAD, SEARCH_IN_FILES) retain their non-null keys.
…kspace (superset-sh#3422) * feat(desktop/hotkeys): allow unbound defaults; restore PREV/NEXT tab+workspace Widen PlatformKey and HotkeyDefinition so hotkey entries can register with a null chord per platform. Downstream consumers were already null-safe from superset-sh#3391 (useBinding, buildRegisteredAppChords, formatHotkeyDisplay, sanitizeOverride, HotkeyMenuShortcut), so the schema widening is the only structural change needed. Re-introduce PREV_TAB, NEXT_TAB, PREV_WORKSPACE, NEXT_WORKSPACE as registered-but-unbound entries so users who want tab/workspace neighbor navigation can rebind them in Settings → Keyboard. PR superset-sh#3403 removed these to free Cmd+Alt+Arrow for directional pane focus; this restores the hotkey IDs (and their v1/v2 handlers) without claiming any default chord. Users with pre-superset-sh#3403 overrides for these IDs will transparently get their bindings back since the override is preserved in localStorage. - Null-guard canonicalizeChord(defaultKey) in useRecordHotkeys so recording a new chord for an unbound hotkey no longer throws. - Replace the force-cast in resolveHotkeyFromEvent.test.ts sample picker with a type predicate so sampleDef.key narrows to string honestly instead of lying about the widened schema. * fix(desktop/hotkeys): restore prevIndex in v2 PREV_WORKSPACE handler
…RKSPACE handlers Post-cherry-pick cleanup after superset-sh#3422: - registry.ts: remove old key-bound PREV_TAB/NEXT_TAB entries (meta+alt+left/right) now superseded by null-bound entries from upstream superset-sh#3422 - page.tsx: remove duplicate getPreviousWorkspace/getNextWorkspace tRPC queries and PREV_WORKSPACE/NEXT_WORKSPACE handlers added by cherry-pick (originals with { enabled: isActive } guards already present above) FORK NOTE: PREV/NEXT_WORKSPACE still use tRPC-based implementation in v1 workspace page.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 37 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
All 9 upstream commits have been individually cherry-picked via PR#159~#163: | Upstream | Our PR | Description | |---|---|---| | d656b7e (superset-sh#3415) | #159 (PR#1) | terminal clipboard handling | | 31fcf19 (superset-sh#3416) | #162 (PR#4) | v1 split pane startup sizing fix | | 039edf2 (superset-sh#3403) | #161 (PR#3) | Cmd+Alt+Arrow spatial pane focus | | b18a00c (superset-sh#3421) | #159 (PR#1) | v2 right sidebar toggle reactive | | 3dd1de2 (superset-sh#3420) | #161 (PR#3) | v2 diff viewer + tab title resolution | | b42a114 (superset-sh#3418) | #159 (PR#1) | CodeMirror hotkey enablement | | c925f4d (superset-sh#3422) | #160 (PR#2) | unbound defaults + restore prev/next tab/workspace | | bb12c09 (superset-sh#3419) | #163 (PR#5) | version bump 1.5.3 | | 47efa73 (superset-sh#3432) | #159 (PR#1) | pending/update-required error selectable | Fork-specific features preserved: - auto-updater (IS_FORK, GitHub Releases API) - QuitMode/cleanupMainWindowResources lifecycle - GitHubSyncService, SpreadsheetViewer - BROWSER_RELOAD / BROWSER_HARD_RELOAD / SEARCH_IN_FILES hotkeys - HotkeyCategory "Browser" - v1 deep-link navigation (useSearch/WorkspaceSearchParams) - v1 tRPC-based PREV/NEXT_WORKSPACE handlers - v1 CLOSE_TERMINAL/CLOSE_TAB hotkey handlers - v2 extra state (rightSidebarOpenViewWidth, showPresetsBar)
Upstream Merge PR#2 - ホットキー型拡張
upstream superset-sh#3422 を cherry-pick し、フォーク固有ホットキーと整合させるための手動修正を加えます。
改善内容の詳細
背景:PR#3403 で何が起きたか(このPRではまだ取り込んでいないが、関連する文脈)
upstream は PR#3403 で「Cmd+Alt+Arrow で v2 ペイン間を空間認識的に移動」する機能を入れるため、以下を削除しました:
これらのキーを FOCUS_PANE_LEFT/RIGHT/UP/DOWN に付け替えるためでした。
このPRで取り込む superset-sh#3422 の内容
問題: superset-sh#3403 でタブ切替・ワークスペース切替のホットキーが完全に削除されてしまい、これらの機能に依存していたユーザーが困った。
解決: ホットキー ID としては復活させるが、デフォルトキーは `null` とし、ユーザーが Settings から自由に rebind できる形にする。
このアプローチのために、ホットキーの型システムを以下のように拡張する必要があります:
型定義の拡張(事前修正として手動コミット)
```typescript
// Before
export type PlatformKey = { mac: string; windows: string; linux: string };
export interface HotkeyDefinition {
key: string;
label: string;
...
}
// After
export type PlatformKey = {
mac: string | null;
windows: string | null;
linux: string | null;
};
export interface HotkeyDefinition {
key: string | null;
label: string;
...
}
```
これで `key: { mac: null, windows: null, linux: null }` というデフォルト未割当エントリがレジストリに登録できるようになります。
cherry-pick: c925f4d (superset-sh#3422)
registry.ts
useRecordHotkeys.ts
各 handler ファイル
コンフリクト解決
フォーク固有機能の保持
ユーザーへのメリット
既存のカスタムバインディングが保持される
設定画面で自由に rebind できる
テスト計画