Skip to content

Fixes 35890: Bulk edit grid text selection, tags copy/paste and search (2.0 backport #35974) - #36116

Merged
Rohit0301 merged 6 commits into
2.0from
backport/2.0/bulk-edit-grid-35974
Oct 24, 2026
Merged

Rohit0301 merged 6 commits into
2.0from
backport/2.0/bulk-edit-grid-35974

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #35974 to 2.0. Fixes #35890.

In the bulk edit grid (Preview & Edit), input meant for an open cell editor is handled by the editor rather than the grid. Copy/paste uses the rendered column order, and Ctrl/Cmd+V reads the system clipboard. Search matches column.* rows and keeps hidden rows when you edit. Labels now say "columns" for tables and "glossary terms" for glossaries. The StrictMode export guard is reset on unmount. See #35974 for the full description.

Conflict resolution

2.0 is missing earlier main refactors of these files, so I ported this PR's hunks onto the 2.0 code instead of pulling those refactors in:

  • useGridEditController.ts: 2.0 still has the inline keydown handler. I added only the new helpers (isEventInsideCellEditor, getGridKeyTarget, handleClipboardShortcuts). The inline delete, select-all and arrow logic now works on gridRows / setGridRows / pushFullUndo. The .ant-select custom-editor checks stay, because 2.0 still uses antd selects.
  • BulkEditEntity.component.tsx: kept 2.0's inline dataSourceWithOperations. The PR's changes are applied on top: visibleRows/searchText/onSearchTextChange props, getBulkEditRenderedColumns, isBulkEditNameColumn, mergeGridRows in onRowsChange, the row label key, and the StrictMode guard reset.
  • BulkEntityImportPage.tsx: removed 2.0's duplicate shouldRenderMetricImportEditor (it is now defined before the controller) and passed visibleRows. The main-only render-helper refactor is not included.
  • .github/playwright/impact-map*.json: left unchanged. 2.0 has no bulk-edit cluster to extend.

Type of change:

  • Bug fix

Tests:

  • Jest: src/components/BulkEditEntity, src/pages/EntityImport/BulkEntityImportPage, src/components/Domain/AddDomainForm, src/utils/CSV/GridRowsUtils: 189/189 passed.
  • tsc: no errors in the changed files.
  • organize-imports + ESLint + Prettier pass on the changed files.
  • Playwright: BulkEditTableGridInteractions.spec.ts is included but was not run locally.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The changes since the previous review appear safe to merge.

Summary

This backport fixes bulk-edit keyboard input, clipboard use, and search.

  • Open cell editors keep their keys, and grid copy and paste follow spreadsheet cells.
  • Bulk-edit search filters rows and keeps edits with the full row list.
  • Bulk-edit counts name table rows as columns and glossary rows as terms.

No new actionable issues were established in the changes since the previous review. Tests and browser checks were not run during this review.

Reviews (4) · Last reviewed commit: "Add rowTestId to LazyDataGrid and bulk e..." · Reviewed by Greptile

#35974)

* Fixes #35890: Bulk edit grid text selection, tags copy/paste, search and labels

- Let keys and mouse gestures inside an open cell editor reach the editor
  (select-all, undo/redo, text selection) instead of the grid controller.
- Map copy/paste/delete to the columns in the order the grid renders them
  (operation and frozen columns first) and paste from the system clipboard.
- Search matches column.* fields; edits made while searching merge back into
  the full data so hidden rows are kept.
- Label table bulk edit rows as columns (glossary rows as glossary terms).
- Re-trigger the bulk edit export after a StrictMode remount in dev.

* Map useGridEditController and the new bulk edit grid spec in the Playwright impact map

* Paste outside text into one cell, share the filtered rows, report denied clipboard reads

- Split clipboard text into cells only when it is the grid's own last copy;
  any other text (a description with commas or newlines) fills the selected
  cell instead of overwriting its neighbours and the rows below.
- Show an error toast when the clipboard read is denied.
- Pass the page's filtered rows to BulkEditEntity so the grid and the
  controller index the same rows.

* Split outside text pasted onto a range, reset the range on search, map the import page

- Outside clipboard text stays one value only for a single selected cell; a
  header or range paste splits it into rows and tab-separated columns.
- Handle only a rejected clipboard read as a denied clipboard.
- Clear the selected range when the search changes the visible rows.
- Map pages/EntityImport to the bulk edit Playwright specs.

* chore(playwright): auto-refresh impact-map.generated.json

* Create the spec's table in beforeAll and cover the row labels with unit tests

* Copy grid cells as TSV, keep header pastes split, reset the range when visible rows change

- Write grid copies tab-separated, matching the paste parser, and compare
  clipboard text with Windows line endings normalised.
- A header selection is never a single cell, even with one visible row.
- Clear the selected range in the grid controller whenever the rendered row
  ids change (search or an edit), not only on a search change.
- Fix the import order that failed UI Checkstyle.

* Store the grid copy with normalised line endings so CRLF cells paste back cell for cell

* Handle a rejected clipboard write and list setSelectedRange in hook dependencies

* Move bulk edit grid test helpers to importUtils and drop the wide viewport

* Pin bulk edit grid cells to the row's stable test id instead of its row index

* Scroll the bulk edit grid back to the name column before finding a row

* Move mergeGridRows to CSVPureUtils with its tests

* Keep useGridEditController free of app imports so its browser test bundle loads

gridEditors.spec.ts bundles the hook on its own; importing ToastUtils,
LocalUtil and CSVPureUtils grew that bundle from 268 KB to 14.7 MB and the
test page never rendered, failing plan-playwright in the merge queue.
- Move mergeGridRows to the import-free utils/CSV/GridRowsUtils.ts.
- Report clipboard failures through an onClipboardError option; the bulk
  import page passes the toast.

* Show the clipboard error toast in the Add Domain table property grid too

* lint fix

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit aa1c0b7)
@Rohit0301
Rohit0301 requested a review from a team as a code owner October 23, 2026 14:01
@Rohit0301
Rohit0301 requested review from anuj-kumary and removed request for a team October 23, 2026 14:01
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 568 → 568
- 0 added, 0 removed, 3 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/BulkEditEntity/BulkEditEntity.component.tsx
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/table.ts
  openmetadata-ui/src/main/resources/ui/src/utils/EntityBulkEdit/EntityBulkEditUtils.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@pmbrull
pmbrull requested review from a team, akash-jain-10, harshach and tutte as code owners October 23, 2026 14:01
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 self-assigned this Oct 23, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 68%
68.33% (83016/121482) 53.23% (51422/96590) 53.98% (15299/28339)

2.0 has no playwright/support/fixtures/base, so test discovery failed.
BulkEditTableGridInteractions locates rows by their rdg-row-<id> test id,
which main gets from LazyDataGrid's rowTestId (#0b80ff39b2). Backport that
prop and set it on the bulk edit grid.
@gitar-bot

gitar-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Changing bulk-edit clipboard mapping and filtered-row merging could apply pasted or cleared values to unintended metadata fields before saving.

Backports bulk edit grid fixes to 2.0: open cell editors keep their text input, copy/paste follows on-screen column order, search matches column rows while keeping hidden rows on edit, and table and glossary labels are distinguished. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@Rohit0301
Rohit0301 merged commit a49448a into 2.0 Oct 24, 2026
103 of 112 checks passed
@Rohit0301
Rohit0301 deleted the backport/2.0/bulk-edit-grid-35974 branch October 24, 2026 13:59

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants