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

@loloakira loloakira commented Jun 4, 2026

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.
  • test DAO + assembleDevDebug/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).

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jun 4, 2026

Not up to standards ⛔

🔴 Issues 1 medium · 12 minor

Alerts:
⚠ 13 issues (≤ 0 issues of at least minor severity)

Results:
13 new issues

Category Results
Documentation 12 minor
Complexity 1 medium

View in Codacy

🟢 Metrics 88 complexity · 7 duplication

Metric Results
Complexity 88
Duplication 7

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.

@loloakira loloakira force-pushed the feature/widget-evolution branch from ce74696 to dede2b6 Compare June 6, 2026 13:49
@loloakira loloakira marked this pull request as draft June 6, 2026 14:19
@loloakira loloakira force-pushed the feature/widget-evolution branch from dede2b6 to c640e96 Compare June 6, 2026 14:24
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 are left unchanged.

So reconfiguration can persist updated settings, the shared createOrUpdateNoteListWidgetData DAO now uses an upsert (REPLACE) conflict strategy instead of a plain insert that aborted on the existing primary key; this is transparent to the non-reconfigurable widgets, which never hit the conflict. A DAO test covers the upsert.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: loloakira <6253351+loloakira@users.noreply.github.com>
@loloakira loloakira force-pushed the feature/widget-evolution branch from c640e96 to db9f75d Compare June 6, 2026 16:24
@loloakira loloakira marked this pull request as ready for review June 6, 2026 16:24
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