Skip to content

fix(android): don't turn previous Journal answers into today's evidence - #115

Draft
kvnloo wants to merge 3 commits into
mainfrom
fav/fix-android-don-t-turn-previous-jour-53
Draft

kvnloo wants to merge 3 commits into
mainfrom
fav/fix-android-don-t-turn-previous-jour-53

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Problem (upstream)

On the current ryanbr/noop Android Insights Journal, opening a blank today silently saves yesterday's Yes and No as native today's answers. A screen visit fabricates controls/observations for behavioural correlations. This is distinct from the already-merged never-answered partition fix ryanbr/noop#682 and its subsequent #1768 work. Originating fork tracker: kvnloo/noop#70.

Supersedes #53. The old fork PR was against 8e4b0c1; this successor applies only its three-file diff to kvnloo/noop main at 2a1de7609843b095505274ad6fc811757210be80 (identical to upstream main when read), not its stale ancestry.

Root cause (at 2a1de7609843b095505274ad6fc811757210be80)

  • android/app/src/main/java/com/noop/ui/InsightsScreen.kt:242-268: the read effect falls back to journalDayKey(1L) and calls vm.repo.upsertJournal whenever native today is empty; the screen's read causes a durable write before an explicit tap.
  • InsightsScreen.kt:341-350: the pre-filled notice implies a harmless suggestion, although rows were already saved.
  • android/app/src/main/java/com/noop/ui/JournalLog.kt:91-108: merge and day-key helpers exist; the screen needs a selection-only day-answer helper, not an implicit backfill.

Change

  • Keep Journal day selection read-only: select only native rows explicitly logged for the chosen day, preserving explicit false versus no row and last same-day edit.
  • Delete the passive previous-day upsert and its misleading pre-filled UI notice.
  • Add the original five JournalExplicitDayAnswersTest JUnit regressions.
  • Android-only screen behavior. Swift/macOS/iOS already perform selected-day read-only lookup; no Swift data/analytics parity change needed. No new UI strings (one existing message is no longer shown), design tokens untouched; no BLE, scoring, schema, import, backup, network, or permission changes.

Tests

Not run on this successor head 68c7ccfa53c2ef01abaef9e9fe907076dcc79194: GitHub Actions is disabled for this fork; no run dispatched. Original #53's October 19 PASS belonged to the old head d58cd99b5d934ea91ca43144c4bc659065983922, not this head.

Five JVM cases (hand-checked expectations):

  1. Yesterday has two observations (Yes and No); unlogged today returns an empty map and yesterday still returns the two keys.
  2. Explicit today No returns one false; a yesterday-only Yes never enters today.
  3. Two same-day edits No then Yes resolve to Yes; the other day's row is excluded.
  4. Dec 31 No does not turn into Jan 1 No: Jan 1 empty, Dec 31 false.
  5. 2028-02-28 + 1 day = 2028-02-29, 2028-02-29 + 1 day = 2028-03-01; Mar 1 empty, explicit Feb 29 No retained.

Exact-head command: cd android && ./gradlew --no-build-cache --rerun-tasks testFullDebugUnitTest compileFullDebugKotlin assembleFullDebug.

Applicable upstream checks for android/** (read directly from workflow YAML at the base SHA): Android CI / build-and-test, i18n Coverage / check, Source Hygiene / doc-comments, Tools Python CI / linux-capture. Swift Packages CI and App build (macOS + iOS) are not triggered by these Android-only paths.

Hardware needed

No physical strap or BLE hardware: this is local Journal display/persistence. Optional Android device QA: open a fresh day, confirm no fabricated row; explicitly tap Yes and No and re-open/restart; cross midnight, year, and leap-day wake-key boundaries.

Upstream readiness

One concern; original three-file patch reproduced on current upstream-mirrored main (4/36 screen, +13 helper, +70 test lines); all written files re-read identically. Upstream PR searches for Journal/Insights/prefill/carry-forward found no matching open duplicate; upstream #2765 is an unrelated SwiftUI Today-card load fix. Fork #56 was closed as a duplicate of original #53; fork #58 proposes a different opt-in copy UI and is not included.

Pending independent exact-head Android/JVM run, Android UI QA and owner review. This is a downstream-only Draft; do not open or comment upstream without separate owner approval.

Implemented by ChatGPT (mobile app, GitHub connector) for Kevin's NOOP factory.

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