Repository navigation
fix(ui): retain highlight colors in usePassageStyle while dimmed (YPE-6539) - #302
Merged
Merged
Conversation
Dustin-Kelley
left a comment
Collaborator
There was a problem hiding this comment.
Posted by Grok Bot on behalf of @Dustin-Kelley.
Looks ready: 0 blocking, 3 non-blocking. The fix covers both YPE-6539 acceptance points (dimmed outgoing chapter keeps its last fills, tested for Reader and BibleTextView), and the sign-out leak is fixed in caf40c3 with tests. The PR's 3 suites pass locally (92 tests) and CI is green.
Dustin-Kelley
approved these changes
Dec 4, 2026
Dustin-Kelley
left a comment
Collaborator
There was a problem hiding this comment.
works so i'm approving! You can decide if you wan't to do those nits
…helper (YPE-6539)
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.
Why
Keep highlight fills on the dimmed outgoing chapter while the next chapter loads (YPE-6539). When navigation changes the chapter or reference,
highlightsswitches immediately to the new scope whileusePassagestill renders the outgoing passage dimmed.usePassageStylederived colors against the new scope and dropped the outgoing fills.What changed
isCurrent(defaulttrue) tousePassageStyleinpackages/ui/src/native/scripture/passage-style.ts.ServerColorsperpassage.keyin state whenisCurrentistrue, and reused those colors whenisCurrentisfalsefor the samepassage.key.isCurrentfromBibleReaderNativeandBibleTextViewNative.bible-reader-native.test.tsxandbible-text-view.test.tsx, plus hook tests inpassage-style.test.tsx.@youversion/platform-react-native-expo-ui.Scope
packages/ui/src/native/scripture/passage-style.tspackages/ui/src/native/bible-reader-native.tsxpackages/ui/src/native/bible-text-view-native.tsxpackages/ui/src/native/__tests__/bible-reader-native.test.tsxpackages/ui/src/native/__tests__/bible-text-view.test.tsxpackages/ui/src/native/scripture/__tests__/passage-style.test.tsx.changeset/ype-6539-dimmed-chapter-highlights.mdTradeoffs
ServerColorsin React state during render instead of a ref because oxlint enforcesreact-hooks/refs.sameColors(with an identity fast path) instead of identity alone becauseuseHighlightPaintinBibleTextViewNativecan return a fresh empty array on re-render.Blast Radius
BibleReaderNativeandBibleTextViewNativepassisCurrent.PassageEmbedkeeps the defaulttruebecause it swaps to a spinner instead of dimming stale passages.Verification
pnpm --filter @youversion/platform-react-native-expo-ui test -- packages/ui/src/native/__tests__/bible-reader-native.test.tsx packages/ui/src/native/__tests__/bible-text-view.test.tsx packages/ui/src/native/scripture/__tests__/passage-style.test.tsx: 3 suites, 87 tests passed (the two new dimmed-transition tests failed before the fix).pnpm --filter @youversion/platform-react-native-expo-ui test: full UI test suite passed.CI=true pnpm typecheck: 5/5 tasks passed.pnpm lint: 0 warnings, 0 errors.Confidence Score: 5/5

The PR appears safe to merge; no blocking issues remain.Summary
Keeps saved highlight fills on outgoing passages while the next passage loads.
The earlier, unnumbered sign-out finding is fixed: changing the user prevents saved colors from being reused and clears them from state.
Reviews (3) · Last reviewed commit: "refactor(ui): flatten passage-style rete..." · Reviewed by Greptile