Skip to content

Bugfix/workspace name case mismatch#6560

Merged
bijin-bruno merged 2 commits intousebruno:mainfrom
abhishek-bruno:bugfix/workspace-name-case-mismatch
Jan 12, 2026
Merged

Bugfix/workspace name case mismatch#6560
bijin-bruno merged 2 commits intousebruno:mainfrom
abhishek-bruno:bugfix/workspace-name-case-mismatch

Conversation

@abhishek-bruno
Copy link
Member

@abhishek-bruno abhishek-bruno commented Dec 30, 2025

Description

Preserve workspace name casing in title bar.
Based on #6523

Closes #6522
Closes #6751

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

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

    • Enhanced workspace display consistency: untitled workspaces now display as "Untitled Workspace" throughout the interface, with improved styling for workspaces without explicit names.
  • Tests

    • Strengthened test reliability: workspace name verification now uses test IDs instead of CSS selectors, with stricter exact-match assertions across workspace-related test suites.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 0a5277f and d4bc141.

📒 Files selected for processing (6)
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-app/src/components/WorkspaceHome/index.js
  • packages/bruno-electron/src/utils/workspace-config.js
  • tests/workspace/default-workspace/default-workspace.spec.ts
  • tests/workspace/default-workspace/migration.spec.ts
  • tests/workspace/default-workspace/recovery-and-backup.spec.ts

Walkthrough

This PR replaces the problematic toTitleCase() transformation of workspace names with a new getWorkspaceDisplayName() helper that preserves original capitalization and returns 'Untitled Workspace' for empty names. Tests are updated to use test IDs instead of CSS selectors.

Changes

Cohort / File(s) Summary
Workspace Display Helper
packages/bruno-app/src/components/AppTitleBar/index.js
Added getWorkspaceDisplayName() helper function that returns 'Untitled Workspace' for falsy names, otherwise returns the name as-is. Replaced all toTitleCase() calls with this helper across workspace menu items and toast notifications.
Workspace Name Rendering
packages/bruno-app/src/components/WorkspaceHome/index.js
Imported and applied getWorkspaceDisplayName() helper. Added conditional styling (italic + text-muted) for untitled workspaces via new test ID.
Default Workspace Name
packages/bruno-electron/src/utils/workspace-config.js
Updated default workspace name from "Unnamed Workspace" to "Untitled Workspace" in generated YAML content.
Test Selector Updates
tests/workspace/default-workspace/*.spec.ts
Replaced CSS selector .workspace-name lookups with getByTestId('workspace-name') and updated assertions from toContainText() to toHaveText() for stricter text matching across all workspace tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno

Poem

🎨 No more title case in sight,
Preserve the names in their true light,
CamelCase and CAPS now stand tall,
Untitled awaits those with no name at all! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main change: fixing a workspace name case mismatch issue where names were being incorrectly transformed (e.g., uppercase to title case).
Linked Issues check ✅ Passed The PR directly addresses both linked issues (#6522 and #6751) by removing the toTitleCase transformation and preserving original workspace name casing throughout the UI.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the workspace name casing issue: UI updates remove case transformation, test updates reflect the selector/assertion changes, and the default name fallback is updated consistently.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6f2f2 and 162db36.

📒 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() not func ()
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.

bijin-bruno
bijin-bruno previously approved these changes Jan 9, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getWorkspaceDisplayName from components/AppTitleBar couples WorkspaceHome to a UI component module; this helper feels like a shared “workspace naming” utility. Consider extracting to something like utils/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 ?. since activeWorkspace is 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 getWorkspaceDisplayName is now used outside AppTitleBar, 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

📥 Commits

Reviewing files that changed from the base of the PR and between baac284 and 23aaff8.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/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() not func ()
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
  • packages/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.js
  • packages/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 label to getWorkspaceDisplayName(workspace.name) addresses the dropdown casing bug; pin/unpin ternary is also cleaner.


252-255: No concerns with the Home ActionIcon tweak.

Comment on lines 134 to 137
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)}`);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, locate and examine the file
find . -name "index.js" -path "*/AppTitleBar/*" -type f

Repository: usebruno/bruno

Length of output: 114


🏁 Script executed:

# Search for the switchWorkspace action
rg "switchWorkspace" --type js --type ts -A 5 -B 5

Repository: 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 -20

Repository: 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.js

Repository: 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.js

Repository: 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.js

Repository: 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.js

Repository: 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.

@abhishek-bruno abhishek-bruno force-pushed the bugfix/workspace-name-case-mismatch branch from 23aaff8 to 761304a Compare January 12, 2026 06:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?.name with optional chaining, but getWorkspaceDisplayName(activeWorkspace.name) uses non-optional access. While safe here (since activeWorkspace is 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() returns undefined, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 23aaff8 and 761304a.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/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() not func ()
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
  • packages/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.js
  • packages/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.js
  • packages/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 getWorkspaceDisplayName from a centralized location and classNames for conditional styling.

packages/bruno-app/src/components/AppTitleBar/index.js (5)

23-23: LGTM on the import.

Standard classNames import for conditional styling.


124-124: LGTM on the WorkspaceName display.

Correct application of classNames for conditional styling and getWorkspaceDisplayName to preserve casing.


187-187: LGTM on menu item labels.

Properly uses getWorkspaceDisplayName to 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 new getWorkspaceDisplayName() edge case.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 761304a and e529db4.

📒 Files selected for processing (3)
  • .gitignore
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • tests/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() not func ()
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
  • tests/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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 .cursor alongside 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 to toHaveText() 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 conditional italic text-muted class 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.

@abhishek-bruno abhishek-bruno force-pushed the bugfix/workspace-name-case-mismatch branch from 0a5277f to d4bc141 Compare January 12, 2026 12:23
@bijin-bruno bijin-bruno merged commit 59ff9bd into usebruno:main Jan 12, 2026
8 checks passed
FraCata00 pushed a commit to FraCata00/bruno that referenced this pull request Feb 9, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

camelCaseWorkspace becomes Camelcaseworkspace in header dropdown Miss match alphabet case

3 participants