User-defined segment boundaries#126
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds user-defined segment boundaries stored as deltas from default verse segmentation. It introduces boundary controls, resegmentation, phrase-aware cross-segment linking, verse labels, draft autosave, project persistence, and updated view settings. ChangesUser-defined segment boundary editing
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cfa0a17 to
69f8147
Compare
f43875e to
c75337e
Compare
11eb61a to
1c939f6
Compare
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc resolved 1 discussion.
Reviewable status: 0 of 50 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
5e4e6f9 to
a05ca88
Compare
This comment was marked as resolved.
This comment was marked as resolved.
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc resolved 2 discussions.
Reviewable status: 4 of 66 files reviewed, 1 unresolved discussion.
|
The segment join-split interaction when holding ALT is really slick!! Simple hover-text on the split and join buttons would help clarify what's about to happen when they're clicked. A bigger concern is discoverability. We may want the segment join buttons always visible, with hover text that also mentions the ALT action for splitting segments. |
|
We had also discussed an alternate (from the verse superscripts) for segment view, in which the verse(-range) shows up in an initial gutter/column instead. |
|
Claude Sonnet analysis of two Devin flags: 1.
|
|
@imnasnainaec Clarify for me: You said:
Do we want join buttons always visible, with splitting buttons only visible with ALT? If that's the case, would the split tooltip be on the join buttons? And should the join buttons be enabled even when ALT isn't held? |
Join button always enabled; splitting only visible with ALT. Join and split buttons both with very simple hover text when ALT is held. Otherwise, join button with additional hover text about holding ALT to enable splitting segments. |
c86049d to
7196254
Compare
Show each segment's verse/range label (5, 5a, 5b–7, 29–2:1) in a fixed-width left gutter in both display modes, alongside the inline verse superscripts. The label revives buildSegmentLabels, now derived from the verseStarts covered-verse set rather than the startRef/endRef interval so cross-chapter merges don't over-claim.
labels Suppress the no-op merge above an empty verse and drop a wiped book's boundaries; render buried verse superscripts in group-based strips; accept Unicode-dash ranges; confine Alt re-renders to split-gap leaves.
Add a `showVerseGutter` view option (persisted project setting, default off) that swaps the segment-view verse display between two mutually-exclusive styles: the left verse-range gutter column or the inline verse superscripts, never both. Previously the gutter always rendered alongside the superscripts. Rewrite `buildSegmentLabels` to drop the split-verse portion lettering: the gutter now shows the plain verse range a segment overlaps (`2–3`, `29–2:1`, or a bare number), so two adjacent portions of one verse both read that verse's bare number rather than `1a`/`1b`. Also drop a stale `no-null/no-null` eslint-disable in main.test.ts left over from when the asserted args were on one line; the sentinel `null` a few lines down keeps its own disable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Re-centering after an instant jump in continuous view ran for a fixed LINK_SLOT_TRANSITION_MS (200ms) hold. But the render window mounts dozens of phrase groups whose glosses, morpheme rows, and arcs finish laying out asynchronously over many frames; content that widens to the left of the focus keeps shifting the focused box sideways well past 200ms. The hold expired before that late reflow landed, stranding the focus (and its arcs) off-center — the box drifted ~940px right after the hold stopped, with the scroll offset unchanged, and clicking a visible token then triggered the browser's native scroll-into-view "jump". Make holdCentered settle-aware: observe the strip content row and treat each resize as a fresh LINK_SLOT_TRANSITION_MS quiet-period extension, re-centering on every reflow and only stopping once the content goes quiet. A HOLD_CENTERED_MAX_MS cap bounds the total hold so a strip that never stabilizes can't spin the rAF loop forever. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every TokenChip fetched the gloss-input placeholder via its own async useLocalizedStrings; with field-sizing: content each chip mounted ~14px too narrow and widened when the string resolved, shifting the strip under already-measured arcs (arc drawn off-screen after load, right endpoint inward, per-nav jitter). The arc hook's observer watches the fixed-width fade wrapper, which never resizes for these shifts, so no corrective measure ran — and the 2-deep echo history could swallow a genuine correction as a phantom oscillation. Fetch the placeholder once per strip and deliver it through PhraseStripContext (as a prop into the memoized TokenChip), so chips render at final width on their first frame. Make useArcPaths settle-aware as a backstop: re-verify at 200/400/800ms after the last measurement until geometry reaches a fixed point, and allow up to two consecutive flip-backs to a recent signature before freezing — genuine collapse-then-recover corrections now apply while the cross-row gutter period-2 oscillation still terminates.
Match the intra-phrase gap column's punctuation/icon stacking to the PhraseSlot's, swap Link2Off for the height-matched Unlink2 glyph, and make the icon wrapper inline-flex so its line-box leading no longer pushes the unlink button below its inter-phrase counterpart.
The re-center hold disconnected its ResizeObserver when the tick loop went quiet, so the ~300-500ms gloss/arc reflow stranded the focus off-center on first load. Decouple observer lifetime from the loop: stay connected until HOLD_CENTERED_MAX_MS and re-arm on late reflows.
Remove bug-fix backstory and comments that restate the code or a test assertion; keep tightened invariants. Comments only — no behavior change.
Remove the adjacent-edge pull that moved a segment boundary to link across it; a slot straddling two segments is now inert and shows a tooltip, since a phrase may not span segments.
signatureOf gates whether a measurement is re-applied; a deconfliction shift that moved only midX matched the applied signature and left the split button in its pre-shift position. Also add JSDoc to key/pump/apply and fix a "grey"->"gray" comment.
A merge/split shifts segment indices, but the window's absolute range was left unchanged on the no-fade boundary-edit path, so a merge above the window dropped the top-visible segment (and a split pulled one in). Shift the range by the anchor-index delta to hold the same content in frame. Only bit when range.start > 0, which no existing test covered.
a82db4f to
4703ce0
Compare
The mid-glide reconcile test removed tok-1, a no-op that never merged GEN 1:2 into 1:1; use tok-2 so it exercises the real path. Align user-questions.md with shipped behavior (merge always visible, split Alt-gated).
Fetch the merge/split localized labels once per strip instead of once per BoundaryControl instance, matching the glossPlaceholder pattern.
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc resolved 5 discussions.
Reviewable status: 19 of 80 files reviewed, 1 unresolved discussion (waiting on alex-rawlings-yyc and imnasnainaec).
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec partially reviewed 18 files, made 1 comment, and resolved 1 discussion.
Reviewable status: 35 of 80 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
src/__tests__/components/PhraseStripParts.test.tsx line 429 at r12 (raw file):
} // -- Merge branch --------------------------------------------------------
⛏️ We can use nested describes instead of comment subsectioning.
|
Previously, imnasnainaec (D. Ror.) wrote…
Done |
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec made 1 comment.
Reviewable status: 35 of 80 files reviewed, 1 unresolved discussion (waiting on alex-rawlings-yyc).
a discussion (no related file):
🐛 I'm not seeing any hover text on the segment split/join buttons when I hold ALT.
Native title tooltips are suppressed while Alt is held, so the split/join hover text never appeared. Route boundary and link-icon tooltips through the Tooltip component with a 700ms open delay.
There was a problem hiding this comment.
@alex-rawlings-yyc made 1 comment.
Reviewable status: 35 of 80 files reviewed, 1 unresolved discussion (waiting on alex-rawlings-yyc and imnasnainaec).
a discussion (no related file):
Previously, imnasnainaec (D. Ror.) wrote…
🐛 I'm not seeing any hover text on the segment split/join buttons when I hold ALT.
Switched to Platform.Bible's dedicated Tooltip system; should be working now
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 47 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).


This change is
Summary by CodeRabbit
"null".