feat(browser): hide panel on last tab close, Cmd+T new tab#65
feat(browser): hide panel on last tab close, Cmd+T new tab#65IPJT wants to merge 3 commits intodebuglebowski:mainfrom
Conversation
…r tab Previously, closing the last browser tab would replace it with a new blank tab, keeping the panel visible indefinitely. Now the browser panel hides when the last tab is closed (via mouse or Cmd+W). Reopening the panel creates a fresh tab. Cmd+T is now context-aware: when the browser panel is focused it opens a new browser tab instead of toggling the terminal panel. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use setPanelVisibility directly in Cmd+W handler to avoid stale handlePanelToggle closure - Move e.preventDefault() into each Cmd+T branch so the keystroke isn't swallowed when both features are disabled - Remove unused newTabUrl from closeTab dependency array Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Tip: Greploop — Automatically fix all review issues by running Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal. |
Use a handlePanelToggleRef so the onCloseCurrent effect can call handlePanelToggle (which persists to DB) without a stale closure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@debuglebowski - Opiniated change but feels way more intuitive to me. 🙏🤗 |
|
Great efforts, I like it! I'm doing some deep thinking into how this should work. I'm thinking that we should change the terminal's panel shortcut, but I'm not sure to what yet. |
Does it need to change though? I think focus aware shortcuts is totally fine. Just like with how cmd+W works today |
Summary
Video
Browser_tabs.1.mp4
Test plan
🤖 Generated with Claude Code
Greptile Summary
This PR implements two UX improvements: closing the last browser tab now hides the browser panel (instead of silently creating a new blank tab), and Cmd+T creates a browser tab when the browser panel is focused rather than always toggling the terminal. The four issues flagged in prior review rounds (stale
handlePanelToggleclosure, unconditionale.preventDefault(), unusednewTabUrldep, DB persistence bypass) are all addressed in this revision via thehandlePanelToggleRefpattern and conditionalpreventDefaultplacement.Confidence Score: 5/5
Safe to merge — all previously flagged P1 issues are resolved and remaining findings are minor style improvements.
The four P1 concerns from prior review rounds (stale closure, unconditional preventDefault, unused dep, DB persistence bypass) are all addressed. The three remaining comments are P2: a latent stale-read risk that is safe under current React 18 batching, an inconsistency between the two Cmd+T guards in an edge-case native-menu code path, and an unstable inline callback reference. None block correctness.
packages/domains/task/src/client/TaskDetailPage.tsx — minor browserTabsRef and callback stability suggestions; packages/domains/task-terminals/src/client/TerminalContainer.tsx — native-menu edge case for the activeElement guard.
Important Files Changed
Prompt To Fix All With AI
Reviews (3): Last reviewed commit: "fix: persist panel visibility to DB on C..." | Re-trigger Greptile