| … | … | @@ -245,6 +251,64 @@ function NavigationHistoryShortcuts() { | |
| 276 | + | // A modifier tapped mid-hold leaves the held key repeating. | |
| 277 | + | if (!MODIFIER_KEYS.has(event.key)) heldUndoKey = null; | |
| 278 | + | const command = resolveShortcutCommand(event, keybindings, { | |
| 279 | + | context: { | |
🟠 High components/AppSidebarLayout.tsx:279
Custom thread.undo rules are resolved as though both panels are closed: when: "terminalOpen && !terminalFocus" never matches with the terminal open, while rules requiring !terminalOpen or !previewOpen can incorrectly allow undo when those panels are open. ThreadUndoShortcut omits terminalOpen and previewOpen from the resolver context, so they default to false; pass the route’s actual panel-open state, as NavigationHistoryShortcuts does.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/web/src/components/AppSidebarLayout.tsx around line 279: |
| 2 | |
| 3 | Custom `thread.undo` rules are resolved as though both panels are closed: `when: "terminalOpen && !terminalFocus"` never matches with the terminal open, while rules requiring `!terminalOpen` or `!previewOpen` can incorrectly allow undo when those panels are open. `ThreadUndoShortcut` omits `terminalOpen` and `previewOpen` from the resolver context, so they default to `false`; pass the route’s actual panel-open state, as `NavigationHistoryShortcuts` does. |
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Fixed in 9dd9426. The old _chat handler passed both flags, so leaving them out was a regression for custom rules. routePanelsOpen(routeThreadRef) now builds terminalOpen/previewOpen for both NavigationHistoryShortcuts and ThreadUndoShortcut. heldUndoKey moved to a ref so the new routeThreadRef dependency can't reset it mid-hold when an archive undo navigates.