Skip to content

fix(timing): a composited view keeps the transitions that do not overlap - #389

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/dropped-transitions
Sep 27, 2026
Merged

LeadcodeDev merged 1 commit into
mainfrom
fix/dropped-transitions

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #371. Refs #388.

Case 2 is a regression I introduced in #350

A single overlapping pair routes the whole view through v2_build_composited, which walks output frames and never builds transition frames. The warning I put there only fired for a scene that itself overlaps — so a later scene sitting clear of everything lost its fade with nothing on stderr.

The composited path now emits SlideTransition for any pair whose only overlap is its own declared transition.

The condition took a second attempt, and the first one is worth recording. I checked that both scenes were live at that frame. That never fires: the whole point of a v2 transition is that the outgoing scene is rendered past its own end, so at frame 105 of the reproduction scene 1 (window 30–89) is not live at all. The transition window has to be tested on its own, independently of who is live.

Measured

The issue's reproduction — three scenes, the first two overlapping, the third declaring a 1.0 s fade — sampling the centre pixel:

t before after
3.2s (0, 0, 255) (0, 246, 9)
3.5s (0, 0, 255) (0, 115, 140)
3.8s (0, 0, 255) (0, 5, 250)

(0, 115, 140) at 3.5 s is exactly the value the issue reports for the same two scenes without the overlapping one in front. So the fade is not merely present — it matches the uncomposited reference.

The existing warning is now correctly scoped: it fires only when the overlap is larger than the declared transition, which is the case where the two genuinely cannot both describe the same frames.

Case 1: a transition on a view's first scene

A transition belongs to the scene being entered, and the first scene has nothing to come from. It was accepted and ignored. It now warns at validate time and says where to move it:

Warning: the `transition` on view 0's first scene has no effect — a transition
belongs to the scene being entered, and the first scene has nothing to come
from. Move it to the next scene, or use the view's own `transition` to come in
from the view before it.

The failure mode this closes is an author writing the fade on the wrong scene and counting frames to work out why the video is 2.0 s instead of 1.6 s.

It hangs off run_checks, not warn_on_silent_defaults — the latter is only called by render, which is why my first attempt printed nothing under validate.

Verification

  • one_overlapping_pair_does_not_disable_the_other_scenes_transitions — fails against the regression: assertion left == right failed: scene 2 does not overlap anything and declares a 1.0s fade, so it must still get its 30 transition frames
  • a_scene_that_overlaps_beyond_its_own_transition_still_loses_it — pins that the deliberate case stays deliberate, and stays loud
  • An unrelated example still validates with zero occurrences of the new warning

cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (1584) all clean.

Written comment-free, per the codebase-wide rule from #345.

Two ways a declared transition disappeared with nothing said about it.

**One overlapping pair disabled every transition in the view.** This is a
regression from #350: a single overlap routes the whole view through
`v2_build_composited`, which walks output frames and never builds transition
frames. The warning there only fired for a scene that itself overlaps, so a
later scene sitting clear of everything lost its fade in silence.

The composited path now emits `SlideTransition` for any pair whose only overlap
is its own declared transition. The condition took a second attempt: the first
version checked that both scenes were live at that frame, which never fires —
the whole point of a v2 transition is that the outgoing scene is rendered
*past* its own end, so it is not live there. The window is tested on its own.

Measured on the issue's reproduction, three scenes where the first two overlap
and the third declares a 1.0 s fade, sampling the centre pixel:

            before      after
    3.2s   (0,0,255)   (0,246,9)
    3.5s   (0,0,255)   (0,115,140)
    3.8s   (0,0,255)   (0,5,250)

`(0,115,140)` at 3.5 s is exactly what the issue reports for the same two
scenes without the overlapping one in front — so the fade is not merely present,
it matches the uncomposited reference.

The existing warning is now correctly scoped: it fires only when the overlap is
*larger* than the declared transition, which is the case where the two really
cannot both describe the same frames.

**A transition on a view's first scene did nothing, silently.** A transition
belongs to the scene being entered and the first has nothing to come from. It
now warns at validate time and says where to move it — the failure mode is an
author writing the fade on the wrong scene and counting frames to find out.

Two tests. The first fails against the regression with the 30 missing
transition frames; the second pins that a scene overlapping *beyond* its own
transition still loses it, which is deliberate and stays loud.

Closes #371
@LeadcodeDev LeadcodeDev added the bug Something isn't working label Sep 27, 2026
@LeadcodeDev LeadcodeDev self-assigned this Sep 27, 2026
@LeadcodeDev
LeadcodeDev merged commit cbcde05 into main Sep 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transitions silently dropped: on a view's first scene, and on every scene of a view that contains one overlap

1 participant