Skip to content

fix(timeline): preserve partially anchored regions - #307

Open
arhxam wants to merge 1 commit into
getopenscreen:mainfrom
arhxam:codex/preserve-partial-anchors
Open

fix(timeline): preserve partially anchored regions#307
arhxam wants to merge 1 commit into
getopenscreen:mainfrom
arhxam:codex/preserve-partial-anchors

Conversation

@arhxam

@arhxam arhxam commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • use the shared complete-anchor predicate when removing clip-linked modifier regions
  • preserve legacy or partially populated regions that only carry a clipId
  • cover multi-asset removal so surviving clips are resequenced and their anchored regions are rederived

Related issue

Fixes #249

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

Not applicable; this changes timeline document behavior and regression coverage.

Testing

  • npx vitest --run src/lib/ai-edition/document/timeline.test.ts electron/ai-edition/document-service.test.ts (92 passed)
  • npm run test (1,679 passed, 1 skipped)
  • npx tsc --noEmit
  • npx tsc -p tsconfig.test.json --noEmit
  • npx biome check src/lib/ai-edition/document/timeline.ts src/lib/ai-edition/document/timeline.test.ts electron/ai-edition/document-service.test.ts
  • npm run docs:check
  • npm run i18n:check
  • npm run build-vite

Authored with Codex assistance and manually verified against the issue's edge cases.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed clip removal so unrelated or partially defined zoom regions remain intact.
    • Preserved raw timing and clip references for zoom regions without complete source anchors.
    • Corrected timeline resequencing and zoom timing recalculation after removing an asset.
  • Tests

    • Added regression coverage for asset and clip removal scenarios.

@arhxam
arhxam requested a review from EtienneLescot as a code owner August 8, 2026 18:11
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8430e415-039e-44ee-9ddc-11349c5c2aa1

📥 Commits

Reviewing files that changed from the base of the PR and between 4e7a85b and 732d2b7.

📒 Files selected for processing (3)
  • electron/ai-edition/document-service.test.ts
  • src/lib/ai-edition/document/timeline.test.ts
  • src/lib/ai-edition/document/timeline.ts

📝 Walkthrough

Walkthrough

removeClip now preserves regions without complete source anchors. New tests cover partial-anchor preservation and multi-asset removal, including survivor resequencing and adjusted zoom timing.

Changes

Clip removal behavior

Layer / File(s) Summary
Removal behavior and regression coverage
src/lib/ai-edition/document/timeline.ts, src/lib/ai-edition/document/timeline.test.ts, electron/ai-edition/document-service.test.ts
removeClip preserves partially anchored regions. Tests cover clip removal and multi-asset removal with resequenced clips and recalculated zoom timing.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Possibly related PRs

Suggested reviewers: etiennelescot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: preserving partially anchored timeline regions.
Description check ✅ Passed The description follows the template and includes the summary, issue, change type, release impact, platform impact, and validation details.
Linked Issues check ✅ Passed The changes satisfy both objectives in [#249] by aligning anchor filtering and testing multi-asset resequencing with timing rederivation.
Out of Scope Changes check ✅ Passed The implementation and regression tests remain within the timeline removal and multi-asset coverage scope defined by [#249].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

removeClip cascade: mirror isAnchored, and cover multi-asset removeAsset

1 participant