← Back to Pull requests

refactor(video-editor): open every editor on the simple trim view #908

Merged
LorcanChinnock merged 7 files (82 lines) on Oct 25, 2026 19:20 UTC
View on GitHub
LorcanChinnock LorcanChinnock commented on Oct 25, 2026 19:08 UTC
Author

What

The multi-track timeline, keyframes, imports and annotations were already behind a button, off by default. But the editor remembered the last choice, so opening them once left them open for every later recording.

  • The editor now opens on the trim strip every time. The panel opens on its own only when a saved edit has imports or transforms, which have no trim strip to go back to.

  • The button is called More tools (it was "Tracks"), with a tooltip that says what it holds.

  • The videoEditorShowsTracks setting is gone, since nothing stores the choice any more.

  • The user guide's edit page and shortcuts table use the new name.
  • Nothing is removed. The README and landing page don't name the button. The video editor screenshots in docs/media/ (video-editor.png, video-timeline.png, video-captions.png) may show the old "Tracks" label, and I can't retake them here, so they need a fresh capture.

    Closes #899
    Part of #900

    Diff: 82 lines (+17 / -65) across 7 files Reviewer: LorcanChinnock Review duration: 12m
    All Vouch review confidence checks passed
    Residual risk 0.08 = Change Risk (0.52) × (1 − Review Confidence (0.84)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 82 lines diff across 7 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.91 · 3 substantive comment(s)
    0.91
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    84%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.264
    Self Review self_review
    0.140
    Real PR Conversation Timeline
    4 items
    claude[bot] claude[bot] commented on code on Oct 25, 2026 19:11 UTC
    Code Review
    Sources/Shot/VideoEditor/VideoEditorModel.swift:1
    @@ -207,6 +206,8 @@ final class VideoEditorModel {
                 project = restoring ?? Project(source: fileURL, duration: duration, canvasSize: CGSize(width: abs(size.width), height: abs(size.height)), hasAudio: hasAudio)
                 restoring = nil
                 savedProject = project
    +            // A saved edit with imports or transforms has no trim strip to go back to.
    +            showsTracks = isComposite

    Bug: saving closes the tracks panel but doesn't shrink the window

    load() runs when the editor opens, and again after a plain save. For a non-composite edit, save() replaces the file and then calls try await load():

    https://github.com/LorcanChinnock/shot/blob/600347b87510dd5c9f19d3b273cb3204d838afe5/Sources/Shot/VideoEditor/VideoEditorModel.swift#L961-L963

    To reproduce:
    1. Open More tools (T) on a trim-only edit.
    2. Press ⌘S.

    The reload builds a fresh Project, so isComposite is false and this line sets showsTracks = false. The panel closes, which is new behaviour: before this PR, load() never touched showsTracks.

    The assignment also skips setShowsTracks(_:), so onLayoutChanged never fires and fitWindowToTracks() never runs. The window keeps the panel's extra height and its raised minSize.height, and appliedExtraHeight is left stale until the next toggle.

    Only opening the panel here gives the same result on first open, since showsTracks starts false. It also leaves the user's choice alone after a save:

                // A saved edit with imports or transforms has no trim strip to go back to.
                if isComposite { showsTracks = true }
    

    LorcanChinnock LorcanChinnock commented on code on Oct 25, 2026 19:14 UTC
    Code Review
    Sources/Shot/VideoEditor/VideoEditorModel.swift:1
    @@ -207,6 +206,8 @@ final class VideoEditorModel {
                 project = restoring ?? Project(source: fileURL, duration: duration, canvasSize: CGSize(width: abs(size.width), height: abs(size.height)), hasAudio: hasAudio)
                 restoring = nil
                 savedProject = project
    +            // A saved edit with imports or transforms has no trim strip to go back to.
    +            showsTracks = isComposite

    Agreed. The reload after a save no longer closes the panel or skips the window resize: load() now only opens the tracks for a saved edit that needs them.

    claude[bot] claude[bot] commented on Oct 25, 2026 19:16 UTC
    Bot

    Code review

    No issues found in 94ebfb3db3c30429cb3c9f245196aa55e0e60895. Checked for bugs and CLAUDE.md compliance.

    Assignees
    LorcanChinnock LorcanChinnock
    Labels
    risk: low confidence: 84% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.2% (MEDIUM) · Higher = larger blast radius
    52.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84% · Lower = rushed or shallow review
    84%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8.3% · Safe to merge
    8.3%