Skip to content

Conversation

rahmanunver
Copy link
Contributor

Pull request type

New feature (non-breaking change which adds functionality)


Description

This PR implements multi-page select all functionality for the Datagrid2 widget, allowing users to select all items across multiple pages based on the current filter. The feature includes configurable batch processing, progress tracking, and cancellation support, similar to the existing Excel export functionality.

What should be covered while testing?

Small dataset (< buffer size): Should use immediate selection
Large dataset (>= buffer size): Should show progress dialog and batch processing
Unknown total count: Should fall back to per-page selection
Cancellation: Should properly cancel and restore state
Page restoration: Should return user to original page after selection
Filtered data: Should only select items matching current filter

@rahmanunver rahmanunver requested a review from a team as a code owner September 19, 2025 13:02
@rahmanunver rahmanunver force-pushed the wc-3027_dg2_multipage_selectall branch 2 times, most recently from 979dd4f to 688c166 Compare September 25, 2025 18:38
@iobuhov iobuhov force-pushed the wc-3027_dg2_multipage_selectall branch 4 times, most recently from a72742a to 692515b Compare October 15, 2025 15:29
}

#{$root}-clear-selection {
#{$root}-btn-invisible {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really invisible, it makes them look like a link, I would call it btn-link or something.

import { createElement } from "react";
import { useDatagridRootScope } from "../helpers/root-context";

export const SelectAllBar = observer(function SelectAllBar(): React.ReactNode {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import ReactNode from "react". We disallowed global React.* namespace in out React 19 migration.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@iobuhov iobuhov force-pushed the wc-3027_dg2_multipage_selectall branch from 0471555 to 0f52cb0 Compare October 17, 2025 11:51
Comment on lines +234 to +236
performance.mark("DSExportRequest_end");
const measure = performance.measure("DSExportRequest", "DSExportRequest_send", "DSExportRequest_end");
console.debug(`DSExportRequest: export took ${(measure.duration / 1000).toFixed(2)} seconds`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some leftovers

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to keep it.

Comment on lines +201 to +207
<property key="clearSelectionCaption" type="textTemplate">
<caption>Clear selection caption</caption>
<description />
<translations>
<translation lang="en_US">Clear selection</translation>
</translations>
</property>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gallery probably needs a changlog entry about this change

Comment on lines +159 to +161
* This method is a hack to reload selection. To work it requires at leas one object.
* The problem is that if we setting value equal to current selection, then prop is
* not reloaded. We solve this by setting ether empty array or array with one object.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What use case is this solving, why do we need to reload the prop?

Comment on lines +151 to +152
const measure1 = performance.measure("Measure1", "SelectAll_Start", "SelectAll_End");
console.debug(`Data grid 2: 'select all' took ${(measure1.duration / 1000).toFixed(2)} seconds.`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this in production code? Likely useless for production, but if we want to keep this for dev build mayse there is a way to strip this away via rollup for production.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always see debug info for nanoflows. So I think it's fine to keep this one as well

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logs will be off in production

}

get clearSelectionText(): string {
return this.gate.props.clearSelectionCaption?.value ?? "clear.selection.caption";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We likely want sensible fallback similar to singular and plural.

Copy link
Collaborator

@iobuhov iobuhov Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's "clear" text, there is no plural form I think

@iobuhov iobuhov force-pushed the wc-3027_dg2_multipage_selectall branch from 0f52cb0 to eebfcd4 Compare October 20, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants