feat: add reset to defaults to collection preferences#4806
Draft
ernst-dev wants to merge 2 commits into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4806 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 952 952
Lines 30816 30825 +9
Branches 11318 11322 +4
=======================================
+ Hits 30081 30090 +9
Misses 688 688
Partials 47 47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ernst-dev
had a problem deploying
to
allure-report
July 23, 2026 16:44 — with
GitHub Actions
Failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an opt-in "Reset to defaults" affordance to
CollectionPreferences, resolving AWSUI-61145. Customers can now restore a table's/cards' default preferences in a single action instead of undoing each change individually.What changed
resetToDefaultsconfig:{ label?: string; preferences: CollectionPreferencesProps.Preferences }. When set, a link-style reset button is rendered in the modal footer (left-aligned), matching the placement requested by customers in the ticket. When it is not set, the footer is unchanged.onResetcallback (NonCancelableEventHandler<Preferences>) fired when the user activates the reset button. Thedetailcontains the default preferences the modal's working state was restored to.resetToDefaults.preferences; the user still confirms via the existing confirm button for the change to take effect. The modal does not close on reset.collection-preferencesnamespace asresetToDefaults.label(default English "Reset to defaults"), with a matching entry inmessages-types.ts.findResetButton()added to theCollectionPreferencestest-utils DOM wrapper.Backward compatibility: fully opt-in. No behavior change unless
resetToDefaultsis provided; existing props/events are untouched.Related links, issue #, if available: AWSUI-61145
How has this been tested?
collection-preferences.test.tsx(7 cases): button not rendered when opt-out; rendered with label;onResetfired with default preferences; no throw whenonResetomitted; confirm applies reset preferences; modal stays open on reset; i18n label override.collection-preferencesunit suite green (113 tests across 9 files) — no regressions.pages/collection-preferences/reset-to-defaults.page.tsx) with a live controlled example showing current preferences and last reset detail.quick-build(TypeScript),eslint, andstylelintall pass under Node v24.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.