Bugfix/workspace name case mismatch#6560
Conversation
|
Warning Rate limit exceeded@abhishek-bruno has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 22 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (6)
WalkthroughThis PR replaces the problematic Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 0
🧹 Nitpick comments (2)
packages/bruno-app/src/components/AppTitleBar/index.js (2)
31-36: Well-implemented helper function.The function correctly handles the special "default" case and preserves the original casing for all other workspace names, directly addressing the case mismatch issue described in #6522. The logic is clear and follows all coding guidelines.
Optional: Add JSDoc for clarity
While the inline comment is helpful, a JSDoc would more formally document the function's behavior:
-// Helper to get display name for workspace +/** + * Returns the display name for a workspace + * @param {string} name - The workspace name + * @returns {string} - Display name, with "default" mapped to "Default Workspace" + */ const getWorkspaceDisplayName = (name) => { if (!name) return ''; if (name === 'default') return 'Default Workspace'; return name; };
136-136: Toast message updated correctly.The new helper ensures the toast displays the workspace name with proper casing.
Optional: Add defensive handling for edge cases
If the workspace lookup fails (unlikely in practice), the toast would display "Switched to ". Consider handling this edge case:
const handleWorkspaceSwitch = (workspaceUid) => { dispatch(switchWorkspace(workspaceUid)); - toast.success(`Switched to ${getWorkspaceDisplayName(workspaces.find((w) => w.uid === workspaceUid)?.name)}`); + const workspace = workspaces.find((w) => w.uid === workspaceUid); + const displayName = workspace ? getWorkspaceDisplayName(workspace.name) : 'workspace'; + toast.success(`Switched to ${displayName}`); };
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/AppTitleBar/index.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/AppTitleBar/index.js
🧠 Learnings (1)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/AppTitleBar/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/AppTitleBar/index.js (5)
packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js (1)
activeWorkspace(37-37)packages/bruno-app/src/components/WorkspaceHome/index.js (1)
activeWorkspace(30-30)packages/bruno-app/src/components/Sidebar/Collections/index.js (1)
activeWorkspace(17-17)packages/bruno-app/src/utils/workspaces/index.js (1)
isPinned(51-51)packages/bruno-app/src/ui/ActionIcon/index.js (1)
ActionIcon(22-56)
⏰ 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 - Linux
- GitHub Check: SSL Tests - macOS
- GitHub Check: CLI Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: Unit Tests
🔇 Additional comments (2)
packages/bruno-app/src/components/AppTitleBar/index.js (2)
124-124: Correct usage of the display name helper.The workspace name now preserves its original casing throughout the UI, fixing the reported issue where uppercase workspace names appeared with only the first letter capitalized.
Also applies to: 187-187
199-199: Good simplification of the ternary expression.The single-line conditional is more concise while maintaining readability.
162db36 to
cbf3130
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @packages/bruno-app/src/components/AppTitleBar/index.js:
- Around line 134-137: The success toast in handleWorkspaceSwitch fires
immediately because dispatch(switchWorkspace(workspaceUid)) is not awaited and
the thunk swallows errors; make handleWorkspaceSwitch async, await the dispatch
(use the RTK Query/Toolkit returned promise and .unwrap() if using
createAsyncThunk) and only call toast.success after the awaited dispatch
resolves successfully, and add a try/catch to call toast.error (or handle
failures) when the dispatch rejects; alternatively, modify the switchWorkspace
thunk to rethrow errors so awaiting the dispatch will reject on failure—update
the function name handleWorkspaceSwitch and the dispatch(switchWorkspace(...))
call accordingly.
🧹 Nitpick comments (3)
packages/bruno-app/src/components/WorkspaceHome/index.js (2)
14-15: Avoid cross-component import for a shared helper (move to a util).Importing
getWorkspaceDisplayNamefromcomponents/AppTitleBarcouplesWorkspaceHometo a UI component module; this helper feels like a shared “workspace naming” utility. Consider extracting to something likeutils/workspaces/getWorkspaceDisplayName(or similar) and importing from there in both places.
213-213: Good: preserves casing + clear missing-name styling; consider readability tweaks.This achieves the goal (no title-casing). Optional: this line is pretty dense—consider splitting into
const displayName = …and dropping?.sinceactiveWorkspaceis already guarded above.packages/bruno-app/src/components/AppTitleBar/index.js (1)
23-36: Helper is fine, but consider extracting + handle whitespace-only names.
- Since
getWorkspaceDisplayNameis now used outsideAppTitleBar, it likely belongs in a shared util module (reduces UI-module coupling).- Consider treating whitespace-only as “untitled” too (e.g.,
if (!name || name.trim() === '') …) to avoid rendering a visually blank workspace name.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.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/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.js
🧠 Learnings (2)
📚 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/AppTitleBar/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/WorkspaceHome/index.js (3)
packages/bruno-app/src/ui/ActionIcon/index.js (1)
classNames(37-37)packages/bruno-app/src/components/AppTitleBar/index.js (3)
activeWorkspace(111-111)getWorkspaceDisplayName(33-36)getWorkspaceDisplayName(33-36)packages/bruno-app/src/components/Sidebar/Collections/index.js (1)
activeWorkspace(17-17)
⏰ 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: Unit Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: CLI Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (3)
packages/bruno-app/src/components/AppTitleBar/index.js (3)
121-126: LGTM: workspace name now preserves original casing.The
classNames('workspace-name', { 'italic text-muted': !activeWorkspace?.name })+getWorkspaceDisplayName(activeWorkspace?.name)combination cleanly fixes the casing issue and keeps a sensible fallback.
179-205: Good replacement of labels + simplified pin/unpin icon rendering.Switching menu
labeltogetWorkspaceDisplayName(workspace.name)addresses the dropdown casing bug; pin/unpin ternary is also cleaner.
252-255: No concerns with the Home ActionIcon tweak.
| const handleWorkspaceSwitch = (workspaceUid) => { | ||
| dispatch(switchWorkspace(workspaceUid)); | ||
| toast.success(`Switched to ${workspaces.find((w) => w.uid === workspaceUid)?.name}`); | ||
| toast.success(`Switched to ${getWorkspaceDisplayName(workspaces.find((w) => w.uid === workspaceUid)?.name)}`); | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, locate and examine the file
find . -name "index.js" -path "*/AppTitleBar/*" -type fRepository: usebruno/bruno
Length of output: 114
🏁 Script executed:
# Search for the switchWorkspace action
rg "switchWorkspace" --type js --type ts -A 5 -B 5Repository: usebruno/bruno
Length of output: 10937
🏁 Script executed:
# Check the Redux store structure to understand thunk handling
find . -name "*workspace*" -o -name "*actions*" | grep -E "\.(js|ts)$" | head -20Repository: usebruno/bruno
Length of output: 931
🏁 Script executed:
# Get the full switchWorkspace implementation
cat -n packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js | grep -A 20 "export const switchWorkspace"Repository: usebruno/bruno
Length of output: 855
🏁 Script executed:
# Also check the context in AppTitleBar at lines 130-150
sed -n '130,150p' packages/bruno-app/src/components/AppTitleBar/index.jsRepository: usebruno/bruno
Length of output: 680
🏁 Script executed:
# Get more of the switchWorkspace implementation to see if it can throw errors
sed -n '238,280p' packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.jsRepository: usebruno/bruno
Length of output: 1550
🏁 Script executed:
# Check loadWorkspaceCollectionsForSwitch to see if it can throw
rg "loadWorkspaceCollectionsForSwitch" -A 30 packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.jsRepository: usebruno/bruno
Length of output: 2433
🏁 Script executed:
# Compare with similar pattern in ManageWorkspace to see how it handles the dispatch
sed -n '26,50p' packages/bruno-app/src/components/ManageWorkspace/index.jsRepository: usebruno/bruno
Length of output: 790
Await the dispatch result or handle potential failures before showing success toast.
The switchWorkspace thunk catches errors internally without re-throwing, so the dispatch resolves successfully even if loading workspace collections or global environments fails. The toast displays immediately without waiting for these async operations to complete. Consider either awaiting the dispatch and adding error handling, or ensuring the thunk rejects on failure so the success message only shows on actual success.
🤖 Prompt for AI Agents
In @packages/bruno-app/src/components/AppTitleBar/index.js around lines 134 -
137, The success toast in handleWorkspaceSwitch fires immediately because
dispatch(switchWorkspace(workspaceUid)) is not awaited and the thunk swallows
errors; make handleWorkspaceSwitch async, await the dispatch (use the RTK
Query/Toolkit returned promise and .unwrap() if using createAsyncThunk) and only
call toast.success after the awaited dispatch resolves successfully, and add a
try/catch to call toast.error (or handle failures) when the dispatch rejects;
alternatively, modify the switchWorkspace thunk to rethrow errors so awaiting
the dispatch will reject on failure—update the function name
handleWorkspaceSwitch and the dispatch(switchWorkspace(...)) call accordingly.
23aaff8 to
761304a
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/bruno-app/src/components/WorkspaceHome/index.js (1)
213-213: Minor inconsistency in optional chaining usage.The conditional styling checks
!activeWorkspace?.namewith optional chaining, butgetWorkspaceDisplayName(activeWorkspace.name)uses non-optional access. While safe here (sinceactiveWorkspaceis guaranteed to exist after the early return on line 50), keeping consistency improves readability.Suggested consistency fix
- <span className={classNames('workspace-name', { 'italic text-muted': !activeWorkspace?.name })}>{getWorkspaceDisplayName(activeWorkspace.name)}</span> + <span className={classNames('workspace-name', { 'italic text-muted': !activeWorkspace.name })}>{getWorkspaceDisplayName(activeWorkspace.name)}</span>packages/bruno-app/src/components/AppTitleBar/index.js (2)
32-36: Good centralized helper for workspace display name.This directly addresses the case mismatch issues (#6522, #6751) by preserving the original name casing instead of applying
toTitleCase. The fallback to'Untitled Workspace'handles edge cases cleanly.Consider adding a brief JSDoc for discoverability since this is exported and used across components.
Optional: Add JSDoc
-// Helper to get display name for workspace -export const getWorkspaceDisplayName = (name) => { +/** + * Returns the workspace display name, preserving original casing. + * @param {string|null|undefined} name - The workspace name. + * @returns {string} The display name or 'Untitled Workspace' if falsy. + */ +export const getWorkspaceDisplayName = (name) => { if (!name) return 'Untitled Workspace'; return name; };
136-136: Edge case: toast message when workspace not found.If
workspaces.find()returnsundefined, the toast will show "Switched to Untitled Workspace" which could be misleading. This is unlikely in normal flow since the workspace should exist, but worth noting.Optional: defensive approach
const handleWorkspaceSwitch = (workspaceUid) => { + const workspace = workspaces.find((w) => w.uid === workspaceUid); dispatch(switchWorkspace(workspaceUid)); - toast.success(`Switched to ${getWorkspaceDisplayName(workspaces.find((w) => w.uid === workspaceUid)?.name)}`); + toast.success(`Switched to ${getWorkspaceDisplayName(workspace?.name)}`); };
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.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/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.js
🧠 Learnings (3)
📚 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/AppTitleBar/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.js
📚 Learning: 2026-01-09T18:25:14.640Z
Learnt from: kanakkholwal
Repo: usebruno/bruno PR: 6767
File: packages/bruno-app/src/components/ResponseExample/index.js:221-226
Timestamp: 2026-01-09T18:25:14.640Z
Learning: In the Bruno Electron renderer code (packages/bruno-app), assume window.ipcRenderer is always available and skip existence checks. Do not guard for ipcRenderer in this Electron context; use window.ipcRenderer directly (e.g., window.ipcRenderer.send(...), window.ipcRenderer.on(...)). If there are non-Electron contexts (such as test environments or non-Electron builds), add guards or mocks to avoid runtime errors there, but for the intended Electron renderer files, this pattern should be applied broadly within packages/bruno-app.
Applied to files:
packages/bruno-app/src/components/AppTitleBar/index.jspackages/bruno-app/src/components/WorkspaceHome/index.js
⏰ 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: CLI Tests
- GitHub Check: Unit Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (6)
packages/bruno-app/src/components/WorkspaceHome/index.js (1)
14-15: LGTM on the imports.Clean approach importing
getWorkspaceDisplayNamefrom a centralized location andclassNamesfor conditional styling.packages/bruno-app/src/components/AppTitleBar/index.js (5)
23-23: LGTM on the import.Standard
classNamesimport for conditional styling.
124-124: LGTM on the WorkspaceName display.Correct application of
classNamesfor conditional styling andgetWorkspaceDisplayNameto preserve casing.
187-187: LGTM on menu item labels.Properly uses
getWorkspaceDisplayNameto preserve workspace name casing in the dropdown menu.
199-199: LGTM on the icon consolidation.Clean single-line ternary for pin/unpin icon rendering.
252-254: LGTM on the Home button simplification.Clean JSX formatting.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @packages/bruno-app/src/components/AppTitleBar/index.js:
- Around line 32-36: The frontend helper getWorkspaceDisplayName returns the
fallback string "Untitled Workspace" but the backend in
packages/bruno-electron/src/utils/workspace-config.js uses "Unnamed Workspace",
creating an inconsistent UX; pick one canonical fallback (e.g., "Untitled
Workspace") and update the other side to use the same exact string, ensuring you
change the constant/return value in getWorkspaceDisplayName or the backend
default in workspace-config.js so both match, and adjust any related tests or
localization keys to use the chosen fallback.
🧹 Nitpick comments (1)
tests/workspace/default-workspace/default-workspace.spec.ts (1)
31-31: Consistent use of exact text assertions.All persistence and recovery tests now use the same pattern. Consider adding a test case for the
'Untitled Workspace'fallback when a workspace has no name, to cover the newgetWorkspaceDisplayName()edge case.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.gitignorepackages/bruno-app/src/components/AppTitleBar/index.jstests/workspace/default-workspace/default-workspace.spec.ts
🧰 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:
packages/bruno-app/src/components/AppTitleBar/index.jstests/workspace/default-workspace/default-workspace.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/workspace/default-workspace/default-workspace.spec.ts
🧠 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/AppTitleBar/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/AppTitleBar/index.js
📚 Learning: 2026-01-09T18:25:14.640Z
Learnt from: kanakkholwal
Repo: usebruno/bruno PR: 6767
File: packages/bruno-app/src/components/ResponseExample/index.js:221-226
Timestamp: 2026-01-09T18:25:14.640Z
Learning: In the Bruno Electron renderer code (packages/bruno-app), assume window.ipcRenderer is always available and skip existence checks. Do not guard for ipcRenderer in this Electron context; use window.ipcRenderer directly (e.g., window.ipcRenderer.send(...), window.ipcRenderer.on(...)). If there are non-Electron contexts (such as test environments or non-Electron builds), add guards or mocks to avoid runtime errors there, but for the intended Electron renderer files, this pattern should be applied broadly within packages/bruno-app.
Applied to files:
packages/bruno-app/src/components/AppTitleBar/index.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 **/*.test.{js,jsx,ts,tsx} : Add tests for any new functionality or meaningful changes. If code is added, removed, or significantly modified, corresponding tests should be updated or created
Applied to files:
tests/workspace/default-workspace/default-workspace.spec.ts
🧬 Code graph analysis (1)
tests/workspace/default-workspace/default-workspace.spec.ts (1)
packages/bruno-electron/src/utils/workspace-config.js (1)
workspaceName(220-220)
⏰ 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: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
🔇 Additional comments (7)
.gitignore (1)
51-51: LGTM!Adding
.cursoralongside other editor-specific ignores (.idea,.vscode) is consistent and appropriate.tests/workspace/default-workspace/default-workspace.spec.ts (1)
15-16: Good improvement: Test ID selector with exact text matching.Using
getByTestId('workspace-name')instead of CSS selectors is more resilient to styling changes. The switch totoHaveText()for exact matching aligns well with the PR objective of preserving workspace name casing.packages/bruno-app/src/components/AppTitleBar/index.js (5)
121-128: WorkspaceName updated correctly with test ID and conditional styling.The
data-testid="workspace-name"enables stable test selectors, and the conditionalitalic text-mutedclass provides appropriate visual feedback when the name is absent.
134-137: Consistent display name usage in toast notification.Good. The switch message now correctly preserves workspace name casing.
185-188: Menu items correctly use display name helper.Workspace names in the dropdown will now preserve their original casing as intended.
199-199: Simplified icon ternary.Clean single-line conditional rendering.
252-254: Minor JSX consolidation.No functional change; formatting cleanup.
0a5277f to
d4bc141
Compare
* fix: preserve workspace name casing in title bar (usebruno#6522) * fix: improve workspace display name handling in title bar --------- Co-authored-by: Uzairkazi695 <kaziuzair695@gmail.com>
Description
Preserve workspace name casing in title bar.
Based on #6523
Closes #6522
Closes #6751
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
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.