Skip to content

Settings › Swipe actions: choose what swiping left or right does per list - #139

Merged
mapgie merged 1 commit into
mainfrom
claude/customizable-swipe-actions-g3rhxw
Sep 12, 2026
Merged

Settings › Swipe actions: choose what swiping left or right does per list#139
mapgie merged 1 commit into
mainfrom
claude/customizable-swipe-actions-g3rhxw

Conversation

@mapgie

@mapgie mapgie commented Sep 12, 2026

Copy link
Copy Markdown
Owner

What

A new Settings page, Swipe actions (under Personalisation), lets the user pick what swiping a card left and right does, separately for chores, tasks and reminders. Each direction can be set to:

List Offered
Chores Nothing, Log, Snooze, Archive
Tasks Nothing, Done, Archive, Delete
Reminders Nothing, Done, Snooze, Archive, Delete

Chores have no Delete (a chore is a tags row; it retires by archiving). Tasks have no Snooze. Defaults reproduce the behaviour before this change: chores log right / snooze left, tasks complete right / nothing left, reminders done left / delete right.

How

  • data/model/SwipeAction.kt: SwipeAction, SwipeDirection, SwipePair, SwipeSubject (per-list allow-list and default) and SwipeSettings. Pure Kotlin, pinned by SwipeActionTest.
  • SettingsRepository stores one DataStore key per list and direction. An unknown or unsupported stored name falls back to that list's default for the direction at read time.
  • SwipeSubScreen uses a new CozyChoiceChips pill picker (wrapping row, radio semantics, 44dp targets) since four or five options do not fit the segmented control.
  • ui/components/core/SwipeActionBackground.kt draws the reveal panel for all three cards and maps the Compose dismiss enum to left/right in one place (LESSONS Bump mapgie/android-Actions/.github/workflows/codeql.yml from 87b0b6408e7168235e4977377add51c312ebab71 to 252cf0054ab486b6aa3e87563bc12146d97ff891 #51). Delete alone uses the error container.
  • The three list cards take a SwipePair and an onSwipe callback. enableDismissFrom* follows the setting, so a direction set to Nothing does not drag. Callbacks read the setting through rememberUpdatedState because the dismiss state captures confirmValueChange once (LESSONS fix: switch to XML font resources so Nunito/Lora render on first frame #59, added).

New actions reachable by swipe:

  • Chore archive, with Undo.
  • Task archive (TaskRepository.archiveTask; linked reminders are silenced and restored the same way as done/undone, now shared helpers) with Undo, and task delete behind the same confirmation as the edit sheet.
  • Reminder snooze: ReminderDto.snoozedBy moves the next ring one hour later than now or the pending ring, brings a rung once-only memo back to Active, leaves a tag-alarm alone (its Snooze direction is disabled on the card). Undo writes the earlier record back via ReminderRepository.replace. Reminder archive with Undo.
  • Done on an already done task or reminder now restores it instead of marking it done again.

Tests

  • SwipeActionTest: defaults per list, allow-lists, Nothing disables one direction, sanitising and resolving stored names, labels, per-list updates.
  • ReminderModelTest: four snoozedBy cases (waiting, already rung, repeating, tag-alarm).
  • TaskPayloadTest: archive payload.

Also: help sheet tip, changelog fragment (minor), a11y_check.py clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XvuHjkqiBGSFa6MxdE79aw


Generated by Claude Code

Chores, tasks and memos each get a left and a right swipe mapped to Done
(log/tick/mark done), Snooze, Archive, Delete or Nothing, within what that
list supports. Defaults match the previous fixed behaviour.

- data/model/SwipeAction.kt: SwipeAction, SwipeDirection, SwipePair,
  SwipeSubject (per-list allow-list + default) and SwipeSettings, pure and
  tested in SwipeActionTest.
- SettingsRepository stores one key per list and direction; unknown or
  unsupported names fall back to that list's default at read time.
- New SwipeSubScreen with a CozyChoiceChips pill picker; nav row under
  Personalisation.
- Shared SwipeActionBackground draws the reveal panel for all three cards;
  toSwipeDirection() maps the Compose enum to left/right (LESSONS #51).
- Chores can now be archived by swipe (Undo); tasks can be archived
  (TaskRepository.archiveTask, reminders silenced/restored with it) or
  deleted (confirm) by swipe; memos can be snoozed an hour
  (ReminderDto.snoozedBy, ReminderRepository.replace) or archived, each
  with Undo. Done on an already done task or memo restores it.
- Callbacks read the live setting through rememberUpdatedState so a card
  that stays in composition follows a changed setting (LESSONS #59).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XvuHjkqiBGSFa6MxdE79aw
@mapgie
mapgie marked this pull request as ready for review September 12, 2026 01:22
@mapgie
mapgie merged commit 654ec37 into main Sep 12, 2026
6 checks passed
@mapgie
mapgie deleted the claude/customizable-swipe-actions-g3rhxw branch September 12, 2026 01:23
mapgie pushed a commit that referenced this pull request Sep 12, 2026
Integrates main's configurable Settings > Swipe actions (PR #139) with this
branch's task work. Resolutions:

- Task swipe uses main's per-list, per-direction SwipeAction system. The
  Delete action routes to this branch's deleteTaskWithUndo, so a deleted
  task (and its reminders) can be restored from the Undo snackbar; the
  edit sheet's delete goes through the same path. Delete is still confirmed
  by the card's dialog first.
- Dropped this branch's hardcoded swipe-left-delete gesture and screen-level
  delete dialog in favour of main's card.
- The task card's tap-to-open change stands: TaskCard no longer takes
  onToggleDone (completion is a swipe or the overview's Mark done).
- Kept both settings axes on TaskUiState (colourAxes and swipe) and both
  feature sets on the view model (colour axes, reminders, delete-with-undo,
  plus main's archiveTask).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sg2m9t6JspJ1MgpXgwCLTX
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.

2 participants