Skip to content

fix(trash): key trash rows and slim the action buttons - #300

Merged
jeiel85 merged 1 commit into
mainfrom
fix/trash-hardening
Aug 13, 2026
Merged

fix(trash): key trash rows and slim the action buttons#300
jeiel85 merged 1 commit into
mainfrom
fix/trash-hardening

Conversation

@jeiel85

@jeiel85 jeiel85 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses the two hardening candidates recorded for v2.32.3 in the standing tracker (#262) after the #298 trash-actions fix (PR #299). Both are small, pre-existing issues in TrashScreen.kt — neither was introduced by the #298 fix.

1. Key the trash list rows

items(trashedNotes)items(trashedNotes, key = { it.id }).

TrashScreen was the last items() call in the app without a key — ArchiveScreen, LockedNotesScreen, NotesListScreen, SearchScreen, SyncCenterScreen and QuickSwitcherDialog all pass one. Without a key, LazyColumn tracks rows by position, so restoring or deleting a note could leave the wrong row briefly visible or animate incorrectly. Note.id is a Room @PrimaryKey (UUID), so keys are unique.

2. Slim the inline action buttons

The inline Restore/Delete actions switch from Button to TextButton — the standard Material 3 pattern for list-row actions. TextButton's smaller horizontal padding (~24dp less per button) leaves the title more room on narrow screens with long localized labels (e.g. German "Wiederherstellen"), while both actions stay visible and tappable. This also gives the #298 title-ellipsis fix more headroom, since the title's weight(1f) region grows as the buttons shrink.

The AlertDialog's "Delete forever" confirm stays a filled Button on purpose — it is the destructive confirmation, while the inline Delete is only the entry point that opens the dialog.

Verification

Notes

  • No new tests: key behavior is framework-internal (consistent with every other screen), and the existing regression test already covers the visible-buttons contract.
  • Non-blocking follow-up (delete button in error color) left as a hardening candidate rather than bundled here.

Addresses two hardening candidates from the #298 review (PR #299):

- items(trashedNotes) now passes key = { it.id }, matching every other
  list screen (archive, locked, search, notes). Without a key LazyColumn
  tracks rows by position, so restoring or deleting a note could leave
  the wrong row briefly visible or animate incorrectly.
- The inline Restore/Delete actions switch from Button to TextButton,
  the standard Material 3 pattern for list-row actions. TextButton's
  smaller horizontal padding (~24dp less per button) leaves the title
  more room on narrow screens with long localized labels (e.g. German
  'Wiederherstellen'), while both actions stay visible and tappable.
@jeiel85
jeiel85 merged commit ae865da into main Aug 13, 2026
5 checks passed
jeiel85 added a commit that referenced this pull request Aug 13, 2026
Ships the trash-list hardening from PR #300: trash rows are keyed by
note id (the last key-less items() call in the app), and the inline
Restore/Delete actions are now Material 3 text buttons, giving long
localized labels (e.g. German) more room for the title on narrow screens.

- versionCode 125 -> 126, versionName 2.32.3 -> 2.32.4
- CHANGELOG.md and CHANGELOG.ko.md gain the v2.32.4 section
- seven store-locale 126.txt: 195 characters in English, 258 at the
  longest, every locale keeping well below the 500 cap
- landing x7 (softwareVersion, release-line, trust-ledger) and README x7
  release links move to v2.32.4; the figcaption screenshot version stays
  at v2.23.0, which is what it documents
- HISTORY.md records the two hardening candidates and their fixes (PR #300)
jeiel85 added a commit that referenced this pull request Aug 13, 2026
#302)

* release: v2.32.4 (versionCode 126)

Ships the trash-list hardening from PR #300: trash rows are keyed by
note id (the last key-less items() call in the app), and the inline
Restore/Delete actions are now Material 3 text buttons, giving long
localized labels (e.g. German) more room for the title on narrow screens.

- versionCode 125 -> 126, versionName 2.32.3 -> 2.32.4
- CHANGELOG.md and CHANGELOG.ko.md gain the v2.32.4 section
- seven store-locale 126.txt: 195 characters in English, 258 at the
  longest, every locale keeping well below the 500 cap
- landing x7 (softwareVersion, release-line, trust-ledger) and README x7
  release links move to v2.32.4; the figcaption screenshot version stays
  at v2.23.0, which is what it documents
- HISTORY.md records the two hardening candidates and their fixes (PR #300)

* fix: harden editor jump, view-state pruning, and retitle resume (#262)

- Jump to end control now counts wrapped render lines, so notes made of a few long paragraphs get the control.
- note_view_state rows are pruned when Open notes at leaves LAST_POSITION.
- Editor position save keeps the other surface's value in memory instead of reading the row back on every debounced write.
- A retitle pass interrupted by process death resumes on the next open of settings via a retitlePending flag.
jeiel85 added a commit that referenced this pull request Aug 13, 2026
… mirror path (#262) (#303)

* release: v2.32.4 (versionCode 126)

Ships the trash-list hardening from PR #300: trash rows are keyed by
note id (the last key-less items() call in the app), and the inline
Restore/Delete actions are now Material 3 text buttons, giving long
localized labels (e.g. German) more room for the title on narrow screens.

- versionCode 125 -> 126, versionName 2.32.3 -> 2.32.4
- CHANGELOG.md and CHANGELOG.ko.md gain the v2.32.4 section
- seven store-locale 126.txt: 195 characters in English, 258 at the
  longest, every locale keeping well below the 500 cap
- landing x7 (softwareVersion, release-line, trust-ledger) and README x7
  release links move to v2.32.4; the figcaption screenshot version stays
  at v2.23.0, which is what it documents
- HISTORY.md records the two hardening candidates and their fixes (PR #300)

* test: cover sync-frontmatter round-trip invariants and preview-toggle mirror path (#262)

- Property-based SyncFrontmatter tests: encode->decode round-trips every field and unknown entry; decode->encode->decode leaves foreign entries and body unchanged.
- PreviewToggleReachesMirrorTest (androidTest): the #219 checkbox toggle now verified to land in the note and in the synced mirror file, not just the callback and string edit.
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.

1 participant