fix:Draft icon indicator on Workspace Environment tab - #8342
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
ChangesDraft-aware close button flow
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
Suggested reviewers: Poem
ðĨ Pre-merge checks | â 5â Passed checks (5 passed)
âĻ Finishing Touchesð§Š Generate unit tests (beta)
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: 2
ðĪ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/bruno-app/src/components/RequestTabs/RequestTab/index.js`:
- Line 204: The draft-state indicator logic on line 204 has been expanded to
include both 'global-environment-settings' and 'workspaceEnvironments' tab types
in the hasGlobalEnvironmentDraft check, but the keyboard shortcut handlers for
closeTab and save (referenced at line 481 and elsewhere) still only check for
the 'global-environment-settings' tab type. Update all the conditional checks in
the closeTab and save keybinding branches that currently check tab.type ===
'global-environment-settings' to also include tab.type ===
'workspaceEnvironments' to ensure keyboard shortcuts and save behavior work
consistently for both tab types.
In `@packages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.js`:
- Around line 125-127: The DraftTabIcon component rendered in the conditional
branch (when handleCloseClick is falsy and hasDraft is true) is missing a
data-testid attribute required for Playwright E2E testing. Add a data-testid
attribute to the DraftTabIcon element in the else branch to provide a stable
selector for test assertions, following the pattern used in the component
guidelines.
ðŠ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
âđïļ Review info
âïļ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 45a669e1-fae1-4b2f-a5f2-99f02e819e2c
ð Files selected for processing (2)
packages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.jspackages/bruno-app/src/components/RequestTabs/RequestTab/index.js
0cbff20 to
b49cdcc
Compare
b49cdcc to
729bdce
Compare
There was a problem hiding this comment.
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/RequestTabs/RequestTab/GradientCloseButton/StyledWrapper.js (1)
43-67: ð Maintainability & Code Quality | ðĄ Minor | ⥠Quick winNon-closeable containers still show a pointer cursor.
.close-icon-containersetscursor: pointerunconditionally (Line 50), and the new.no-closeoverride (Lines 62-67) only neutralizes the hover background, not the cursor. Sinceno-closecontainers haveonClick={undefined}(perindex.js), they aren't actually clickable, so the pointer cursor is a misleading affordance.ðąïļ Proposed fix
&.no-close .close-icon-container { + cursor: default; + &:hover { background-color: transparent; } }ðĪ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/StyledWrapper.js` around lines 43 - 67, The .close-icon-container in StyledWrapper.js always applies cursor: pointer, which makes the no-close variant look clickable even when it isnât. Update the no-close styling under the &.no-close .close-icon-container selector so it also overrides the cursor to a non-pointer value, matching the behavior of the no-close prop and the undefined onClick in the related RequestTab component.
ð§đ Nitpick comments (1)
packages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/index.js (1)
6-23: ð Maintainability & Code Quality | ðĩ Trivial | ðĪ Low valueSolid derivation of closeability; one naming nit on test IDs.
Logic checks out â
canClosecorrectly gates the click handler, testid, and close icon rendering, and the draft icon (line 16) always stays mounted sono-closetabs can still show it. One small inconsistency: the outer container's testid alternates betweenrequest-tab-close-icon/request-tab-draft-icon(Line 14) while the inner span has a separate, always-presenttab-draft-icontestid (Line 16). Two differently-named "draft" test IDs on nested elements could confuse whoever writes Playwright selectors later.ðĪ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/index.js` around lines 6 - 23, The closeability logic in GradientCloseButton is fine, but the nested test IDs are inconsistent: the outer close-icon-container switches between request-tab-close-icon and request-tab-draft-icon while the always-mounted draft span uses tab-draft-icon. Update the testid naming in GradientCloseButton so the draft-related selectors follow one clear convention and avoid overlapping names between the container and the DraftTabIcon wrapper.
ðĪ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@packages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/StyledWrapper.js`:
- Around line 43-67: The .close-icon-container in StyledWrapper.js always
applies cursor: pointer, which makes the no-close variant look clickable even
when it isnât. Update the no-close styling under the &.no-close
.close-icon-container selector so it also overrides the cursor to a non-pointer
value, matching the behavior of the no-close prop and the undefined onClick in
the related RequestTab component.
---
Nitpick comments:
In
`@packages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/index.js`:
- Around line 6-23: The closeability logic in GradientCloseButton is fine, but
the nested test IDs are inconsistent: the outer close-icon-container switches
between request-tab-close-icon and request-tab-draft-icon while the
always-mounted draft span uses tab-draft-icon. Update the testid naming in
GradientCloseButton so the draft-related selectors follow one clear convention
and avoid overlapping names between the container and the DraftTabIcon wrapper.
âđïļ Review info
âïļ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 409aaf8b-75b9-46c5-9061-0b3d5209f1b5
ð Files selected for processing (3)
packages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/StyledWrapper.jspackages/bruno-app/src/components/RequestTabs/RequestTab/GradientCloseButton/index.jspackages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.js
Description
JIRA:https://usebruno.atlassian.net/browse/BRU-3033
Fixed the draft indicator not showing on the workspace environment tab. The tab shares the same Redux draft state as global-environment-settings but was missing from the type check, never received the hasDraft prop, and SpecialTab had no way to render the dot without a close button.
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
Release Notes
New Features
UI Changes
Keyboard Shortcuts