Skip to content

fix(highlights): staging-test fixes — dialog button, overlay reconciliation, per-verse delete (YPE-1034, PR 4)#287

Draft
cameronapak wants to merge 2 commits into
claude/ype-1034-pr3-recent-colorsfrom
claude/ype-1034-pr4-jam-fixes
Draft

fix(highlights): staging-test fixes — dialog button, overlay reconciliation, per-verse delete (YPE-1034, PR 4)#287
cameronapak wants to merge 2 commits into
claude/ype-1034-pr3-recent-colorsfrom
claude/ype-1034-pr4-jam-fixes

Conversation

@cameronapak

@cameronapak cameronapak commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Description

PR 4 of the YPE-1034 stack (stacked on the PR 3 branch — retarget as layers merge). Fixes five issues found by forensic triage of a real staging test session (Jam recording, console + network capture correlated with code):

  1. Invisible primary button (ships to prod) — the Button default variant was bg-background + text-primary-foreground = white-on-white in light theme; the permission dialog's Continue button was unusable. Now the standard bg-primary pairing; YouVersionAuthButton explicitly pins its old neutral surface (it depended on the broken variant). Verified high-contrast in both themes.
  2. Overlay reconciliation vs read-after-write lag — the seam hook dropped optimistic overlay entries as soon as the next GET landed; under staging/prod replica lag that erased the user's just-made change (flicker on apply, resurrection on remove, "sometimes it doesn't save" on prod). Overlay entries now retire only when a fetch actually reflects the write. Accepted trade-off (documented in changeset, pending product sign-off before flag flip): a concurrent same-verse edit from another device renders stale until navigation/next write.
  3. One refetch per batch — writes previously triggered one GET per contiguous verse run (highlighting verses 2,3,5 = 2 POSTs + 2 GETs). Hooks-layer auto-refetch removed; the seam hook refetches exactly once per settled batch, success or failure.
  4. Per-verse DELETE — range DELETEs (JHN.1.2-3) observed failing server-side on staging while POST ranges work; remove now sends one DELETE per verse. Core docstring updated pending API-team confirmation on range-delete support.
  5. Fade-in — highlight fills transition in (250ms ease, prefers-reduced-motion honored) instead of popping.

Adversarially reviewed; the review's must-fix (partial batch failure reverted succeeded sub-writes with no refetch, recreating ghost highlights) is fixed in d083ffe with per-sub-write settlement and partial-failure tests.

Verification

865 tests green (core 334, hooks 285, ui 246), typecheck + lint clean, independently verified.

Related Issues

Relates to YPE-1034
Stacked on PR 3 (#286); full stack: #283#285#286 ← this

🤖 Generated with Claude Code

cameronapak and others added 2 commits July 10, 2026 16:24
- ui: default button variant now bg-primary/text-primary-foreground
  (was white-on-white in light theme, making the permission dialog's
  Continue button invisible). YouVersionAuthButton pins bg-background so
  its brand surface is unchanged.
- ui: retire the optimistic overlay only once a fetch reflects the write,
  so read-after-write lag no longer flickers a highlight out/back (apply)
  or resurrects a removed one (remove).
- hooks/ui: stop refetching per write; the seam hook coalesces to one
  refetch per settled batch.
- core/ui: send one DELETE per verse instead of a range (range delete
  is unsupported server-side); docstring updated to stop claiming it.
- core styles: fade highlight fills in/out (~250ms, reduced-motion aware).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…re too

An adversarial review caught a regression from the refetch coalescing: on
ANY failure the whole batch's overlay reverted and no refetch fired, so
sub-writes that succeeded server-side vanished from the UI (apply) or
resurrected as ghosts (per-verse remove) until the next navigation/write.

- runApply / runRemove / the resume-path write now track each sub-write's
  outcome: succeeded runs/verses register for reconciliation (overlay holds
  until a fetch reflects them), only truly-failed verses revert.
- Exactly one refetch per batch, success or failure, restoring the
  self-correction the per-write auto-refetch used to provide.
- Integration tests for partial apply failure, partial remove failure
  (no ghosts), and all-fail; the overlay-retirement test now distinguishes
  retired from still-masking via a divergent server color.
- Changeset notes the partial-failure semantics and the accepted
  concurrent-edit staleness trade-off (pending product sign-off).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d083ffe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@youversion/platform-core Patch
@youversion/platform-react-hooks Patch
@youversion/platform-react-ui Patch
vite-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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