Feat/settings reset to defaults#473
Merged
Baskarayelu merged 5 commits intoJun 29, 2026
Merged
Conversation
added 5 commits
June 28, 2026 21:48
…omponents catalog
|
@directorfloo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
4 tasks
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.
Closes #438
Title: feat(settings): add "Reset to defaults" action with confirmation and toast
Summary
Adds a guarded "Reset to defaults" action on the Settings page that restores the persisted
credence:settingspayload to the defined defaults and shows a success toast. Uses the existingConfirmDialogfor destructive confirmation and restores focus to the trigger after close.Why
Users need a one-click, guarded way to return settings to a known-good baseline (theme
system, networkpublic, address displayshort, toasts enabled,5sauto-dismiss). Keeps behavior consistent with other destructive flows (ConfirmDialog + toast + focus restoration).Key changes
resetToDefaults()and expose it onSettingsStatein SettingsContext.tsx.ConfirmDialog.resetToDefaults(), persist tocredence:settings, show success toast "Settings reset to defaults.", and restore focus to the trigger button.Files touched
resetToDefaults()and extendSettingsStatereturnFocusRefsrc/pages/Settings.test.tsx— tests for reset flowImplementation notes
credence:settings(no new keys).resetToDefaults()sets in-memory values todefaultPersistedSettingsthen persists via existing save path.ConfirmDialogalready implements focus trap and supportsreturnFocusRef.Testing (local)
Unit:
localStorage.getItem('credence:settings')equalsdefaultPersistedSettingsJSON after confirm.document.documentElementtheme attribute reflects defaults.Manual:
Review checklist
resetToDefaults()implemented and exported viaSettingsState.credence:settingsstorage key.strictand lint checks pass.Release notes
Optional follow-ups
Want me to open the PR on GitHub (I’ll need your approval to push the branch + create the PR), or paste this as-is into a new PR for you?