Skip to content

feat(widget): add interactive notes widget#3215

Open
loloakira wants to merge 1 commit into
nextcloud:mainfrom
loloakira:feature/widget-evolution
Open

feat(widget): add interactive notes widget#3215
loloakira wants to merge 1 commit into
nextcloud:mainfrom
loloakira:feature/widget-evolution

Conversation

@loloakira
Copy link
Copy Markdown

Description

This PR adds a new home-screen widget called Interactive notes — a third
widget alongside the existing single-note and note-list widgets, which are
left unchanged.

What it does

  • Shows notes as a scrollable single column of rounded cards.
  • Each card shows the note title and a multi-line content excerpt (the whole
    note when it is short).
  • Tapping a card opens that specific note; a floating "+" button in the
    bottom-right creates a new note in the widget's configured category/account.
  • The favourite star is shown as a non-clickable indicator.
  • Per-widget configuration adds sort options: a "favourites on top" toggle and
    a newest-first / oldest-first order.
  • Reconfigurable via long-press on Android 12+, with a live previewLayout in
    the widget picker.

Implementation notes

  • Reuses the existing NotesListWidgetData storage and excerpt generation —
    no database migration.
  • Sort options are stored in per-widget SharedPreferences; notes are sorted
    in memory.
  • New source strings were added to values/strings.xml only (translations are
    handled by Transifex).
  • The two existing widgets and the shared data layer are untouched.

Tested

  • ./gradlew assembleDevDebug and ./gradlew lintDevDebug pass.
  • Manually verified on a device (Android 14): open note, create note, sort
    options, reconfiguration, light/dark mode.

🖼️Screenshots

🏚 Before 🏡 After
No equivalent widget interactive_note_list_widget_preview

🏁 Checklist

  • 🧪 Tests written, or not not needed (no unit tests exist for widgets; verified manually + lint)

Developed with AI assistance (Claude Code 2.1.162, Claude Opus 4.8).

Add a third home-screen widget, "Interactive notes", that shows notes as a scrollable single column of rounded cards. Each card shows the note title and a multi-line content excerpt (the whole note when it is short). Tapping a card opens that specific note; a floating button in the bottom-right creates a new note in the widget's configured category/account. The favourite star is a non-clickable indicator.

The per-widget configuration adds sort options: a "favourites on top" toggle and a newest-first / oldest-first order. The widget is reconfigurable via long-press on Android 12+ and provides a live previewLayout for the widget picker.

Reuses the existing NotesListWidgetData storage (no database migration) and the existing excerpt generation; sort options are kept in per-widget SharedPreferences. The two existing widgets and the shared data layer are left unchanged.

AI-assistant: Claude Code 2.1.162 (Claude Opus 4.8)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: loloakira <6253351+loloakira@users.noreply.github.com>
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

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.

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