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.

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

1 participant