Skip to content

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

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

Release Notes

  • Improvements
    • Workspace names are now displayed consistently throughout the app. The default workspace is now clearly labeled as "Default Workspace" in workspace menus and system notifications.

✏️ 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 4 minutes and 58 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 162db36 and cbf3130.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/AppTitleBar/index.js

Walkthrough

Added a getWorkspaceDisplayName() helper function to map workspace names with proper casing, replacing instances of toTitleCase() throughout the AppTitleBar component. This ensures consistent workspace name display in the UI and toast messages.

Changes

Cohort / File(s) Summary
Workspace Display Name Refactor
packages/bruno-app/src/components/AppTitleBar/index.js
Added getWorkspaceDisplayName() helper to normalize workspace names (maps defaultDefault Workspace); replaced all toTitleCase() calls with new helper in workspace rendering, menu labels, and toast messages; consolidated pin/unpin icon conditional into single-line ternary; minor Home button formatting

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • #6457: Modifies workspace-related toast behavior to remove duplicate success messages during rename/close operations.
  • #6424: Adds manage-workspaces menu item and handler in the same AppTitleBar component file.

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

🔤 A helper born to fix the case,
Where workspace names show proper grace,
No more ALL CAPS turned "Abc" sad,
Display names now looking glad! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: introducing a helper to preserve workspace name casing instead of applying toTitleCase transformation.
Linked Issues check ✅ Passed The code changes implement the required fix for issue #6522 by introducing getWorkspaceDisplayName() helper to preserve workspace name casing throughout the UI.
Out of Scope Changes check ✅ Passed All changes are directly related to workspace name display casing. Minor refactoring of pin/unpin icons and ActionIcon formatting are incidental improvements within scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@abhishek-bruno abhishek-bruno force-pushed the bugfix/workspace-name-case-mismatch branch from 162db36 to cbf3130 Compare January 7, 2026 09:53
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.

Miss match alphabet case

2 participants