Repository navigation
Initialize tabs UI for explorer - #48789
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughExplorerLayout now provides an editor-tab header with home navigation and an animated notebook menu. EditorTabs supports custom controls. Explorer routes are included in shared editor typing and notebook tab mapping. ChangesExplorer editor tabs
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant ExplorerLayout
participant EditorTabs
participant NewTabDropdown
ExplorerLayout->>EditorTabs: Provide custom home and new-tab controls
EditorTabs->>NewTabDropdown: Render custom new-tab button
NewTabDropdown->>ExplorerLayout: Navigate to notebook creation
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/studio/components/layouts/editors/EditorsLayout.hooks.ts`:
- Around line 14-15: Keep the explorer result in EditorsLayout hooks, and update
editor-specific commands in
apps/studio/components/layouts/editors/EditorsLayout.hooks.ts lines 14-15 to
handle Explorer explicitly. In apps/studio/state/tabs.tsx lines 19-22, add
notebook navigation and resolve Explorer routes using the entity mapping; update
close-all, close-others, and close-right so Explorer is not treated as SQL. In
apps/studio/state/tabs.tsx line 474, make closing the last Explorer tab fall
back to the Explorer route rather than /sql.
In `@apps/studio/components/layouts/ExplorerLayout/ExplorerLayout.tsx`:
- Around line 117-120: Wrap the disabled “New chat” DropdownMenuItem in
DropdownMenuItemTooltip and provide a tooltip message explaining why chat
creation is unavailable. Keep the item disabled and preserve its existing icon
and label.
- Around line 112-116: Wire the “New notebook” DropdownMenuItem to the existing
notebook creation flow, creating a notebook and navigating to its Explorer tab
when selected. Use the surrounding ExplorerLayout handlers and navigation
symbols, or disable the item until that flow is implemented; do not leave it as
a menu item that only closes the dropdown.
- Around line 81-90: Update the screen-reader-only label inside the Explorer
home Link to describe its navigation destination rather than sidebar expansion;
replace “Expand sidebar” with an accessible name identifying Explorer home while
preserving the existing link and icon behavior.
In `@apps/studio/components/layouts/Tabs/Tabs.tsx`:
- Around line 40-44: Rename the EditorTabsProps boolean prop hideCollapseButton
to isCollapseButtonHidden, update its render usage, and change every caller to
use the new prop name while preserving the existing behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a98a0247-1f63-44a4-ab47-8c4e536e4bab
📒 Files selected for processing (4)
apps/studio/components/layouts/ExplorerLayout/ExplorerLayout.tsxapps/studio/components/layouts/Tabs/Tabs.tsxapps/studio/components/layouts/editors/EditorsLayout.hooks.tsapps/studio/state/tabs.tsx
| interface EditorTabsProps { | ||
| customTabs?: ReactNode | ||
| newTabButton?: ReactNode | ||
| hideCollapseButton?: boolean | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Rename the boolean prop.
Rename hideCollapseButton to isCollapseButtonHidden. Update its render use and all callers.
As per coding guidelines: “Use boolean names beginning with is, has, can, or should.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/studio/components/layouts/Tabs/Tabs.tsx` around lines 40 - 44, Rename
the EditorTabsProps boolean prop hideCollapseButton to isCollapseButtonHidden,
update its render usage, and change every caller to use the new prop name while
preserving the existing behavior.
Source: Coding guidelines
| const pathname = usePathname() | ||
| const { ref } = useParams() | ||
|
|
||
| return pathname?.includes(`/project/${ref}/editor`) |
There was a problem hiding this comment.
nitpick: avoid nested ternaries (not blocking)
🎭 Playwright Test Results (tanstack)Details
Flaky testsFeatures › wrappers.spec.ts › Stripe › can create a stripe wrapper with schema Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
Braintrust eval report
|
Context
Continued ground work for Explorer - just initializes the Tab UI for Explorer as such:
Summary by CodeRabbit