-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: preserve workspace name casing in title bar (#6522) #6523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: preserve workspace name casing in title bar (#6522) #6523
Conversation
WalkthroughAdds an internal helper getWorkspaceDisplayName(name) to AppTitleBar that maps falsy/null/'default' to "Default Workspace" and replaces prior toTitleCase(...) usages for active/workspace labels and toast messages; also normalizes JSX/formatting and consolidates icon conditional rendering. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/AppTitleBar/index.js (1)
80-80: Use helper for consistent workspace name display.The toast message uses the raw workspace name directly, which is inconsistent with the title bar and menu that use
getWorkspaceDisplayName(). If the workspace name is null, undefined, or "default", the toast will display differently than what appears in the UI.🔎 Proposed fix for consistency
- toast.success(`Switched to ${workspaces.find((w) => w.uid === workspaceUid)?.name}`); + toast.success(`Switched to ${getWorkspaceDisplayName(workspaces.find((w) => w.uid === workspaceUid)?.name)}`);
🧹 Nitpick comments (1)
packages/bruno-app/src/components/AppTitleBar/index.js (1)
22-26: Consider case-insensitive comparison for 'default' check.The string comparison
name === 'default'is case-sensitive. If users create workspaces named "Default" or "DEFAULT", they won't be mapped to "Default Workspace". Consider usingname?.toLowerCase() === 'default'if this is unintended.Otherwise, the implementation correctly preserves the original workspace name casing as intended.
🔎 Proposed case-insensitive check
const getWorkspaceDisplayName = (name) => { - if (!name || name === 'default') return 'Default Workspace'; + if (!name || name.toLowerCase() === 'default') return 'Default Workspace'; return name; };
📜 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/SidebarHeader/index.js (1)
activeWorkspace(38-38)packages/bruno-app/src/components/Sidebar/Collections/index.js (1)
activeWorkspace(17-17)packages/bruno-app/src/components/WorkspaceHome/index.js (1)
activeWorkspace(27-27)packages/bruno-app/src/components/Sidebar/SidebarHeader/WorkspaceSelector/index.js (1)
activeWorkspace(19-19)packages/bruno-app/src/components/Sidebar/SidebarHeader/CloseWorkspace/index.js (1)
workspace(11-11)
🔇 Additional comments (2)
packages/bruno-app/src/components/AppTitleBar/index.js (2)
68-68: LGTM!Correct usage of the helper with optional chaining to handle undefined
activeWorkspace.
123-123: LGTM!Correct usage of the helper for consistent workspace name display in the menu.
39275a4 to
ed9c76c
Compare
…fix/workspace-name-case-mismatch
Description
Fixes #6522 - Workspace names with user-defined casing (e.g., "PRODUCTION", "API-DEV") were being displayed with only the first letter uppercase (e.g., "Production", "Api-dev").
Problem
The
toTitleCase()function was being applied to workspace names inAppTitleBar/index.js, which converted user's intended casing to title case.Before (broken):
ABCDEPRODUCTIONapi-devSolution
Replaced
toTitleCase()with a newgetWorkspaceDisplayName()helper function that:'default'workspace to display as'Default Workspace'After (fixed):
ABCDEPRODUCTIONapi-devContribution Checklist:
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.