Skip to content

Reset Individual Settings: per-category reset, remove per-screen icons, accessible Reset App Settings screen - #683

Open
Mansimran Singh (Mansimran-Singh) wants to merge 8 commits into
mainfrom
feature/672/reset-individual-settings
Open

Reset Individual Settings: per-category reset, remove per-screen icons, accessible Reset App Settings screen#683
Mansimran Singh (Mansimran-Singh) wants to merge 8 commits into
mainfrom
feature/672/reset-individual-settings

Conversation

@Mansimran-Singh

Copy link
Copy Markdown
Collaborator

Summary

  • Adds per-domain settings resets (Voice, Timing/Sensitivity, Selection Mode, Categories, Phrases) and a granular "Reset Vocable" screen with per-domain selection plus a separate "Reset Everything" nuclear option
  • Adds a Reset Category button to EditCategoryMenuScreen for non-custom (preset) categories, styled like and positioned above Remove Category (less-destructive action before the fully-destructive one), gated behind a confirmation dialog
  • Removes the five now-redundant per-screen reset icons (Voice/Sensitivity/Selection Mode/Categories/Phrases) in favor of the centralized Reset Vocable screen
  • Reworks the Reset Vocable screen for gaze/ALS accessibility: bullet-dot selection indicators, full-row selected-state styling matching other gaze buttons, a domain grid that defaults to one full-width button per row and only adds columns (2, then 3) when vertical space forces it, and measured pagination as a fallback for screens too short to fit even that
  • Scopes the standalone "Phrases" domain reset to non-custom (preset) categories: reverts edits and removes any custom phrases added to a preset category, without touching user-created categories — unlike "Reset Everything", which wipes everything
  • Adds toast feedback ("Reset successful"/"Reset failed") after a reset attempt on the Reset Vocable screen
  • Renames "Reset App" to "Reset Vocable", matching the app's own existing phrasing
  • Includes Match Android typography to iOS font-size scale, consolidate hardcoded text sizes #681's typography-parity fixes via merge (unscaled text sizes, iOS font-size matching) — this PR's diff will shrink once Match Android typography to iOS font-size scale, fix unscaled text sizes #682 merges to main, since those changes will then be common ancestry

Ticket

Closes #672

Type of Change

  • New feature (per-domain/per-category reset)
  • Bug fix (removes duplicate reset affordances; scopes Phrases reset correctly; fixes unscaled Reset Vocable screen layout)
  • Accessibility/UX improvement

Testing

  • ./gradlew compileDebugKotlin testDebugUnitTest — pass
  • ./gradlew assembleDebug assembleDebugAndroidTest — pass
  • ./gradlew connectedDebugAndroidTest for PhrasesUseCaseTest (16 cases) — pass, run against a connected physical device
  • Manually verified the edited-phrase-restore path end-to-end via the live UI on device

Checklist

  • Work-log added/updated: Documentation/work-log/672-reset-individual-settings.md
  • New/updated tests for all touched ViewModels and use cases

🤖 Generated with Claude Code

Adds a reset icon + confirmation dialog to each settings-adjacent screen
(Voice, Timing/Sensitivity, Selection Mode, Categories, Phrases), each
scoped to only its own domain, plus a new "Reset App Settings" screen with
per-domain checkboxes and a separate nuclear "Reset Everything" option
styled in the app's destructive color. Extracts a reusable ConfirmationDialog
composable used by all of the above. Implements #672.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Move the Phrases reset icon off EditCategoriesScreen (which now only
  resets Categories) onto EditCategoryPhrasesScreen, scoped to just that
  one category instead of every phrase app-wide. Adds
  IPhrasesUseCase.resetPhrasesForCategory() to support it.
- Replace the placeholder ic_undo icon with a proper ic_reset drawable.
- Fix reset-icon headers overlapping their screen title: titles weren't
  width-constrained against the new icon, so long text rendered underneath
  it. Bound each title between its two nearest header buttons with
  fillToConstraints + ellipsis.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…pp Settings screen

Adds a Reset Category button to EditCategoryMenuScreen for non-custom categories
(gated like Remove Category, with a confirmation dialog), removes the now-redundant
per-screen reset icons on Voice/Sensitivity/Selection Mode/Categories/Phrases in favor
of the centralized Reset App Settings screen, and reworks that screen for gaze/ALS
accessibility: bullet-dot selection indicators, full-row selected-state styling like
other gaze buttons, a description-free domain grid that defaults to one full-width
button per row and only adds columns (2, then 3) when vertical space forces it, and
measured pagination as a fallback for screens too short to fit even that.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Several screens fell back to flat Material3 defaults instead of this app's own
per-breakpoint dimens.xml convention, most notably the keyboard's letter-key and
typed-input text - traced via git blame to an orphaned dimen left behind by the
2020 Compose rewrite. Wires those (and two similarly orphaned dimens on
EditCategoryMenuScreen/SensitivityScreen) back in, corrects settings_title_text_size's
phone value to match iOS's compact size (tablet already matched), and gives the six
remaining genuine hardcoded text sizes proper per-breakpoint dimens. Font family
(Roboto/San Francisco, each platform's OS default) was already correct on both sides
and is unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tegory

Merges feature/681/typography-parity so this branch picks up the newly-established
per-breakpoint font-size conventions, and applies the same fix to the Reset Category
button (added after that branch diverged, so it still had a hardcoded fontSize).
Also moves Reset Category above Remove Category in EditCategoryMenuScreen's action
list - the less-destructive action reads better before the fully-destructive one -
and swaps the two buttons' reveal priority to match, so a cramped screen still
reveals top-to-bottom in drawn order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…pp -> Reset Vocable

The Reset App Settings screen's standalone "Phrases" checkbox called
resetToDefaults() - the same nuclear method backing "Reset Everything" - which
deleted every custom phrase too (both in preset categories and user-created ones).
A domain reset should only put back content that has a default to return to, so adds
IPhrasesUseCase.resetPresetPhrasesToDefaults(), which only touches preset-derived
("shadow") phrases across preset categories, identified by their array-entry-name
phraseId per RoomPresetPhrasesRepository's existing shadow-detection invariant -
genuinely custom phrases anywhere are left untouched. Also renames "Reset App" to
"Reset Vocable", matching the app's own existing phrasing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…d toast feedback

resetPresetPhrasesToDefaults() only removed shadow (edited) phrases within preset
categories, leaving newly-added custom phrases behind - found via live device
testing. A preset category's default is the array it was seeded from, so any
deviation since (edit or addition) should revert; corrected the method to wipe
every stored phrase per real preset category (excluding Recents/My Sayings, which
have no default set) before repopulating, reusing the same shape
resetPhrasesForCategory already uses for a single category. Removes the now-unused
StoredPhrasesRepository.getAllPhrases() added for the old (too-narrow) filter.

Also adds toast feedback after a reset completes - the screen previously gave no
indication either way - via a ResetSettingsEvent.ShowResetResult(success) event
matching the existing KeyboardEvent.ShowToast convention, with confirmDialog()
now catching (and reporting) failures without swallowing coroutine cancellation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Reset Individual Settings

1 participant