Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(ai): report every modifier removed with a pill - #519

Open
arhxam wants to merge 1 commit into
getopenscreen:mainfrom
arhxam:codex/report-removed-modifier-ids
Open

fix(ai): report every modifier removed with a pill#519
arhxam wants to merge 1 commit into
getopenscreen:mainfrom
arhxam:codex/report-removed-modifier-ids

Conversation

@arhxam

@arhxam arhxam commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep removeModifier aligned with the editor's whole-pill deletion rule
  • report every storage-row ID actually removed in a new authoritative removedIds field
  • preserve the existing removed field for consumers that expect the requested ID
  • teach the agent tool description and architecture docs that touching rows can disappear together

Root cause

Adjacent modifiers with identical styling render as one timeline pill. The shared removeRegion mutator correctly deletes that whole pill, but the agent result echoed only the ID it was asked to remove. After deleting one of three touching zoom rows, the model was told one ID disappeared while the document contained none of the three.

The executor now snapshots the resolved modifier collection before and after the shared mutation and reports the stable difference. Deletion granularity and the human editor remain unchanged.

Related issue

Fixes #457

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

No visual change. This corrects the model-visible tool result for an existing editor mutation.

Testing

  • TDD red phase reproduced three touching zooms being removed while removedIds was absent
  • npx vitest --run electron/ai-edition/agent-tools.test.ts electron/ai-edition/deep-agent/service.test.ts — 134 passed
  • regression covers both a three-row pill and single zoom/speed deletion
  • npx tsc --noEmit
  • npx tsc -p tsconfig.test.json --noEmit
  • npm run lint — no errors (14 pre-existing warnings)
  • npm run test — 181 files, 2,164 passed, 2 skipped
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Improved modifier removal results to report every related item removed when adjacent or overlapping modifiers are treated as one pill.
    • Removal summaries now accurately identify all deleted modifier IDs.
  • Documentation

    • Updated AI-agent guidance to explain grouped modifier deletion and the complete removal results.

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

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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: f7d78fb7-73d4-4c47-a557-567cbc81b2d1

📥 Commits

Reviewing files that changed from the base of the PR and between 059f4e8 and 5789581.

📒 Files selected for processing (4)
  • electron/ai-edition/agent-tools.test.ts
  • electron/ai-edition/agent-tools.ts
  • electron/ai-edition/deep-agent/service.ts
  • technical-documentation/architecture/ai-agent.md

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

removeModifier now reports every modifier row removed with a pill through removedIds. Tests cover single and adjacent multi-row removals. Tool descriptions and architecture documentation describe the expanded result.

Changes

removeModifier reporting

Layer / File(s) Summary
Resolve modifier family ids
electron/ai-edition/agent-tools.ts
Adds typed modifier-family handling and collects ids from zoom, annotation, speed, and camera-fullscreen regions.
Report and validate deleted ids
electron/ai-edition/agent-tools.ts, electron/ai-edition/agent-tools.test.ts, electron/ai-edition/deep-agent/service.ts, technical-documentation/architecture/ai-agent.md
removeModifier returns all ids that disappeared. Tests cover single removals and adjacent zoom rows. Tool descriptions document the removedIds result.
Estimated code review effort: 2 (Simple) ~10 minutes

Merge Risk: ⚪ Minimal · up to 57895

This localized change makes modifier-removal results accurately report every row removed while preserving existing behavior and compatibility; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: etiennelescot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: reporting every modifier removed when deleting a whole pill.
Description check ✅ Passed The description follows the repository template. It includes the summary, issue reference, change classifications, release and desktop impact, visual-change note, and detailed testing information.
Linked Issues check ✅ Passed The implementation satisfies issue #457. It preserves whole-pill deletion, retains the requested ID in removed, reports all deleted row IDs in removedIds, updates documentation, and adds regressio…
Out of Scope Changes check ✅ Passed All changes are directly related to issue #457. The implementation, tests, tool description, and architecture documentation support the requested reporting correction.
Full details: Linked Issues check

Explanation

The implementation satisfies issue #457. It preserves whole-pill deletion, retains the requested ID in removed, reports all deleted row IDs in removedIds, updates documentation, and adds regression coverage for touching and separated modifiers.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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.

@EtienneLescot

Copy link
Copy Markdown
Collaborator

Needs a rebase on main, and the rebase surfaces one real thing.

Main added audio to RegionKind, so ModifierKind gained a member modifierIds() does not answer for. The switch stops being exhaustive (it will not compile), and deleting an audio pill would report an empty removedIds — the exact failure this PR exists to fix, one lane over.

Fragments of one user-visible track share trackId and render as a single pill, so the id that disappears is the group key once, not one per fragment:

case "audio":
    return [...new Set(document.audioTracks.map(trackGroupId))];

trackGroupId is already imported in that file on main, and removeRegion applies the same grouping by routing this kind through removeAudioTrack.

I could not push this for you: my token lacks the workflow scope and your fork is missing a workflow file main has since added, so any push carrying main's history is rejected.

