Repository navigation
redesign: workspace overview - #6361
Conversation
WalkthroughThis PR reorganizes WorkspaceHome: it removes WorkspaceCollections, adds WorkspaceOverview and CollectionsList, refactors WorkspaceDocs and multiple styled wrappers, and consolidates the UI into two tabs (Overview, Environments) with a revised header and tab/content flow. (50 words) Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant UI as CollectionsList UI
participant Store as Redux Store
participant IPC as Main/IPC
participant Modal as Confirmation Modal
User->>UI: Click "Open" on a collection
UI->>Store: dispatch(mountCollection(collectionUid))
Store-->>UI: mount result (success / error)
alt success
UI->>Store: dispatch(hideHomePage())
UI->>Store: dispatch(addTab(collectionTab))
UI->>IPC: (optional) ensure files / clone repo
IPC-->>Store: filesystem/clone events
UI-->>User: collection tab opened
else error
UI-->>User: show toast error
end
Note over UI,Modal: Removal flow
User->>UI: Click "Remove"
UI->>Modal: open confirmation
Modal->>UI: user confirms
UI->>Store: dispatch(removeCollectionFromWorkspace(...))
Store-->>UI: success/error → show toast
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (5)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.js (1)
79-81: Hex alpha concatenation assumes a hex color format.The
${(props) => props.theme.workspace.accent}14pattern appends14(8% opacity in hex) directly to the theme color. This works only ifworkspace.accentis a 6-digit hex value. If it's an RGB, HSL, or named color, this will produce invalid CSS.Consider using a utility function or
rgba()withcolor-mix()for safer opacity handling.packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js (1)
140-142: Same hex alpha concatenation pattern.Same concern as the other StyledWrapper—appending
14assumes a hex color. Consider centralizing this pattern in a theme utility if used frequently.packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.js (1)
44-46: Semantically unusual token for border color.Using
sidebar.collection.item.hoverBgforborder-bottomis atypical. If intentional for visual consistency, consider adding a comment. Otherwise, a dedicated border token might be clearer.packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js (2)
203-211: Tailwind color classes in modal content.Per coding guidelines from learnings, colors should come from styled-components theme tokens, not Tailwind classes. The
text-gray-600,dark:text-gray-300, etc. classes here should ideally use theme-driven styling for consistency.Consider wrapping the modal content in a styled component or using inline theme-based styles:
- <p className="text-gray-600 dark:text-gray-300"> + <p style={{ color: 'inherit' }}> Are you sure you want to {isDelete ? 'delete' : 'remove'}{' '} <strong>"{collectionToRemove.name}"</strong>? </p> - <p className="text-sm text-gray-500 dark:text-gray-400 mt-3"> + <p className="text-sm mt-3" style={{ opacity: 0.7 }}>Or extend StyledWrapper with
.modal-textclasses using theme tokens.
250-252: Key fallback to index.Using
collection.uid || indexas a key is acceptable here since unloaded collections have synthetic UIDs. However, if the list can be reordered, the index fallback could cause rendering issues.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
packages/bruno-app/src/components/WorkspaceHome/StyledWrapper.js(3 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceCollections/StyledWrapper.js(0 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceCollections/index.js(0 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/index.js(2 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js(1 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js(1 hunks)packages/bruno-app/src/components/WorkspaceHome/index.js(5 hunks)
💤 Files with no reviewable changes (2)
- packages/bruno-app/src/components/WorkspaceHome/WorkspaceCollections/index.js
- packages/bruno-app/src/components/WorkspaceHome/WorkspaceCollections/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.jspackages/bruno-app/src/components/WorkspaceHome/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/index.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/index.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js
🧠 Learnings (4)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles
Applied to files:
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors
Applied to files:
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component
Applied to files:
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/StyledWrapper.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Add in JSDoc comments to add more details to the abstractions if needed
Applied to files:
packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/index.js
🧬 Code graph analysis (3)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js (9)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/index.js (1)
dispatch(14-14)packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js (2)
dispatch(14-14)useSelector(15-15)packages/bruno-app/src/utils/common/path.js (1)
normalizePath(166-169)packages/bruno-app/src/components/Modal/index.js (1)
Modal(60-163)packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js (1)
StyledWrapper(3-144)packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.js (1)
StyledWrapper(3-121)packages/bruno-app/src/components/Sidebar/Collections/Collection/RenameCollection/index.js (1)
RenameCollection(10-69)packages/bruno-app/src/components/ShareCollection/index.js (1)
ShareCollection(13-118)packages/bruno-app/src/components/Dropdown/index.js (1)
Dropdown(5-25)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js (4)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js (3)
dispatch(17-17)useSelector(18-18)CollectionsList(16-312)packages/bruno-app/src/components/WorkspaceHome/index.js (2)
dispatch(14-14)useSelector(15-15)packages/bruno-app/src/components/Sidebar/CreateCollection/index.js (1)
CreateCollection(22-341)packages/bruno-app/src/components/Sidebar/ImportCollection/index.js (1)
ImportCollection(36-170)
packages/bruno-app/src/components/WorkspaceHome/index.js (3)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js (3)
dispatch(14-14)useSelector(15-15)WorkspaceOverview(13-120)packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/index.js (1)
WorkspaceEnvironments(25-69)packages/bruno-app/src/components/WorkspaceHome/StyledWrapper.js (1)
StyledWrapper(3-142)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: Unit Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
🔇 Additional comments (19)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/StyledWrapper.js (1)
1-92: LGTM overall.The styled wrapper correctly uses theme tokens for colors, follows the flex-based layout convention, and adheres to coding guidelines (single quotes, semicolons, no trailing commas). Based on learnings, styled-components are appropriately used for theming while layout remains CSS-driven.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/StyledWrapper.js (1)
3-144: LGTM.Clean restructuring of the docs styling. Theme tokens are used correctly for colors, and the new class hooks align well with the updated WorkspaceDocs component structure.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceDocs/index.js (2)
54-58: Simple and clean helpers.
handleAddDocumentationandhasDocsare straightforward and readable. Good separation of concerns.
60-121: Well-structured conditional rendering.The three-way conditional (editing → has docs → empty state) is clear and handles all UI states properly. The empty state with suggestions is a nice UX touch.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/StyledWrapper.js (1)
1-123: LGTM.The styling is well-organized with appropriate theme tokens for colors and proper class hooks for all UI elements (cards, dropdowns, empty state). Follows the styled-components conventions from learnings.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js (4)
165-185: Async dispatch pattern looks correct.The
await dispatch(...)pattern with try/catch is appropriate for thunk actions. Error handling provides user feedback via toast.
26-67: Well-structureduseMemofor collection merging.The logic to merge workspace collections with loaded collection state is clear. The synthetic UID pattern (
unloaded-${wc.path}) for unloaded collections is a reasonable approach.
1-314: Solid implementation overall.The component handles collection states (loaded/unloaded, internal/external, git-backed) comprehensively. The dropdown pattern with refs for programmatic hide is well done. Modal flows for rename/share/remove are cleanly separated.
112-118: VerifymountCollectionhandles emptybrunoConfig.For unloaded collections (line 54),
brunoConfigis an empty object{}. EnsuremountCollectionaction handles this gracefully, as it may expect specific config properties.packages/bruno-app/src/components/WorkspaceHome/index.js (4)
1-11: LGTM!The import refactoring correctly reflects the new two-tab architecture, with collection/import modal management delegated to WorkspaceOverview.
133-147: LGTM!The simplified two-tab structure with the renderTabContent switch is clean and maintainable.
68-75: LGTM!The simplified error handling for folder opening is appropriate and provides clear user feedback.
149-246: LGTM!The refactored UI structure correctly uses Tailwind for layout and Styled Components for theming. The workspace rename flow and dropdown actions are well-integrated.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js (5)
1-11: LGTM!Import statements are clean and follow coding guidelines.
13-32: LGTM!The component setup and memoized environments count calculation is well-optimized with appropriate dependencies and safe optional chaining.
45-50: LGTM!The openCollection handler has appropriate error handling with both logging and user feedback.
64-120: LGTM!The component structure is well-organized with clear separation between stats, quick actions, collections list, and documentation. The conditional modal rendering and button actions are properly wired.
56-62: Verify the undefined parameter and UX flow before implementing changes.Two observations that require manual verification:
The third parameter passed to
importCollectionInWorkspaceisundefined. Confirm this is intentional and understand what this parameter represents in the function signature.The modal closes immediately (line 57) before the import completes. Evaluate whether keeping the modal open with a loading state until the operation completes would improve UX, or if closing the modal immediately is by design.
Consider the suggested UX improvement only if the third parameter is confirmed as intentional and if the team agrees that the modal should remain open during the import operation:
-const handleImportCollectionSubmit = ({ rawData, type }) => { - setImportCollectionModalOpen(false); - dispatch(importCollectionInWorkspace(rawData, workspace.uid, undefined, type)).catch((err) => { +const handleImportCollectionSubmit = ({ rawData, type }) => { + dispatch(importCollectionInWorkspace(rawData, workspace.uid, undefined, type)) + .then(() => { + setImportCollectionModalOpen(false); + }) + .catch((err) => { console.error(err); toast.error('An error occurred while importing the collection'); }); };packages/bruno-app/src/components/WorkspaceHome/StyledWrapper.js (1)
4-141: LGTM!The styled-components refactor correctly uses theme props for all colors, maintains proper separation between layout and theming, and follows the learnings about not using Tailwind for colors within styled components. The refinements to spacing, transitions, and tab styling support the new two-tab layout effectively.
Based on learnings, the styling correctly uses theme props for colors and avoids CSS variables within styled components.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/devtools/performance/performance-tab.spec.ts (1)
123-125: Console tab assertion is correct; consider a locator const for consistencyThe new check against
.console-emptyis a good, explicit assertion that the Console tab’s content is shown after switching away from Performance. To align with the “use locator variables” guideline and the rest of the file’s style, consider extracting this into a locator:- // Verify Console tab content is shown - await expect(page.locator('.console-empty')).toBeVisible(); + // Verify Console tab content is shown + const consoleEmpty = page.locator('.console-empty'); + await expect(consoleEmpty).toBeVisible();
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/devtools/performance/performance-tab.spec.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/devtools/performance/performance-tab.spec.ts
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/devtools/performance/performance-tab.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
* redesign: workspace overview * fixes * fix: test
Description
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
New Features
Refactor
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.