Repository navigation
feat(desktop): New Tab screen for the right pane - #8965
Conversation
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
|
No installed development build can load this pull request as an update: its native fingerprint is |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
6eb1f7c to
5406c47
Compare
Replace the right pane's add-tab dropdown with a full New Tab pane that lists the pane types as large tiles. The + button opens it, the empty right pane shows it, and splitting a right-pane pane (header button or context menu) opens it in the new split. Picking a tile replaces the New Tab pane in place. - panes: Workspace takes onAddTab for a + button without a menu - new 'new-tab' pane kind; picking unpins first, since a header click pins the pane and replacePane skips pinned panes - drop RightPaneAddMenu, RightPaneEmptyState and page.tsx's addRightPane
Opening the right pane with no tabs (toggle, hotkey, full screen) now adds a New Tab tab instead of showing an empty area. The hook reacts to the pane opening and the layout loading, not to tabs emptying, so closing the last tab still closes the pane. Flows that open the pane and place a tab in the same step (move to right side, open page/URL/file) add nothing extra.
…n PRs The right pane's New Tab now has three sections, titled like the cloud sidebar's hover card: Tools (the center empty state's rows, with their hotkeys), this workspace's newest pages (PagesListCard) and the org's newest open PRs (CloudPullRequestRow). Picking any of them replaces the New Tab in place; a page or PR that is already open is retargeted and focused instead. When a New Tab is the focused pane, cmd+T, cmd+shift+B and cmd+shift+G replace it with a terminal, browser or Changes pane instead of opening a new tab. - replaceNewTabPane is the one path for picks, page/PR clicks and hotkeys - PagesListCard moves up to be shared by PagesListPane and the New Tab - EmptyTabActionButton takes a className
… tab The tab already says "New Tab", so the pane header repeated it. Panes get an optional hideHeader(context); the New Tab uses it only when the pane is not in a split, where the header is how you tell the panes apart and close one.
…space is open Each New Tab ran its own queries, so after five minutes with no New Tab on screen React Query dropped the cache and the next New Tab loaded from empty, with its sections popping in. useNewTabLists now owns both queries; the right pane area, mounted for as long as the workspace is open, keeps them observed and refreshes them every minute, and the New Tab reads the same cache.
With many right-pane tabs, + added a New Tab off-screen. The active tab now scrolls fully into view whenever it changes, and again when the bar first starts overflowing and the add button leaves the strip.
…he fade - An overflowing tab bar no longer keeps the inline + slot, which left 40px of empty scroll past the last tab and kept the right fade on over it. - A revealed tab keeps the 24px fade width clear at the right edge. - The reveal scrolls smoothly instead of jumping.
The Pull requests section showed the org's newest open PRs from the GitHub App table, which in a busy org were mostly other people's, and was empty without the App. It now lists every PR linked to this workspace from the host's PR history, which works for local and cloud workspaces alike, newest link first, in any state. - Each PR shows once: a repository rename leaves an older link to the same PR number under the previous URL. - The host keeps no +/- counts, so CloudPullRequestRow hides the counts when they are missing.
The host's PR history keeps no line counts. A cloud workspace's PRs are also in the cloud's GitHub App table, which has them, so the New Tab fills them in by PR number there. Local workspaces keep rows without counts until host-service stores them (TODO left in useNewTabLists).
43d0def to
29ec1cb
Compare
Local workspaces showed PR rows without counts. Each row now reads its counts from the PR detail query the pull-request pane uses, for local and cloud workspaces alike, which replaces the cloud-only fill-in and its TODO. The right pane area keeps those queries observed while the workspace is open, so the counts are there when a New Tab opens and opening the PR from it hits a warm cache.
CloudPullRequestRow fits its content, so with a short title the counts sat right after it. A fullWidth option spans the row and lets the title take the free space; the New Tab uses it, the hover card and record views don't.
[Medium impact] The PR changes how people start and fill panes in the desktop workspace. The PR appears safe to merge, with non-blocking improvements to PR-count fetching and add-menu behavior. FindingsFix with agent prompt### Issue 1
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/RightPaneArea/RightPaneArea.tsx:75-77
`RightPaneArea` fetches full details for every historical PR, even when no New Tab is visible. `usePullRequestCounts` calls `usePullRequestDetail`, which requests activity as well as counts. Since workspace history has no limit, opening a long-lived workspace can start many expensive GitHub reads just to display two numbers. Use a lightweight counts query, or limit which PRs get full-detail prefetches.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
### Issue 2
packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx:72
`onAddTab` still runs when `renderAddTabMenu` is provided, despite the new API saying it is ignored in that case. The same button keeps its `onClick` when wrapped by `DropdownMenuTrigger`, so a caller supplying both props adds a tab while opening the menu. Only attach `onAddTab` when no menu renderer is supplied.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThe right pane now opens a New Tab screen with tools, recent pages, and linked PRs.
Acknowledged limits:
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Right pane opens empty or user clicks +"] --> B["New Tab"]
C["Right-pane split"] --> B
B --> D["Choose tool, page, or PR"]
D --> E{"Matching keyed pane exists?"}
E -->|Yes| F["Update and focus existing pane"]
E -->|No| G["Unpin and replace New Tab"]
G --> H["Focus new pane"]
Reviews (1) · Last reviewed commit: "fix(desktop): New Tab PR rows right-alig..." · Reviewed by Greptile |
| {pullRequests.map((pr) => ( | ||
| <PullRequestCountsPrefetch key={pr.url} pullRequest={pr.ref} /> | ||
| ))} |
There was a problem hiding this comment.
Hidden lists fetch PR activity
RightPaneArea fetches full details for every historical PR, even when no New Tab is visible. usePullRequestCounts calls usePullRequestDetail, which requests activity as well as counts. Since workspace history has no limit, opening a long-lived workspace can start many expensive GitHub reads just to display two numbers. Use a lightweight counts query, or limit which PRs get full-detail prefetches.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/RightPaneArea/RightPaneArea.tsx
Line: 75-77
Comment:
**Hidden lists fetch PR activity**
`RightPaneArea` fetches full details for every historical PR, even when no New Tab is visible. `usePullRequestCounts` calls `usePullRequestDetail`, which requests activity as well as counts. Since workspace history has no limit, opening a long-lived workspace can start many expensive GitHub reads just to display two numbers. Use a lightweight counts query, or limit which PRs get full-detail prefetches.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| size="icon" | ||
| type="button" | ||
| variant="ghost" | ||
| onClick={onAddTab} |
There was a problem hiding this comment.
onAddTab still runs when renderAddTabMenu is provided, despite the new API saying it is ignored in that case. The same button keeps its onClick when wrapped by DropdownMenuTrigger, so a caller supplying both props adds a tab while opening the menu. Only attach onAddTab when no menu renderer is supplied.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx
Line: 72
Comment:
**Opening menus adds tabs**
`onAddTab` still runs when `renderAddTabMenu` is provided, despite the new API saying it is ignored in that case. The same button keeps its `onClick` when wrapped by `DropdownMenuTrigger`, so a caller supplying both props adds a tab while opening the menu. Only attach `onAddTab` when no menu renderer is supplied.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
The right pane's "+" now opens a full New Tab pane instead of a dropdown, following Satya's right-pane audit (#general, 10-27). It has three sections, titled like the cloud sidebar's hover card (layout "A2" from the mocks):
EmptyTabActionButton).PagesListCard).CloudPullRequestRow), from the host's PR history (pullRequests.historyByWorkspaces), so it works for local and cloud workspaces.Screenshots: https://app.superset.sh/page/right-pane-new-tab-screen-zupovt
What changed
@superset/panesgets an optionalhideHeader(context)on pane definitions.)useNewTabListsowns the pages and PR queries. The right pane area (mounted while the workspace is open) keeps them cached and refreshes them every minute, so a New Tab renders them on its first frame with no request.replaceNewTabPane, serves picks, page/PR clicks and hotkeys. It unpins first, because a header click pins a pane andreplacePaneskips pinned panes.@superset/panes:WorkspacetakesonAddTabso "+" can be a plain button. Newnew-tabpane kind.PagesListCardmoves up to be shared.EmptyTabActionButtontakes aclassName.RightPaneAddMenu,RightPaneEmptyStateandpage.tsx'saddRightPane.Choices to check
Test cases
mobile-paneKnown gap, not changed: "Reveal in sidebar" still targets the old sidebar's file tree, which the right pane area doesn't render.
Verification
right-pane-areaon: every "App" row above, noconsole.error. A page opened from the New Tab gets the right page pane, but its body is blank locally becausebun devdoesn't run the page content server (port 6794). That applies to every page pane in this setup.bun test: new tests forreplaceNewTabPane,withNewTabSplits, the open-empty hook andcreateRightPanepass, pluspackages/panes. A full run of the v2-workspace folder shows 1 unrelated failure: a Lexical import-order error in the chat composer'suseLinkChips.test.tsx, which passes alone.typecheckhas no errors in changed files; the existing better-auth type errors inpackages/auth/packages/trpcare unrelated.check:i18nclean, no new strings.