Skip to content

feat: remember preview/edit mode per note#3203

Open
jancborchardt wants to merge 1 commit into
mainfrom
feat/per-note-mode
Open

feat: remember preview/edit mode per note#3203
jancborchardt wants to merge 1 commit into
mainfrom
feat/per-note-mode

Conversation

@jancborchardt

@jancborchardt jancborchardt commented May 27, 2026

Copy link
Copy Markdown
Member

In Nextcloud Notes for Android, currently the Preview/Edit toggle in the top right of the note detail view changes this setting for all notes. It would be nice to have the setting remembered implicitly per note.

This is nice if you have some notes which are usually more useful in view-mode, like a packlist or grocery list where you want to check off items.

Summary

  • Adds a noteMode column to the Note table (DB migration 29 → 30) to persist each note's view mode locally
  • When a user explicitly toggles Preview/Edit/Direct Edit, the selected mode is saved immediately to that note
  • Notes that have never been toggled continue to follow the global preference (Settings → Note display mode) unchanged
  • Also commits the missing 29.json schema file required for the existing @AutoMigration(from = 28, to = 29)

Resolves the existing TODO comment in EditNoteActivity.close():

TODO enhancement: store last mode in note

How it works

getPreferenceMode() now checks the note's stored noteMode first, and only falls back to the global SharedPreference if no per-note mode is set. changeMode() persists the new mode to the note immediately on toggle.

Test plan

  • Open a note → toggle to Preview → back out → re-open: should open in Preview
  • Open a different note that was never toggled: should open in the global default mode
  • Change Settings → Note display mode: notes with no per-note mode should follow the new setting; notes with a stored mode should not
  • Toggle a note to Edit → close → re-open: should open in Edit
  • Upgrade from a previous install: existing notes should open in the global default (no stored mode), new toggles are remembered

🤖 Generated with Claude Code

@jancborchardt jancborchardt added enhancement 3. to review papercut Annoying recurring UX issue with possibly simple fix. labels May 27, 2026
@jancborchardt jancborchardt moved this to 🏗️ At engineering in 🖍 Design team May 27, 2026
@jancborchardt jancborchardt self-assigned this May 27, 2026
@codacy-production

codacy-production Bot commented May 27, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity

Metric Results
Complexity 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread app/src/main/java/it/niedermann/owncloud/notes/edit/EditNoteActivity.java Outdated
@tobiasKaminsky

Copy link
Copy Markdown
Member

How will this work with?
image

As far as I can see from code side, it would always use per-note setting?
But it should only keep it if last one is selected?
Or do we wanna change this to "First opening behaviour" (and remove "remember").

Then user can select what they want to do with new notes, and all other notes remember their last behaviour?

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/notes-android/actions/runs/28641578560/artifacts/8059004566
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/notes-android/actions/runs/29742449519/artifacts/8461014167
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Adds a `noteMode` column to the Note table (DB version 29 → 30, via
Room @AutoMigration) to persist each note's view mode independently.
When a user explicitly toggles Preview/Edit/DirectEdit, the new mode is
saved immediately to the note. Notes without a stored per-note mode
open in the global default.

The global "Notes opening behaviour" setting now only defines the
opening mode for notes that have never been toggled (Edit/Preview/Direct
edit); the redundant "remember last opened mode" option is removed, as
per-note memory supersedes it.

Resolves the TODO comment in EditNoteActivity.close().

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
@jancborchardt

Copy link
Copy Markdown
Member Author

@tobiasKaminsky yeah, makes sense, adjusted and removed the remember option, as it always remembers. Evveryone who had "Remember last" selected now defaults to "Edit" for untouched notes and their per-note toggles are remembered going forward.

@alperozturk96 your review comments are also addressed. :)

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/notes-android/actions/runs/29743282507/artifacts/8461412104
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted enhancement papercut Annoying recurring UX issue with possibly simple fix.

Projects

Status: 🏗️ At engineering

Development

Successfully merging this pull request may close these issues.

3 participants