feat(aurora-portal): implement three-zone DataGrid header for Object Storage (Swift)#915
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:
📝 WalkthroughWalkthroughReplaces ChangesDataGridToolbar bulk-actions refactor for Swift Containers & Objects
Sequence Diagram(s)sequenceDiagram
actor User
participant Zone1 as DataGridToolbar Zone 1
participant Zone2 as DataGridToolbar Zone 2
participant Zone3 as DataGridToolbar Zone 3
participant TableView as ContainerTableView /<br/>ObjectsTableView
participant BulkModal as EmptyContainersModal /<br/>DeleteObjectsModal
User->>Zone2: types search query
Zone2->>Zone2: debounce 500ms
Zone2->>TableView: commit to URL searchParam
User->>TableView: select row checkboxes
TableView->>Zone3: selectedCount > 0 enables Actions toggle
User->>Zone3: open Actions menu
Zone3->>BulkModal: click "Empty Container(s)" /<br/>"Delete Object(s)"
BulkModal-->>Zone3: success → clear selection,<br/>disable Actions, show toast
BulkModal-->>Zone3: error → show error toast
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 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
`@packages/aurora/src/client/routes/_auth/projects/`$projectId/storage/-components/Swift/Containers/index.tsx:
- Around line 65-70: The localSearchTerm state is initialized from searchParam
but never synchronized when searchParam changes after initial render, causing
the search input UI to drift from the actual filter state. At
packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/index.tsx
(lines 65-70), add a useEffect hook with searchParam as a dependency that calls
setLocalSearchTerm(searchParam) whenever the URL search parameter changes. Apply
the identical synchronization effect at
packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/index.tsx
(lines 178-183) to keep both locations in sync.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: fd0eb5b7-0bd2-40fc-9e88-6ebc504861c4
📒 Files selected for processing (15)
packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerTableView.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/EmptyContainersModal.test.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/EmptyContainersModal.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/index.test.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/index.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/DeleteObjectsModal.test.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/DeleteObjectsModal.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/ObjectsTableView.test.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/ObjectsTableView.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/index.test.tsxpackages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/index.tsxpackages/aurora/src/locales/de/messages.popackages/aurora/src/locales/de/messages.tspackages/aurora/src/locales/en/messages.popackages/aurora/src/locales/en/messages.ts
There was a problem hiding this comment.
Pull request overview
This PR updates the Swift Object Storage Containers (and Objects) list views to use the three-zone DataGrid header/toolbar layout (sort + primary actions, debounced search, bulk actions + info), and adjusts selection-column rendering to be gateable via a hasAnyBulkAction flag.
Changes:
- Replaces the legacy combined
ListToolbarwith a three-zone composition for Swift Containers and Swift Objects, including a 500ms debounced search committed to URL search params. - Adds
hasAnyBulkActionsupport to conditionally remove the selection column (header + per-row checkboxes) in bothContainerTableViewandObjectsTableView. - Updates bulk-action UX (Actions popup, singular/plural labeling) and related tests + i18n strings.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/aurora/src/locales/en/messages.ts | Regenerated Lingui message catalog to include new Swift toolbar strings. |
| packages/aurora/src/locales/en/messages.po | Adds new msgids (search placeholders, “Empty Container”), removes unused “Delete All” strings. |
| packages/aurora/src/locales/de/messages.po | German translations for newly added Swift toolbar strings. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/ObjectsTableView.tsx | Adds hasAnyBulkAction gating and adjusts grid column templates/count. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/ObjectsTableView.test.tsx | Tests for selection-column gating behavior. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/index.tsx | Implements three-zone toolbar for objects, debounced search, bulk Actions menu. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/index.test.tsx | Updates tests to drive bulk delete via Actions popup instead of a “Delete All (N)” button. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/DeleteObjectsModal.tsx | Makes modal title singular/plural based on selection count. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/DeleteObjectsModal.test.tsx | Adds coverage for singular vs plural modal titles. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/index.tsx | Implements three-zone toolbar for containers, debounced search, bulk Actions menu + info block. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/index.test.tsx | Updates tests to drive bulk empty via Actions popup instead of “Empty All (N)”. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/EmptyContainersModal.tsx | Makes modal title singular/plural based on selection count. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/EmptyContainersModal.test.tsx | Adds coverage for singular vs plural modal titles. |
| packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerTableView.tsx | Adds hasAnyBulkAction gating and adjusts grid column count/template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2d07b3d
Implements the three-zone toolbar and DataGrid layout for the Object Storage (Swift) container list view, following the pattern from
Images/List.tsx.What changed
Replaces the combined
ListToolbarinSwiftContainerswith the three-zone composition:Stack, no background):SortInputon the left,Create Containeron the right.DataGridToolbar):SearchInputwith the 500ms debounce pattern (localSearchTermstate +useReftimer), committing to the URL via the existing search param so sort/search survive navigation and deep links.DataGridToolbar): a select-all checkbox + anActionspopup whose item isEmpty Container/Empty Containers(singular/plural by selection), alongside the existing container count + remaining-quota + limits info on the right.ContainerTableViewnow takeshasAnyBulkActionand drops the selection column (header select-all + per-row checkboxes, column count 6→5, grid template) when no bulk action is available; header and rows stay aligned in both modes.Deviations from the spec (and why)
FiltersInput/SelectedFiltersin Zone 2. Swift containers expose no filterable dimensions today, so Zone 2 is search-only. A comment marks whereFiltersInput+applyFilterSelectiongo once filter dimensions exist — rather than wiring filtering against fields that don't exist.canDelete || canUpdate). Unlike the Images reference, this bar also hosts the always-needed count/quota info, so the bar renders unconditionally and only the left-hand bulk controls are gated.hasAnyBulkActionis hardcodedtruewith aTODO(perms).SwiftContainershas no permission source yet; this keeps current always-on behavior while putting the gating structure in place.canCreate/canDelete/canUpdatepermission plumbing is deferred to a follow-up.FORBIDDEN → listErrorhandling, since that pairs with the permissions source that doesn't exist here yet.Testing
SwiftContainersandContainerTableViewtests updated for the new flow:Actionspopup (select → enableActions→ open →Empty Container/Empty Containers) instead of a standaloneEmpty All (N)button.hasAnyBulkAction=falserenders no checkboxes while rows still appear; select-all / deselect-all and per-row checkbox setters verified.Notes / follow-ups
hasAnyBulkAction(andcanCreate) to the real permission source when available; introduceFiltersInputif/when containers gain filter dimensions.Checklist
Summary by CodeRabbit