Skip to content

Conversation

@stuartbreckenridge
Copy link
Member

@stuartbreckenridge stuartbreckenridge commented Jan 7, 2026

This PR will fix #4921 and provides the following enhancements:

Rewrite encode():

  • Remove file removal checks, writing data will replace
  • Compare existing widget data to new data and determine which widgets actually need refreshed

Refactor flushSharedContainer to removeStaleFaviconsFromSharedContainer:

  • No longer nuked in full
  • Only favicons not accessed in the last seven days are deleted (in DEBUG builds this is 30 seconds)

Improve writeImageDataToSharedContainer:

  • Favicons now use their md5 digest instead of a UUID (thus one image per feed, instead of one image per article)
    • Previously, if one feed had seven articles in unread, today, and starred, the code would have saved 21 favicons to storage. It now writes 1 favicon to storage—a 95% reduction.
  • If the favicon exists it is not rewritten

Add reloadTimelines:

  • Compares existing article arrays to new article arrays and will only reload specific widget timelines where there is a difference.
  • LatestArticle now conforms to Hashable to make this possible.

Improve SceneDelegate selection logic:

  • select the correct feed before selecting the article

Widget encoding is now synchronous:

  • when wrapped in Task { @MainActor in } the encode() function doesn't have time to complete before requesting a timeline refresh; it's now synchronous.

NEW Lock Screen Summary Widget:

  • added a new lock screen summary widget
Simulator Screenshot - iPhone 17 - 2026-01-08 at 18 58 20

@stuartbreckenridge stuartbreckenridge marked this pull request as draft January 7, 2026 13:13
brentsimmons and others added 13 commits January 7, 2026 11:26
…use non-optional method). Make sure accessToken doesn’t have a trailing \n character.
Change widget update policy to never to give app more control of refresh timings.
Rewrite `encode()`:
- Remove file removal checks, writing data will replace
- Compare existing widget data to new data and determine which widgets actually need refreshed

Refactor `flushSharedContainer` to `removeStaleFaviconsFromSharedContainer`:
- No longer nuked in full
- Only favicons not accessed in the last seven days are deleted (in DEBUG builds this is 30 seconds)

Improve `writeImageDataToSharedContainer`:
- Favicons now use their md5 digest instead of a UUID (thus one image per feed, instead of one image per article)
- If the favicon exists it is not rewritten

Add `reloadTimelines`:
- Compares existing article arrays to new article arrays and will only reload specific widget timelines where there is a difference.
- `LatestArticle` now conforms to `Hashable` to make this possible.

Improve `SceneDelegate` selection logic:
- select the correct feed before selecting the article
When the widget encoding is completed asynchronously and wrapped in `Task { @mainactor in }`, the app rarely (if ever) refreshes the widget unless attached to the debugger (in which case, unhelpfully, it works fine).

My thinking is that the app is being terminated _before_ `encode` is complete and therefore the call to refresh widget timelines is not happening consistently.

Moving the widget to synchronous encoding has resolved the widget refresh behaviour.
Improve `SceneDelegate` selection logic:
- select the correct feed before selecting the article
@stuartbreckenridge stuartbreckenridge marked this pull request as ready for review January 8, 2026 10:59
@brentsimmons brentsimmons merged commit 306f4ea into Ranchero-Software:main Jan 8, 2026
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.

Improve Widget Performance

2 participants