Skip to content

fix(soft-delete): name the recovery location in the archive confirmation - #43401

Open
mikebridge wants to merge 2 commits into
apache:masterfrom
mikebridge:sc-117152-soft-delete-modal-copy
Open

fix(soft-delete): name the recovery location in the archive confirmation#43401
mikebridge wants to merge 2 commits into
apache:masterfrom
mikebridge:sc-117152-soft-delete-modal-copy

Conversation

@mikebridge

Copy link
Copy Markdown
Contributor

SUMMARY

With soft delete enabled, the archive confirmation told users their chart, dashboard, or dataset "will be moved to Recently Archived" without saying where that is. QA (SC-117152, TC-099/TC-101) compared the modal against the design of record and found the recovery-location hint missing — the one genuine usability gap among the diffs: a user reading only the modal had no way to know recovery lives under Settings → Manage → Recently Archived.

The confirmation body now names the location in all four variants (singular/plural, with and without a configured retention window):

This chart will be moved to Recently Archived in the Settings menu. You can recover it there within 30 days.

Each variant remains a single, complete translation unit; only the noun and day count are interpolated. The four corresponding messages.pot msgids are updated in step.

Terminology decision (recorded on the ticket): "Archive / Recently Archived" is confirmed as the copy of record — it was chosen deliberately during the soft-delete rollout to keep recoverable deletion distinct from the "Delete permanently" purge action offered on the recovery page. The design node's "Delete / Recently Deleted" wording is the stale side and is being updated separately by design; that work does not block this change.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Copy-only change; QA's before screenshots are attached to [SC-117152]. Before/after body text:

Body
Before This chart will be moved to Recently Archived. You can recover it there within 30 days.
After This chart will be moved to Recently Archived in the Settings menu. You can recover it there within 30 days.

TESTING INSTRUCTIONS

  1. Enable SOFT_DELETE.
  2. Trigger delete on a chart, dashboard, or dataset (single and bulk).
  3. The confirmation body names the recovery location; title and button still read "Archive".
  4. npm run test -- src/utils/softDeleteCopy.test.ts — 9 tests, expectations updated to the new copy.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: SOFT_DELETE (copy renders only with the flag on; flag-off copy unchanged)
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API

This PR was developed with AI assistance (Claude Code); a human (@mikebridge) reviews before undrafting.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Aug 21, 2026
@mikebridge
mikebridge marked this pull request as ready for review August 21, 2026 18:25
@dosubot dosubot Bot added change:frontend Requires changing the frontend i18n:general Related to translations labels Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.81%. Comparing base (9781254) to head (1dbf497).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43401   +/-   ##
=======================================
  Coverage   66.81%   66.81%           
=======================================
  Files        2876     2876           
  Lines      164454   164466   +12     
  Branches    37960    37961    +1     
=======================================
+ Hits       109873   109885   +12     
  Misses      52388    52388           
  Partials     2193     2193           
Flag Coverage Δ
hive 38.07% <ø> (-0.01%) ⬇️
mysql 57.77% <ø> (+<0.01%) ⬆️
postgres 57.80% <ø> (+<0.01%) ⬆️
presto 40.00% <ø> (-0.01%) ⬇️
python 59.23% <ø> (+<0.01%) ⬆️
sqlite 57.49% <ø> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

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.

The archive confirmation told users their chart, dashboard, or dataset
moves to Recently Archived without saying where that is. The design of
record (SC-117152, Figma 2209-2689) includes the location; the app
omitted it. The body now reads '...moved to Recently Archived in the
Settings menu' across all four variants (singular/plural, with and
without a retention window). Archive terminology is confirmed as the
copy of record -- the design node's 'Delete / Recently Deleted' wording
is the stale side and is being updated separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikebridge
mikebridge force-pushed the sc-117152-soft-delete-modal-copy branch from 1a7fa36 to b82bc13 Compare August 21, 2026 21:03
Comment on lines +69 to 70
'These %(type)s will be moved to Recently Archived in the Settings menu. You can recover them there within %(days)s days.',
{ type: typeLabel, days },

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.

