Skip to content

Feat/settings update check - #9

Merged
ghostcoder42 merged 8 commits into
mainfrom
feat/settings-update-check
Sep 5, 2026
Merged

ghostcoder42 merged 8 commits into
mainfrom
feat/settings-update-check

Conversation

@ghostcoder42

Copy link
Copy Markdown
Owner

No description provided.

The version row in Settings was static text. It is now an update
check against the repo's latest GitHub release (public REST endpoint,
no auth; releases are cut with np so tag/name/body carry the version,
title and changelog):

- entering Settings runs an automatic check — failures are silent,
  and a found update only switches the row to 'Update available' with
  the latest version number;
- tapping the row runs a manual check with a spinner on the value:
  a newer release opens a dialog (version, release title, notes with
  markdown links flattened), being up to date gets a toast, and a
  failure opens a dialog carrying the classified network wording
  (offline / timeout / rate limit / 5xx with status) shared with the
  list-page toasts;
- the timestamp of the last check is recorded in MMKV for future use.

Version comparison is numeric per component, so 0.10.0 correctly
supersedes 0.9.0. Strings localized in all seven app languages.
GitHub release bodies use CRLF line endings; the leftover \r glues
multi-line notes into a single line on Android. Notes cleaning now
normalizes \r\n first and also flattens headings, emphasis/code markers
and list bullets (•), instead of only stripping links. The length cap
rises to 2000 chars — the update dialog scrolls, so notes no longer
need aggressive truncation.
The update dialog needs more than version + notes: the release page
URL (every platform), the direct APK asset link and size when the
release ships one (EAS builds attach r34-<version>.apk), and the
publication timestamp. Payload parsing is now strict — a tag that
isn't a plain dotted number makes the whole release unusable instead
of silently comparing garbage versions.
The 'update available' hint lived only in hook state, so it vanished on
every app restart until Settings re-fetched successfully. The last
successful check is now persisted (version + release metadata): the
hint is seeded on mount — visible immediately, even offline — and a
stale hint whose version no longer beats the installed one is not
seeded back after the user updates.
The new-release announcement was a system Alert, whose height can't be
capped — long changelogs would flood the screen. It is now an in-app
card clamped to 80% of the screen with the body scrolling inside,
showing the version comparison, release date (ISO slice, Hermes-safe),
APK size when the release ships one, and the flattened notes.

'Update now' opens the direct APK asset on Android (EAS attaches
r34-<version>.apk per release) and the release page everywhere else;
backdrop or Cancel dismisses, keeping the hint row. Dialog strings
localized in all seven app languages.
The 'Update available' row now shows the new version in danger red and
semibold, so the hint reads at a glance instead of blending into the
muted value styling of the other rows.
Checking on every Settings visit was noisy and unnecessary — GitHub's
anonymous rate limit aside, release cadence is daily at most. The check
timestamp now lives in a small zustand store backed by MMKV
(update-check-store) and the automatic check only runs when the last
successful check is older than 24h (survives restarts; failures don't
count and retry on the next visit). Manual checks always run.

The persisted-release hint is unaffected: on throttled visits the row
still seeds from the last known outcome, so a found update stays
visible.
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

💯 Test Coverage

Lines Statements Branches Functions
Coverage: 56%
56.12% (958/1707) 48.91% (518/1059) 46.26% (248/536)

😎 Tests Results

Tests Skipped Failures Errors Time
301 0 💤 0 ❌ 0 🔥 20.13s ⏱️
👀 Tests Details • (56%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files56.1248.9146.2656.58 
src/app/(app)5.113.224.315.26 
   settings.tsx000025–330
src/components69.448054.5470.58 
   update-dialog.tsx10086.6610010034, 71
src/lib8579.3173.0786.66 
   updater.ts92.1589.1372.7293.61103, 160–164
src/lib/hooks58.8544.5471.1158.72 
   use-update-check.ts10095.4587.5100104
src/lib/r3485.2479.577685.71 
   fetch-error.ts100100100100 
src/lib/stores96.790.3897.498.66 
   update-check-store.ts88.881007587.537

The update check swapped the version text out for the spinner, hiding
the very number the row exists to show — the spinner now renders left
of the value. Both version displays (current and available update)
carry a 'v' prefix, matching the release tags.
@ghostcoder42
ghostcoder42 merged commit 0ef7a0e into main Sep 5, 2026
1 check passed
@ghostcoder42
ghostcoder42 deleted the feat/settings-update-check branch September 5, 2026 07:08
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