Repository navigation
fix(workspace): showing only the remove option for the failed collection in workspace overview - #8932
Conversation
…ion in workspace overview
WalkthroughFailed collections now show only ChangesCollection menu actions
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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: 1
🤖 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 `@tests/workspace/unopenable-collections/unopenable-collections.spec.ts`:
- Around line 19-24: Move collectionCardMenu and collectionCardMenuItems out of
the spec into the appropriate page module under tests/utils/page, expose the
corresponding locators through buildCommonLocators, and update the spec to
obtain and use them from that builder instead of defining raw selectors locally.
🪄 Autofix
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 Plus
Run ID: b714d4cb-77c2-45d5-a740-f25770179e88
📒 Files selected for processing (2)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.jstests/workspace/unopenable-collections/unopenable-collections.spec.ts
6419201 to
3e3f6b3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/workspace/unopenable-collections/unopenable-collections.spec.ts (1)
170-188: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAssert that each opened menu is visible.
toHaveTextdoes not assert visibility. After each menu click, assert that the first menu item is visible before checking its text.🤖 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 `@tests/workspace/unopenable-collections/unopenable-collections.spec.ts` around lines 170 - 188, Update both menu assertions in the test step to verify the opened menu’s first item is visible immediately after clicking each collection card menu, then retain the existing toHaveText checks for the expected menu contents. Use collectionCardMenuItems(MISSING_COLL) and collectionCardMenuItems(HEALTHY_COLL) as the targets.Sources: Path instructions, MCP tools
🧹 Nitpick comments (1)
tests/workspace/unopenable-collections/unopenable-collections.spec.ts (1)
40-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse local locator variables in the spec.
Several steps construct the same
Locatormore than once. Assign reused cards and menu-item collections to local variables before assertions and actions. This keeps the Arrange, Act, and Assert flow clear.Cache reused locators
for (const name of [MISSING_COLL, EMPTY_COLL]) { - await expect(workspaceOverview.collectionCard(name)).toBeVisible(); - await expect(workspaceOverview.collectionCard(name).getByText('Failed to open')).toBeVisible(); + const card = workspaceOverview.collectionCard(name); + await expect(card).toBeVisible(); + await expect(card.getByText('Failed to open')).toBeVisible(); }As per path instructions, “Use locator variables for locators.”
Also applies to: 69-78, 132-143, 170-188
🤖 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 `@tests/workspace/unopenable-collections/unopenable-collections.spec.ts` around lines 40 - 47, Update the test steps in the affected ranges to cache repeated card and menu-item locators in local variables before using them. Reuse those variables for all subsequent assertions and actions, including the cards referenced in the healthy/git-backed step and the locators in the other specified steps, while preserving the existing test behavior.Source: Path instructions
🤖 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 `@tests/utils/page/workspace/workspace-overview.ts`:
- Around line 4-5: Update the collectionCard locator to match the exact
collection name rather than using the case-insensitive substring filter; use an
exact text/name locator or an available stable test ID while preserving the
existing collection-card scope.
---
Outside diff comments:
In `@tests/workspace/unopenable-collections/unopenable-collections.spec.ts`:
- Around line 170-188: Update both menu assertions in the test step to verify
the opened menu’s first item is visible immediately after clicking each
collection card menu, then retain the existing toHaveText checks for the
expected menu contents. Use collectionCardMenuItems(MISSING_COLL) and
collectionCardMenuItems(HEALTHY_COLL) as the targets.
---
Nitpick comments:
In `@tests/workspace/unopenable-collections/unopenable-collections.spec.ts`:
- Around line 40-47: Update the test steps in the affected ranges to cache
repeated card and menu-item locators in local variables before using them. Reuse
those variables for all subsequent assertions and actions, including the cards
referenced in the healthy/git-backed step and the locators in the other
specified steps, while preserving the existing test behavior.
🪄 Autofix
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 Plus
Run ID: 272dd4ae-1edc-47bf-9b88-f2dfe3a7f0b5
📒 Files selected for processing (3)
tests/utils/page/locators.tstests/utils/page/workspace/workspace-overview.tstests/workspace/unopenable-collections/unopenable-collections.spec.ts
Description
BRU-4246
For collections that fail to open, the workspace overview currently shows all context-menu options. However, most of these actions are not supported for failed collections and will fail when selected. The Remove option is the only action that works correctly.
Problem
When a collection cannot be opened, users can still see actions such as Rename, Share, Delete, and other options in the context menu. These actions do not work for failed collections, which can be confusing and prevent users from properly managing invalid collections.
Fix
For collections that failed to open, only showing the Remove option in the dropdown.
Screenshots
Before
After
Contribution Checklist:
Summary by CodeRabbit