+
{`Chapter ${seg.startRef.chapter}`}
)}
@@ -235,8 +232,7 @@ export default function SegmentListView({
isActive={
seg.startRef.book === displayScrRef.book &&
seg.startRef.chapter === displayScrRef.chapterNum &&
- (seg.startRef.verse === displayScrRef.verseNum ||
- (displayScrRef.verseNum === 0 && chapterStartIds.has(seg.id)))
+ seg.startRef.verse === displayScrRef.verseNum
}
onHoverPhrase={setHoveredPhraseId}
onSelect={onSelect}
diff --git a/src/components/controls/ViewOptionsDropdown.tsx b/src/components/controls/ViewOptionsDropdown.tsx
index 276fc973..2d09a747 100644
--- a/src/components/controls/ViewOptionsDropdown.tsx
+++ b/src/components/controls/ViewOptionsDropdown.tsx
@@ -153,9 +153,14 @@ export default function ViewOptionsDropdown({
createPortal(
/* Clicking outside the panel closes it. */
<>
+ {/* The invisible backdrop must stay BELOW the toolbar's stacking context (tw:z-10,
+ from the sticky TabToolbarContainer) so the gear button's onClick — not the
+ backdrop — closes the dropdown. Raising the button instead wouldn't work: the
+ toolbar caps its descendants at z-10 against this portaled sibling.
+ Keep panel (z-30) > backdrop. */}
{
const container = scrollContainerRef.current;
- const { verseNum, chapterNum } = scrRefRef.current;
- const target =
- verseNum === 0
- ? (container?.querySelector(`[data-chapter-start="${chapterNum}"]`) ??
- container?.querySelector('[aria-current="true"]'))
- : container?.querySelector('[aria-current="true"]');
+ const target = container?.querySelector('[aria-current="true"]');
/* v8 ignore next -- the recentered target is always mounted, so its element exists */
if (!target || !container) return;
const spacer = container.querySelector('[data-snap-spacer]');
@@ -458,7 +449,7 @@ export default function useSegmentWindow({
spacer.style.height = `${Math.ceil(remainingOffset)}px`;
target.scrollIntoView({ behavior: 'auto', block: 'start' });
}
- }, [scrollContainerRef, scrRefRef]);
+ }, [scrollContainerRef]);
// Reconcile the container scroll position to the freshly-mounted range before the browser paints,
// so neither an extend nor a recenter ever shows a jump. An extend mutated the window around a