MinhOmega added a commit to MinhOmega/Capturia that referenced this pull request Sep 11, 2026
…models and upstream fixes (#13)

Capturia 2.1: new editor and capture features, plus the upstream open PRs that were worth taking.

## New features
- **Record an area of the screen**: an Area tab in the source picker opens an overlay on the chosen display. You drag, move and resize a rectangle, and it shows the live size in physical pixels. The rectangle is validated and clamped in the main process, and the recording opens already cropped to it. Auto-zoom stays inside the area. Not offered on Wayland.
- **Saved looks**: save the current appearance (background and frame, camera layout, cursor, caption style, and optionally the format) as a named preset, apply it in one undo step, and star one as the default for new projects. Regions, trims, zooms, crop and the transcript are never touched.
- **Zooms at flagged moments**: Auto-enhance adds a zoom at every moment flagged while recording, using the same placement rules as auto-zoom. A flag that falls in a trim or on an existing zoom is reported, not duplicated.
- **Right-click menu** on region pills and clips: Copy, Paste at playhead, Split, Delete. These call the same functions as the keyboard shortcuts. Also fixes Ctrl+C on audio pills, which did nothing before.
- **Poster frames**: the project list and media cards show real thumbnails. They are generated by ffmpeg in the main process, cached, and made one at a time.
- **Speech model choice**: Fast / Balanced / Accurate in AI settings. Each model is pinned to a SHA-256 digest and verified before it becomes active, and a failed switch keeps the previous model.
- **Recordings folder**: choose where new takes are saved. The folder is set only through the OS picker. In that folder, only files Capturia itself names are reachable, after resolving symlinks, and it is never auto-cleaned. If the folder is unavailable, the app offers to use the default before the take starts.
- **Pre-release update channel**: opt-in, and it never downgrades (`allowDowngrade` stays false).

## Taken from upstream open PRs
Each one was rebuilt on our code where it no longer applied, and each carries its `Upstream-PR:` trailer:
getopenscreen/openscreen#302, #386, #519, #520, #571, #617, #632, #640, #641, #642, #644.
- #617 drops `node_modules` from `app.asar`. Verified: every npm dependency is bundled by Vite, since externals are Node builtins plus `electron`. `electron-updater` is a bundled chunk, and native addons load from `resourcesPath`.

## Fixes
- **Windows Store verify step**: it looked the package up by the pre-rename name, `EtienneLescot.OpenScreen`, which is what failed the RC.3 Store job. It now reads the name from the generated `AppxManifest.xml`.
- **Linux export on Intel Arc**: iHD accepts the dmabuf and then returns EIO on every encode, so every hardware export died at the first frame. Each export now probes one real frame and falls back to software if it fails. The mapped frame is also freed when `send_frame` fails.
- **Windows microphone drift**: the 44.1→48 kHz path rounded every packet on its own, which added up to 3.75 s/h of growing mic lag. It now carries the position across packets with exact integer totals. 88.2/176.4/352.8 kHz devices now snap to 44.1 kHz, so they go through the anti-alias decimator.
- **PipeWire test**: the vendored SPA 1.0.5 compares 64-bit values through an `int`, so the old probe modifier matched Intel X_TILED. The test now uses a modifier that cannot collide. CI now runs this crate's tests.

## Review and audit
The integrated branch got an independent security audit and a separate bug hunt. Both were read-only, and every finding was verified by tracing the code. Fixed here:
- **Self-update**: it could install a version other than the one the dialog named, or error out instead of falling back to "View Release". It now self-updates only when electron-updater's version matches.
- **Recordings folder**:
  - The writable check always passed on Windows, because libuv ignores directory ACLs. It now creates and deletes a real probe file.
  - Renderer-named writes are contained after resolving symlinks.
  - A take keeps the path it opened with, so changing the folder's availability mid-take no longer reports "missing on disk".
  - The folder cannot be changed while a take is running.
- **Poster cache**: one entry per source file, with no flicker when the duration arrives.
- **Speech models**: switching is single-flight, and a settings dialog reopened mid-download joins the running download.
- **Timeline**: a shift-click that deselects a pill no longer leaves it focused, which had made the menu delete the wrong pill.
- **Area recording**: a flag zoom with no telemetry now centres on the recorded area.
- **Saved looks**: applying a look is optimistic, so an edit made during its save is no longer lost.
- **Saved-looks probe document**: it was invalid at import time. Caught in review before it could crash the editor.

## Verification
- Both tsc projects exit 0. Biome is clean; the 26 warnings are the same as on main. The i18n check passes, with real translations in all 13 locales.
- Vitest: 255 files, 3099 passed, 1 skipped, on the integrated branch.
- Rust: compositor 216 lib tests plus integration tests, and pipewire-capture 84 tests. Both pass locally.
- C++ `audio_sample_utils_test`: 97/97 under g++ on Linux, using stub headers. MSVC coverage comes from the `build.yml` dispatch on this branch, which never publishes without `release_tag`.
- Every agent-reported claim was re-checked independently. For example, the model digests were checked against Hugging Face's LFS oids, and the electron-updater downgrade path was read in 6.8.9.

## Release note
The speech-model change adds a `--dtw-preset` flag to the whisper helper. An older helper ignores unknown flags, so Balanced keeps working. The 2.1 release must still be cut **after** `build-whisper-stt.yml` has finished on main, so the installers stage a helper that understands the flag.

Upstream-PR: getopenscreen/openscreen#302
Upstream-PR: getopenscreen/openscreen#386
Upstream-PR: getopenscreen/openscreen#519
Upstream-PR: getopenscreen/openscreen#520
Upstream-PR: getopenscreen/openscreen#571
Upstream-PR: getopenscreen/openscreen#617
Upstream-PR: getopenscreen/openscreen#632
Upstream-PR: getopenscreen/openscreen#640
Upstream-PR: getopenscreen/openscreen#641
Upstream-PR: getopenscreen/openscreen#642
Upstream-PR: getopenscreen/openscreen#644
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.

removeModifier deletes a whole pill but reports removing one id

2 participants