Skip to content

feat(note-list): add option to disable swipe actions#3088

Open
markus-kreft wants to merge 1 commit intonextcloud:mainfrom
markus-kreft:feat/disable-swipe-actions
Open

feat(note-list): add option to disable swipe actions#3088
markus-kreft wants to merge 1 commit intonextcloud:mainfrom
markus-kreft:feat/disable-swipe-actions

Conversation

@markus-kreft
Copy link

This PR adds a toggle in Settings > Appearance and behavior to enable or disable swipe gestures (delete and favorite) in the note list.

Motivation

Destructive actions like deletion can currently be triggered too easily by accident. I experienced this when I unknowingly deleted a note via a swipe and only noticed it two weeks later. While the "Undo" snackbar is helpful, it is easy to miss. This option allows users to make deletions more intentional via the long-press menu.

Changes

  • New Setting: "Swipe actions" toggle in the settings menu.
  • Default Enabled: Swipe actions are enabled by default, so existing behavior is preserved.
  • Gesture Control: Deactivates ItemTouchHelper gestures when the setting is toggled off.
  • Consistent UI: Added a matching grey-tinted icon (ic_swipe_grey600_24dp.xml) for the settings entry.

Testing

  • Verified build and unit tests pass.
  • Manually tested on physical device (debug build) to confirm the toggle correctly enables/disables swipe gestures.

Addresses #1774

Add a toggle in the "Appearance and behavior" settings to enable or
disable swipe gestures (delete and favorite) in the note list.

The default value is set to enabled, preserving existing behavior while
allowing users who accidentally trigger these actions to disable them.

Changes:
- Add `swipe_actions` preference to `preferences.xml`
- Add `isSwipeEnabled` global state in `NotesApplication`
- Update `NotesListViewItemTouchHelper` to respect the setting
- Create `ic_swipe_grey600_24dp.xml` for the settings icon
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