feat: adding checkboxes in lists#479
Conversation
… feature/adding-checkboxes-in-lists
… feature/adding-checkboxes-in-lists
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughAdds controlled row-selection and bulk-action support to DataView/DataList, propagates three invoice-list CMS fields (enableRowSelection, bulkActionsLabel, downloadAllButtonLabel) through models and mappers, and implements locale-aware invoice bulk-download and selection state in invoice-list frontend. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant CMS
participant InvoiceList as InvoiceList.client
participant DataView
participant DataList
participant PDF as PDF endpoint
Note over CMS,InvoiceList: CMS supplies enableRowSelection, bulkActionsLabel, downloadAllButtonLabel
User->>InvoiceList: open invoice list
InvoiceList->>DataView: pass data + enableRowSelection, selectedRows, onSelectionChange, bulkActionsLabel, bulkActions, getRowKey
DataView->>DataList: forward selection props and current page data
User->>DataList: click row checkbox / header checkbox
DataList->>InvoiceList: onSelectionChange(selectedKeys)
InvoiceList->>InvoiceList: update selectedRows
alt User triggers bulk download
loop for each selected invoice
InvoiceList->>PDF: fetch invoice PDF (locale-aware)
PDF-->>InvoiceList: PDF blob or error
InvoiceList->>User: trigger download or surface per-item error
Note right of InvoiceList: short delay between downloads
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas to review closely:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/integrations/strapi-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts (1)
34-36: Pre-existing bug:yesterdayis incorrectly mapped totoday.Line 35 sets
yesterday: configurableTexts?.dates.today— this appears to be a copy-paste error. It should likely referenceconfigurableTexts?.dates.yesterday.labels: { today: configurableTexts?.dates.today, - yesterday: configurableTexts?.dates.today, + yesterday: configurableTexts?.dates.yesterday, clickToSelect: configurableTexts.actions.clickToSelect, },packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx (1)
53-69: Missing selection reset when filters change.Unlike
handleResetand theProductListcomponent,handleFilterdoes not clearselectedRows. This can leave stale selections referencing items no longer in the current data set.const handleFilter = (data: Partial<Request.GetInvoiceListBlockQuery>) => { startTransition(async () => { try { const newFilters = { ...filters, ...data }; const newData = await sdk.blocks.getInvoiceList(newFilters, { 'x-locale': locale }, accessToken); setFilters(newFilters); setData(newData); + setSelectedRows(new Set()); } catch (_error) { toast({ variant: 'destructive', title: labels.errors.requestError.title, description: labels.errors.requestError.content, }); } }); };
🧹 Nitpick comments (4)
packages/blocks/invoice-list/src/api-harmonization/invoice-list.mapper.ts (1)
32-34: New invoice list config fields mapped cleanly from CMSForwarding
enableRowSelection,bulkActionsLabel, anddownloadAllButtonLabelfromcmsintoInvoiceListBlockkeeps the mapper in sync with the CMS and UI expectations. One minor refinement you could consider:- enableRowSelection: cms.enableRowSelection, + enableRowSelection: cms.enableRowSelection ?? false,if you want a guaranteed boolean for downstream consumers instead of
undefined. Not required if the UI already treatsundefinedas “off”.packages/blocks/ticket-list/src/frontend/TicketList.client.tsx (1)
52-52: Row selection state integration is correct; minor optimization to considerThe row-selection wiring is implemented properly:
selectedRowsis reset on data-changing operations (handleFilter,handleReset), preventing stale selections across pages/filters.getRowKey={(item) => item.id}matches theSet<string | number>element type, so keys are stable.- DataList correctly creates new
Setinstances in bothhandleSelectAllandhandleRowSelecthandlers, ensuring React state updates remain reliable.One optional refinement:
Use lazy initialization for the Set to avoid allocating a new
Set()on every render:- const [selectedRows, setSelectedRows] = useState<Set<string | number>>(new Set()); + const [selectedRows, setSelectedRows] = useState<Set<string | number>>( + () => new Set(), + );Also applies to: 63-63, 80-80, 220-223
packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx (1)
102-127: Consider user feedback for partial bulk download failures.The inner
catchblock logs errors to the console but provides no user feedback when individual downloads fail. Additionally, the outertry-catch(lines 119-125) is unreachable since all errors are caught inside the loop.Consider accumulating failed IDs and showing a single toast after the loop:
const handleBulkDownload = async (selectedInvoiceIds: string[]) => { if (selectedInvoiceIds.length === 0) return; startTransition(async () => { - try { - for (const invoiceId of selectedInvoiceIds) { - try { - const response = await sdk.blocks.getInvoicePdf(invoiceId, { 'x-locale': locale }, accessToken); - Utils.DownloadFile.downloadFile( - response, - data.downloadFileName?.replace('{id}', invoiceId) || `invoice-${invoiceId}.pdf`, - ); - await new Promise((resolve) => setTimeout(resolve, 100)); - } catch (error) { - console.error(`Failed to download invoice ${invoiceId}:`, error); - } + const failedIds: string[] = []; + for (const invoiceId of selectedInvoiceIds) { + try { + const response = await sdk.blocks.getInvoicePdf(invoiceId, { 'x-locale': locale }, accessToken); + Utils.DownloadFile.downloadFile( + response, + data.downloadFileName?.replace('{id}', invoiceId) || `invoice-${invoiceId}.pdf`, + ); + await new Promise((resolve) => setTimeout(resolve, 100)); + } catch (error) { + failedIds.push(invoiceId); } - } catch (_error) { + } + if (failedIds.length > 0) { toast({ variant: 'destructive', title: labels.errors.requestError.title, - description: labels.errors.requestError.content, + description: `Failed to download ${failedIds.length} invoice(s).`, }); } }); };packages/ui/src/components/DataList/DataList.stories.tsx (1)
218-291: AlignselectedItemskeying with DataList row keys
selectedItemsis filtered withselectedRows.has(ticket.id || index), whileDataList’s default key for these rows is effectivelyString(ticket.id). Ifidwere ever falsy or non-primitive, this fallback toindexwould drift from the actual selection keys.Consider simplifying to rely solely on the same key shape used by
DataList, e.g.:- const selectedItems = sampleTickets.filter((ticket, index) => selectedRows.has(ticket.id || index)); + const selectedItems = sampleTickets.filter((ticket) => selectedRows.has(ticket.id));This keeps the story aligned with real selection behavior and avoids subtle mismatches if the data shape changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (20)
packages/blocks/invoice-list/src/api-harmonization/invoice-list.mapper.ts(1 hunks)packages/blocks/invoice-list/src/api-harmonization/invoice-list.model.ts(1 hunks)packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx(7 hunks)packages/blocks/notification-list/src/frontend/NotificationList.client.tsx(4 hunks)packages/blocks/notification-list/src/frontend/NotificationList.types.ts(1 hunks)packages/blocks/order-list/src/frontend/OrderList.client.tsx(4 hunks)packages/blocks/order-list/src/frontend/OrderList.types.ts(1 hunks)packages/blocks/product-list/src/frontend/ProductList.client.tsx(3 hunks)packages/blocks/product-list/src/frontend/ProductList.types.ts(1 hunks)packages/blocks/ticket-list/src/frontend/TicketList.client.tsx(4 hunks)packages/blocks/ticket-list/src/frontend/TicketList.types.ts(1 hunks)packages/framework/src/modules/cms/models/blocks/invoice-list.model.ts(1 hunks)packages/integrations/contentful-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts(3 hunks)packages/integrations/mocked/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts(3 hunks)packages/integrations/strapi-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts(1 hunks)packages/ui/src/components/DataList/DataList.stories.tsx(2 hunks)packages/ui/src/components/DataList/DataList.tsx(4 hunks)packages/ui/src/components/DataList/DataList.types.ts(1 hunks)packages/ui/src/components/DataView/DataView.tsx(1 hunks)packages/ui/src/components/DataView/DataView.types.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-13T15:40:10.528Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 348
File: packages/blocks/notification-summary/src/frontend/NotificationSummary.renderer.tsx:1-15
Timestamp: 2025-11-13T15:40:10.528Z
Learning: In next-intl 3.0+, hook-style APIs like useLocale(), useTranslations(), and useFormatter() can be used in non-async Server Components without the 'use client' directive. The library provides server-optimized implementations automatically. Only async Server Components need to use the await-based APIs like getLocale() from next-intl/server.
Applied to files:
packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx
📚 Learning: 2025-12-03T12:34:20.707Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 419
File: apps/frontend/package.json:52-52
Timestamp: 2025-12-03T12:34:20.707Z
Learning: In the openselfservice repository, the application does not use Next.js cache components (use cache/cacheComponents), so next-intl compatibility limitations related to those experimental features are not a concern.
Applied to files:
packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx
📚 Learning: 2025-11-26T11:57:00.632Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 411
File: packages/framework/src/modules/cms/models/blocks/product-list.model.ts:29-46
Timestamp: 2025-11-26T11:57:00.632Z
Learning: In the framework layer (packages/framework/src/modules/cms/models/blocks/*.model.ts), block classes like ProductListBlock should NOT include explicit __typename discriminators. The __typename field is added at the API harmonization layer (packages/blocks/*/src/api-harmonization/*.model.ts) where it's needed for discriminated unions. The framework maintains normalized data models without these discriminators.
Applied to files:
packages/integrations/contentful-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.tspackages/integrations/strapi-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.tspackages/framework/src/modules/cms/models/blocks/invoice-list.model.ts
🧬 Code graph analysis (4)
packages/ui/src/components/DataList/DataList.stories.tsx (2)
packages/ui/src/components/DataList/DataList.tsx (1)
DataList(14-149)packages/ui/src/components/DataList/DataList.types.ts (1)
DataListColumnConfig(97-104)
packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx (2)
packages/ui/src/hooks/use-toast.ts (1)
toast(189-189)packages/ui/src/elements/button.tsx (1)
Button(19-19)
packages/ui/src/components/DataView/DataView.tsx (2)
packages/ui/src/components/DataGrid/DataGrid.tsx (1)
DataGrid(35-150)packages/ui/src/components/DataList/DataList.tsx (1)
DataList(14-149)
packages/blocks/product-list/src/frontend/ProductList.client.tsx (1)
packages/blocks/product-list/src/sdk/index.ts (1)
sdk(24-28)
🔇 Additional comments (20)
packages/blocks/product-list/src/frontend/ProductList.types.ts (1)
10-10: Product list prop surface aligned with row selection patternAdding
enableRowSelection?: booleantoProductListPropsis consistent with other list blocks and keeps the type ready for when the ProductList client/UI wires it through. No issues from a typing/API perspective.packages/blocks/order-list/src/frontend/OrderList.types.ts (1)
11-11: Order list now exposes row-selection toggle
enableRowSelection?: booleanonOrderListPropsfits the emerging API across list blocks and is non‑breaking. Looks good.packages/blocks/ticket-list/src/frontend/TicketList.types.ts (1)
12-12: Ticket list props correctly extended for row selectionThe
enableRowSelection?: booleanflag is well‑placed alongside other feature toggles and matches its use inTicketList.client.tsx. No changes needed.packages/blocks/notification-list/src/frontend/NotificationList.types.ts (1)
11-11: Notification list props aligned with selection-enabled lists
enableRowSelection?: booleanmirrors the other list blocks and matches its consumption inNotificationList.client.tsx. Typing looks correct.packages/integrations/contentful-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts (1)
117-119: Invoice list CMS mocks consistently configured for bulk selectionThe new mock fields
enableRowSelection: truebulkActionsLabelwith{count, plural, ...}downloadAllButtonLabelare applied consistently across EN/DE/PL and the plural forms look appropriate for each locale. This should give the UI everything it needs for localized bulk‑selection UX.
Also applies to: 236-238, 355-358
packages/blocks/notification-list/src/frontend/NotificationList.client.tsx (1)
55-55: Notification row selection wired consistently with other listsThe notification list mirrors the TicketList pattern:
selectedRowsstored in state as aSet<string | number>.- Selection cleared on
handleFilterandhandleReset, so it doesn’t leak across result sets.enableRowSelection={component.enableRowSelection}plusgetRowKey={(item) => item.id}matches the new public prop and keeps keying straightforward.Implementation looks correct and consistent with the rest of the PR.
Also applies to: 66-66, 88-88, 207-210
packages/blocks/invoice-list/src/api-harmonization/invoice-list.model.ts (1)
33-35: LGTM!The new optional properties for row selection and bulk actions are well-defined and align with the framework model and CMS mapper changes across the PR.
packages/blocks/product-list/src/frontend/ProductList.client.tsx (3)
38-38: LGTM!Good use of
Set<string | number>for tracking selected rows, consistent with the selection pattern established across other list components.
46-46: Selection reset on data changes is correctly implemented.Clearing
selectedRowswhen filters are applied or reset prevents stale selections from persisting after the data set changes.Also applies to: 55-55
168-170:enableRowSelectionis properly declared in ProductList.types.ts.The property is defined at line 10 as
enableRowSelection?: boolean;, confirming it is sourced from props. No action needed.packages/framework/src/modules/cms/models/blocks/invoice-list.model.ts (1)
30-32: LGTM!The new properties are correctly added as optional fields without
__typenamediscriminators, aligning with the framework layer conventions. Based on learnings,__typenameis appropriately added only at the API harmonization layer.packages/ui/src/components/DataList/DataList.types.ts (1)
154-168: LGTM!The row selection API follows the controlled component pattern correctly with
selectedRowsas the value andonSelectionChangeas the callback. The JSDoc comments clearly document the purpose of each prop.packages/integrations/strapi-cms/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts (1)
42-44: LGTM - TODO placeholders are appropriate.Setting these to
undefinedwith TODO comments is a reasonable approach for staged rollout while the CMS schema is being updated.packages/ui/src/components/DataView/DataView.types.ts (1)
21-26: LGTM!The new props extend
DataViewPropsconsistently withDataListProps. The render prop pattern forbulkActionsand function-basedbulkActionsLabelprovide good flexibility for customization and localization.packages/blocks/invoice-list/src/frontend/InvoiceList.client.tsx (2)
191-208: LGTM!Good use of
IntlMessageFormatfor ICU message formatting with locale awareness. The conditional definitions forbulkActionsandbulkActionsLabelcorrectly handle the case when these features are disabled.
249-254: Row selection props are correctly wired to DataView.The controlled selection state pattern with
enableRowSelection,selectedRows, andonSelectionChangeis properly implemented.packages/ui/src/components/DataList/DataList.stories.tsx (1)
2-5: Imports are consistent with new stories
lucide-react,React/useState, andButtonare all used in the new stories; the imports look correct with no obvious redundancy.packages/blocks/order-list/src/frontend/OrderList.client.tsx (1)
55-85: Row selection state wiring looks sound (depends on DataView fix)Using
Set<string | number>forselectedRows, resetting it on filter apply/reset, and passingenableRowSelection,selectedRows,onSelectionChange, andgetRowKey={(item) => item.id.value}intoDataViewis a solid pattern for controlled selection.Just note this relies on
DataViewactually forwardinggetRowKeydown toDataList/DataGrid; see the corresponding comment inDataView.tsxwhere this isn’t currently happening.Also applies to: 214-218
packages/ui/src/components/DataList/DataList.tsx (1)
3-3: Row selection implementation is consistent and controlledThe added selection API (
enableRowSelection,selectedRows,onSelectionChange) together withhandleSelectAll/handleRowSelectand the header/row checkboxes form a coherent controlled selection model:
- Select‑all operates only on the current page’s keys.
- Per‑row toggles clone the
Setbefore updating, which plays nicely with React state.- When selection props are omitted, the component safely no‑ops instead of throwing.
Looks good and matches the needs of
DataViewand the new stories.Also applies to: 21-23, 35-72, 77-85, 108-108, 112-120
packages/integrations/mocked/src/modules/cms/mappers/blocks/cms.invoice-list.mapper.ts (1)
135-137: Invoice-list mock config extended consistently for bulk selection
enableRowSelection,bulkActionsLabel, anddownloadAllButtonLabelare added for EN/DE/PL with consistent semantics and appropriate ICU pluralization patterns. This should integrate cleanly with the new bulk‑actions UI and localization pipeline.Also applies to: 272-274, 409-412
… feature/adding-checkboxes-in-lists
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
packages/ui/src/components/Cards/PricingCard/PricingCard.tsx (1)
9-9: Consider moving unrelated import refactoring to a separate PR.This import path change (from relative to package-based) is a reasonable standardization but appears unrelated to the PR's stated objective of "adding checkboxes in lists." The PricingCard component isn't involved in list selection or bulk actions.
Keeping unrelated refactoring separate improves PR clarity, review focus, and git history.
packages/ui/src/components/DataList/DataList.tsx (1)
70-71: Remove redundant length check.Line 71 checks both
data.length > 0andallRowKeys.length > 0. SinceallRowKeysis derived directly fromdata.map(), these lengths are always identical, making the second check redundant.🔎 Simplify the condition:
const allSelected = - enableRowSelection && data.length > 0 && selectedOnCurrentPage === allRowKeys.length && allRowKeys.length > 0; + enableRowSelection && data.length > 0 && selectedOnCurrentPage === allRowKeys.length;
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/ui/src/components/Cards/InformativeCard/InformativeCard.tsx(1 hunks)packages/ui/src/components/Cards/InformativeCard/InformativeCard.types.ts(1 hunks)packages/ui/src/components/Cards/PricingCard/PricingCard.tsx(1 hunks)packages/ui/src/components/DataGrid/DataGrid.stories.tsx(1 hunks)packages/ui/src/components/DataGrid/DataGrid.tsx(1 hunks)packages/ui/src/components/DataList/DataList.stories.tsx(2 hunks)packages/ui/src/components/DataList/DataList.tsx(4 hunks)packages/ui/src/components/LinkList/LinkList.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/ui/src/components/DataList/DataList.stories.tsx
⏰ 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). (1)
- GitHub Check: deploy-preview
🔇 Additional comments (9)
packages/ui/src/components/Cards/InformativeCard/InformativeCard.types.ts (1)
3-3: LGTM! Import path refactored to package-scoped pattern.The change from relative to package-scoped import aligns with the existing import style in this file and improves maintainability.
packages/ui/src/components/Cards/InformativeCard/InformativeCard.tsx (1)
7-7: LGTM! Import path standardized to match other components.Refactoring the RichText import to use the package-scoped path is consistent with the DynamicIcon import on line 6 and improves code maintainability.
packages/ui/src/components/LinkList/LinkList.tsx (1)
5-7: Clean refactoring to shared modules.The import consolidation to
@o2s/ui/components/DynamicIconand@o2s/ui/elements/linkaligns with the PR's standardization effort. Both modules exist and correctly export their respective components.packages/ui/src/components/DataGrid/DataGrid.tsx (1)
3-6: LGTM! Import paths standardized.The import paths have been updated to use centralized
@o2s/uipackage paths instead of relative imports, improving maintainability and consistency across the codebase.packages/ui/src/components/DataGrid/DataGrid.stories.tsx (1)
4-6: LGTM! Improved TypeScript imports.The imports have been standardized to use
@o2s/uipaths, and thetypekeyword is correctly used for the type-only import ofDataListColumnConfig, which is a TypeScript best practice that helps with tree-shaking.packages/ui/src/components/DataList/DataList.tsx (4)
22-24: LGTM! Row selection props properly defined.The new props
enableRowSelection,selectedRows, andonSelectionChangeare correctly typed and support both controlled and uncontrolled selection patterns. The default value offalseforenableRowSelectionensures backward compatibility.
37-52: LGTM! Select-all logic correctly handles pagination.The
handleSelectAllfunction properly toggles selection for all rows on the current page while preserving selections from other pages. The implementation safely handlesundefinedselectedRowsby defaulting to an empty array.
78-86: LGTM! Header checkbox properly implements tri-state selection.The header checkbox correctly handles three states (all selected, indeterminate, none selected) and includes proper accessibility labels. The implementation follows expected table selection patterns.
113-121: LGTM! Row checkbox implementation is correct.The per-row checkbox properly tracks selection state and includes defensive type coercion (
!!checked) to ensure a boolean value is passed tohandleRowSelect. Accessibility is appropriately handled witharia-label.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
packages/ui/src/components/DataList/DataList.tsx (2)
55-65: Handler asymmetry resolved.The previous concern about
handleRowSelectfailing whenselectedRowsis undefined has been addressed. Line 58 now correctly initializes fromselectedRows || [], matching the pattern inhandleSelectAll.
67-76: Expensive operations are now memoized; consider completing the optimization.The critical performance concern from the previous review has been addressed—
allRowKeys(line 68) andselectedOnCurrentPage(lines 70–73) are now memoized, preventing expensivemapandfilteroperations on every render.However,
allSelectedandsomeSelected(lines 74–76) remain unmemoized. While these are cheap boolean comparisons with minimal overhead, wrapping all four values in a singleuseMemoas originally suggested would provide consistency and eliminate any remaining recalculation.
🧹 Nitpick comments (1)
packages/blocks/invoice-list/src/frontend/InvoiceList.client.stories.tsx (1)
14-324: Consider adding the new row selection properties to the story.The PR introduces
enableRowSelection,bulkActionsLabel, anddownloadAllButtonLabelproperties to the InvoiceListBlock. Adding these to the story args would help demonstrate and visually test the new bulk actions feature.🔎 Suggested addition to the args object:
downloadFileName: 'invoice-{id}.pdf', downloadButtonAriaDescription: 'Download invoice {id}', + enableRowSelection: true, + bulkActionsLabel: '{count} invoices selected', + downloadAllButtonLabel: 'Download selected', }, };
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/blocks/invoice-list/src/frontend/InvoiceList.client.stories.tsx(5 hunks)packages/ui/src/components/DataGrid/DataGrid.tsx(1 hunks)packages/ui/src/components/DataList/DataList.tsx(4 hunks)packages/ui/src/lib/renderCell.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/ui/src/components/DataGrid/DataGrid.tsx
- packages/ui/src/lib/renderCell.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
packages/ui/src/components/DataList/DataList.tsx (2)
packages/ui/src/elements/table.tsx (5)
Table(64-64)TableHeader(64-64)TableRow(64-64)TableHead(64-64)TableCell(64-64)packages/ui/src/elements/checkbox.tsx (1)
Checkbox(99-99)
⏰ 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). (2)
- GitHub Check: deploy-preview
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
packages/blocks/invoice-list/src/frontend/InvoiceList.client.stories.tsx (1)
176-183: LGTM!The addition of
currencyfields to the nestedtotalAmountDueandtotalNetAmountDueobjects aligns the mock data with the updated type definitions. The changes are consistent across all invoice entries.packages/ui/src/components/DataList/DataList.tsx (5)
1-6: All imports are properly utilized.All imported modules are actively used in the component implementation.
23-25: Sensible defaults for selection props.The
enableRowSelectiondefault offalseensures backward compatibility, and making selection props optional allows flexible adoption.
37-53: Select-all logic correctly preserves multi-page selection state.The implementation properly adds or removes only the current page's keys, preserving selections from other pages.
82-90: Select-all checkbox correctly implements tri-state logic.The header checkbox properly displays indeterminate state when some (but not all) rows are selected, and includes appropriate accessibility labels.
113-125: Row selection checkboxes properly integrated.The row-level checkboxes correctly reflect selection state and handle user interaction. The
!!checkedconversion on line 121 is defensive but harmless, ensuring boolean type safety.
What does this PR do?
Key Changes
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.