Suggestion: The retention setting accepts a valid one-day window, but this message always uses the plural unit “days”, producing “within 1 days.” Use singular/plural-aware translation variants so the confirmation remains grammatically correct for a one-day retention period. [logic error]

Severity Level: Minor 🧹
- ⚠️ Archive confirmations display incorrect singular grammar.
- ⚠️ Affects one-day chart, dashboard, and dataset retention windows.

Use CodeAnt Skill

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/utils/softDeleteCopy.ts
**Line:** 69:70
**Comment:**
	*Logic Error: The retention setting accepts a valid one-day window, but this message always uses the plural unit “days”, producing “within 1 days.” Use singular/plural-aware translation variants so the confirmation remains grammatically correct for a one-day retention period.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

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.

Fixed in 1dbf497: the timed variants now pluralize on the day count with tn() (each case remains one complete translation unit for translators), messages.pot carries the matching msgid/msgid_plural pairs (validated with msgfmt --check-format), and the copy tests pin the one-day singular for both the single and bulk variants.

Comment by Claude (AI) on behalf of @mikebridge.

@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is correct. The current implementation uses a hardcoded "days" string, which results in grammatically incorrect output when the retention period is one day. To resolve this, you should use the nplurals support provided by the t() translation function (often via tn()) to handle singular and plural forms correctly.

Would you like me to fetch all other comments on this PR to validate and implement fixes for them as well?

superset-frontend/src/utils/softDeleteCopy.ts

return plural
        ? tn(
            'These %(type)s will be moved to Recently Archived in the Settings menu. You can recover them there within %(days)d day.',
            'These %(type)s will be moved to Recently Archived in the Settings menu. You can recover them there within %(days)d days.',
            days,
            { type: typeLabel, days },
          )
        : tn(
            'This %(type)s will be moved to Recently Archived in the Settings menu. You can recover it there within %(days)d day.',
            'This %(type)s will be moved to Recently Archived in the Settings menu. You can recover it there within %(days)d days.',
            days,
            { type: typeLabel, days },
          );

@bito-code-review

bito-code-review Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #656bd9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: b82bc13..b82bc13
    • superset-frontend/src/utils/softDeleteCopy.test.ts
    • superset-frontend/src/utils/softDeleteCopy.ts
    • superset/translations/messages.pot
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@richardfogaca richardfogaca 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.

Richard's agent here:

The existing one-day pluralization thread looks valid: SOFT_DELETE_RETENTION_DAYS accepts 1, while both timed confirmation variants currently produce “within 1 days.” Could we switch those variants to tn() and add a days = 1 expectation before merging?

I found no additional substantive issues at b82bc13; CI is green.

…rmation

SOFT_DELETE_RETENTION_DAYS accepts 1, and both timed confirmation
variants hardcoded "days", producing "within 1 days". The timed variants
now pluralize on the day count with tn(), each case still a single
complete translation unit; messages.pot carries the matching
msgid/msgid_plural pairs (msgfmt --check-format clean). Adds the
one-day singular expectation to the copy tests.

Addresses the review thread on apache#43401.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikebridge

Copy link
Copy Markdown
Contributor Author

@richardfogaca Done in 1dbf497 — both timed variants switched to tn() on the day count, with the days = 1 singular expectation added for the single and bulk forms (softDeleteCopy.test.ts, 10/10 passing). The .pot now carries the corresponding msgid/msgid_plural pairs.

Comment by Claude (AI) on behalf of @mikebridge.

@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 1dbf497
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a88d3561eecab00083fdf0d
😎 Deploy Preview https://deploy-preview-43401--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.

@bito-code-review

bito-code-review Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f4220c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: b82bc13..1dbf497
    • superset-frontend/src/utils/softDeleteCopy.test.ts
    • superset-frontend/src/utils/softDeleteCopy.ts
    • superset/translations/messages.pot
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

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

Labels

change:frontend Requires changing the frontend i18n:general Related to translations i18n Namespace | Anything related to localization size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants