fix: show "Loading note…" in single-note widget on boot instead of "Note not found"#3198
Open
jancborchardt wants to merge 1 commit into
Open
fix: show "Loading note…" in single-note widget on boot instead of "Note not found"#3198jancborchardt wants to merge 1 commit into
jancborchardt wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
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.
cbd86fb to
6bbb41e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6bbb41e to
58705b1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Three distinct states are now handled correctly: - Startup / system update: the widget shows "Loading note…" while the RemoteViewsAdapter connects. updateAppWidget() sets the placeholder visible with that text on every full reset (ACTION_APPWIDGET_UPDATE). - Note refresh (edit or sync): updateSingleNoteWidgets() now sends a custom ACTION_DATA_CHANGED instead of ACTION_APPWIDGET_UPDATE. onReceive() handles this with notifyAppWidgetViewDataChanged() only, leaving the existing RemoteViews intact so the note content updates in place with no blank gap or flash. - Note missing: once onDataSetChanged() confirms getNoteById() returns null, partiallyUpdateAppWidget() sets the placeholder visible with "Note not found". When the note is found the placeholder is hidden via the same mechanism. Fixes #1611 AI-assisted: Claude Code (Sonnet 4.6) Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
58705b1 to
e5a4dab
Compare
Contributor
|
APK file: https://github.com/nextcloud/notes-android/actions/runs/26315257316/artifacts/7171529308 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onDataSetChanged()runs and confirms the note is genuinely absent from the database,partiallyUpdateAppWidget()switches the placeholder to "Note not found"// TODO Set loading viewcomment that was tracking this gapHow it works
The widget uses a
ListViewwithsetEmptyViewpointing to a placeholderTextView. That placeholder is visible any timegetCount()returns 0 -- including during the brief window on phone boot before theRemoteViewsServicehas connected and populated data. By defaulting to "Loading note…" in the layout and only updating to "Note not found" when the note is confirmed missing, we avoid the false negative.Test plan
Fixes #1611
🤖 Generated with Claude Code