Skip to content

fix(soft-delete): archive toast, counts, history and keyboard follow-ups - #45747

Open
mikebridge wants to merge 30 commits into
apache:masterfrom
mikebridge:sc-128962-archive-polish
Open

mikebridge wants to merge 30 commits into
apache:masterfrom
mikebridge:sc-128962-archive-polish

Conversation

@mikebridge

@mikebridge mikebridge commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Archive links stay available until dismissed, dependency warnings show accurate totals, and Recently Archived follows browser history consistently. Keyboard users can read why an action is unavailable, and recovery links work under a URL prefix.

#45476 has merged, so this branch now contains only its own changes.

SUMMARY

Follow-ups from a product-acceptance pass over #45476:

  1. Link toasts stay open. Toasts that carry a link ("View in Recently Archived") stay open until they're dismissed, instead of timing out while the pointer or keyboard focus is on them. Plain-text toasts keep their timers.
  2. Accurate dataset counts. The bulk dataset archive warning counts charts and dashboards separately, e.g. "linked to 4 charts and 1 dashboard", instead of implying every chart is on a dashboard.
  3. History navigation. ListView replays sort along with page and filters from the URL. Recently Archived pushes type changes into history, so Back and Forward return to the previous page, sort, search and type.
  4. Keyboard explanations for unavailable actions. Focusing a chart or dashboard card's More Options button shows why Edit or Archive/Delete is unavailable, without opening the menu. The actions themselves stay disabled, and closing the menu with Tab returns focus to More Options.
  5. Recovery link under a URL prefix. The recovery toast's "View Dashboard" link keeps the application root prefix.

Not included: an explicit "this dataset is archived" message in Explore. It needs a server-provided reason, so it'll be a separate change.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Behavior and copy changes. Screenshots to follow.

TESTING INSTRUCTIONS

  • Archive a chart, hover or tab to the toast's link: the toast stays until dismissed.
  • Archive several datasets where some charts are on no dashboard: the counts are separate and accurate.
  • In Recently Archived, change page, sort, search and type, then use Back and Forward: each state is restored.
  • Tab to a card's More Options button where Edit or Archive is unavailable: the reason tooltip appears on focus, before opening the menu. Open the menu and press Tab: it closes and focus returns to More Options.
  • Under a URL prefix (e.g. /analytics), recover a dashboard: the toast link opens it.
  • Jest: toast, ListView state and component, ArchivedList, and the chart and dashboard card suites (210 focused tests).

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: SOFT_DELETE
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API

@netlify

netlify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 8d6f261
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6aed47a414e6111280087933
😎 Deploy Preview https://deploy-preview-45747--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added i18n Namespace | Anything related to localization doc Namespace | Anything related to documentation labels Oct 26, 2026
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.02%. Comparing base (fcc13d4) to head (8d6f261).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #45747      +/-   ##
==========================================
+ Coverage   85.00%   85.02%   +0.01%     
==========================================
  Files        3080     3080              
  Lines      209266   209480     +214     
  Branches    49296    49328      +32     
==========================================
+ Hits       177895   178106     +211     
- Misses      27989    27995       +6     
+ Partials     3382     3379       -3     
Flag Coverage Δ
hive 34.19% <ø> (-0.01%) ⬇️
javascript 81.31% <100.00%> (+<0.01%) ⬆️
mysql 52.01% <ø> (-0.02%) ⬇️
postgres 52.02% <ø> (-0.02%) ⬇️
presto 35.85% <ø> (-0.01%) ⬇️
python 87.97% <ø> (+0.01%) ⬆️
sqlite 51.76% <ø> (-0.02%) ⬇️
unit 82.93% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 28, 2026
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Oct 29, 2026
@mikebridge
mikebridge marked this pull request as ready for review November 5, 2026 06:15
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 8d6f26135636

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two of the described behaviours don't hold in a browser; details inline.

Nit: With SOFT_DELETE off, the delete warnings in DatasetList/index.tsx (~1621, ~1806) still say charts "on" dashboards; that file is outside this diff, so not inline.

Comment on lines +366 to +368
if (!isEqual(initialSortBy, sortBy)) {
setSortBy(initialSortBy);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Back/Forward now restores sortBy here, but CardSortSelect seeds its value once in useState, so card view keeps showing the old sort while cards use the restored one. Keying it, e.g. key={JSON.stringify(sortBy)} on both CardSortSelect uses in ListView.tsx, fixes it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remaining: table view. The card Sort control now follows Back/Forward, but going Back from age desc to name asc refetches rows by Name while the Age header keeps its descending arrow (TableCollection seeds antd's header sort via defaultSortOrder). Recently Archived is table-only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Both card-sort selectors are now keyed by the restored sort in a78cdbf. The desktop and mobile-drawer regressions check the selected option as well as the fetch sort after Back and Forward.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still open at 8d6f261: in table view, going Back from age desc to name asc refetches rows by Name while the Age header keeps aria-sort="descending". TableCollection passes only antd's defaultSortOrder, so the header never follows a restored sort.

Address the card-sort and keyboard-hint review threads on apache#45747: remount both sort selectors when URL state changes, and show permission explanations on the enabled menu trigger instead of unreachable disabled-item tab stops. Pin restored archive rows and describe dataset chart/dashboard counts independently in permanent-delete warnings.
@pull-request-size pull-request-size Bot added size/XL and removed size/L labels Nov 5, 2026

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One new keyboard-focus regression in the shared card menu; details inline.

Nit: DatabaseList/index.tsx:1302 still says charts "that appear on" dashboards, unlike the reworded dataset copy; that file is outside this diff, so not inline.

@mikebridge

Copy link
Copy Markdown
Contributor Author

On the review-body note about DatasetList: the single and bulk permanent-delete warnings now say charts "and" dashboards in a78cdbf, with flag-off assertions and matching translation entries.

Keep Button as the direct Dropdown child so Tab returns focus after the menu closes, with and without permission hints. Add red-first regression coverage for Amin's focus-return thread and clarify that card hints belong to the Charts and Dashboards lists, not Recently Archived.

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The More Options hint is no longer announced to screen readers; details inline.

aria-label={ariaLabel}
aria-haspopup="true"
data-test={dataTest}
<Tooltip title={tooltipTitle} trigger={['hover', 'focus']}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the Tooltip wrapping the Dropdown, its aria-describedby no longer reaches the More Options button, so screen readers focusing it don't hear why Edit/Archive is unavailable. Passing a useId as the Tooltip id and as the Button's aria-describedby restores it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation i18n Namespace | Anything related to localization size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants