Skip to content

Fixes #37309: Context Center Documents clear selection fails after folder/search changes - #37325

Merged
Rohit0301 merged 1 commit into
mainfrom
detail/bug-fix/fixes-37309-context-center-documents-clear-selecti-a7cc16
Nov 9, 2026
Merged

Rohit0301 merged 1 commit into
mainfrom
detail/bug-fix/fixes-37309-context-center-documents-clear-selecti-a7cc16

Conversation

@detail-app

@detail-app detail-app Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #37309

In the Context Center Documents page, stale "ghost" ids remain in selectedIds when the visible list changes (folder navigation, search, or single-file delete). The bulk-action bar's Clear button only toggled ids present in the currently rendered data, so it could not deselect ids that were no longer visible — the bar stayed on with a stale count, and bulk delete/move passed those invisible ids to the APIs.

I worked on clearing the document selection whenever the visible context changes and giving the Clear button a way to empty the entire set, because bulk actions should never operate on files the user cannot see in the current view.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Selecting files, navigating to another folder, then clicking Clear empties the selection and the bulk bar disappears
  • Selecting files, typing a search query, then clicking Clear empties the selection
  • Selecting a file and deleting it via the card menu removes its id from the selection
  • Clicking Clear with ghost ids (selected but not rendered) empties the entire selection
  • DocumentsView without onClearSelection falls back to the old per-id toggle behavior (backward compatibility)

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated:
    • src/components/ContextCenter/DocumentsView/DocumentsView.test.tsx (5 new tests)
    • src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.test.tsx (4 new tests)
  • 24/24 tests pass (16 DocumentsView + 8 ContextCenterDocumentsPage); 60/60 across the broader 5-suite ContextCenter run.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no new Playwright tests added; existing ContextCenterDocument.spec.ts verified against a running server — 5 key tests in isolation pass: bulk delete, bulk move, single delete, search filter, clear search).

Manual testing performed

  1. Started the OpenMetadata server (MySQL + Elasticsearch + server) via Docker compose with pre-built 2.1.0-rc1 images.
  2. Ran the existing ContextCenterDocument.spec.ts Playwright suite against the pre-built UI at :8585 — 26/30 passed; the 4 failures are pre-existing test-ordering/version-mismatch issues unrelated to this fix.
  3. Ran 5 key tests in isolation (bulk delete 2 docs, bulk move 2 docs, single delete, search filter, clear search) — all 5 passed.
  4. Started the Vite dev server with the modified UI at :3000 and re-ran the suite — 16/30 passed; the 14 failures are due to API version mismatch between the development-branch UI and the 2.1.0-rc1 server image (document upload prerequisites failed silently), not caused by this fix.

UI screen recording:

Not applicable — standalone bug fix in selection state management; no new UI feature or visual change to record.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md).

Automatic Fixes PRs can be configured here.

@detail-app
detail-app Bot requested a review from a team as a code owner November 6, 2026 22:56
@detail-app
detail-app Bot requested a review from Rohit0301 November 6, 2026 22:56
@github-actions

github-actions Bot commented Nov 6, 2026

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 added the safe to test Add this label to run secure Github workflows on PRs label Nov 9, 2026
@Rohit0301
Rohit0301 enabled auto-merge (squash) November 9, 2026 05:40
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Bundle Runtime Check

A route chunk loads but one of its chunks still exports undefined: a chunking change broke module initialisation. Run yarn build && yarn bundle:runtime locally.


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.69% (141942/173749) 69.16% (52018/75213) 72.13% (29122/40371)

@Rohit0301
Rohit0301 merged commit 9c142ab into main Nov 9, 2026
92 of 98 checks passed
@Rohit0301
Rohit0301 deleted the detail/bug-fix/fixes-37309-context-center-documents-clear-selecti-a7cc16 branch November 9, 2026 06:02
anuj-kumary added a commit that referenced this pull request Nov 11, 2026
…ings and MetricSearch (#37515)

- Context Center bulk move/delete/download: #37325 clears the selection when
  the search changes, so select both files from one search on a uuid their
  names share.
- ContextCenterArchive lazy-load beforeAll: 18 uploads each wait up to 90s
  for extraction; give the hook a 3-minute budget.
- LineageSettings: an upgraded instance stores no graphPerformanceConfig and
  the server fills defaults on write; compare against the seeded value.
- MetricSearch: assert no error toast instead of any alert-bar, which catches
  other workers' success notifications.
anuj-kumary added a commit that referenced this pull request Nov 11, 2026
…cs (2.1 backport of #37512) (#37513)

* test(playwright): select bulk documents under one search and open OSS workflows by URL

Context Center: since #37325 changing the documents search clears the selection,
so selecting two files with a search per file left only the last one selected and
'2 selected' never appeared. Give the files a shared prefix and select both under
one search (selectDocumentsBySearch).

Workflows: the list shows 12 cards per page and the seeded workflow definitions
already fill page 1, so the test workflow was on page 2 and never clickable.
Open the detail page by URL.

(cherry picked from commit 899e67f)

* chore(playwright): regenerate impact map
anuj-kumary added a commit that referenced this pull request Nov 11, 2026
…ings and MetricSearch (#37514)

- Context Center bulk move/delete/download: #37325 clears the selection when
  the search changes, so select both files from one search on a uuid their
  names share.
- ContextCenterArchive lazy-load beforeAll: 18 uploads each wait up to 90s
  for extraction; give the hook a 3-minute budget.
- LineageSettings: an upgraded instance stores no graphPerformanceConfig and
  the server fills defaults on write; compare against the seeded value.
- MetricSearch: assert no error toast instead of any alert-bar, which catches
  other workers' success notifications.
anuj-kumary added a commit that referenced this pull request Nov 11, 2026
…cs failing on 2.1 (#37512)

* test(playwright): select bulk documents under one search and open OSS workflows by URL

Context Center: since #37325 changing the documents search clears the selection,
so selecting two files with a search per file left only the last one selected and
'2 selected' never appeared. Give the files a shared prefix and select both under
one search (selectDocumentsBySearch).

Workflows: the list shows 12 cards per page and the seeded workflow definitions
already fill page 1, so the test workflow was on page 2 and never clickable.
Open the detail page by URL.

* chore(playwright): regenerate impact map
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] Context Center Documents: Clear selection fails after folder/search changes, causing bulk actions on invisible files

2 participants