fix(desktop): unlink zoom mode references on split and support direct canvas point positioning - #2285
Open
massmarketconsumer-arch wants to merge 2 commits into
Conversation
| expect(first.start).toBe(0); | ||
| expect(first.end).toBe(4); | ||
| expect(second.start).toBe(4); | ||
| expect(second.end).toBe(10); |
Contributor
There was a problem hiding this comment.
The comment repeats what the following reference-identity assertions already express. This violates the repository directive to avoid comments that merely narrate the code. Remove it and the similar comment before the mutation-independence assertion on line 51. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/routes/editor/zoom.test.ts
Line: 40
Comment:
**Redundant test comments**
The comment repeats what the following reference-identity assertions already express. This violates the repository directive to avoid comments that merely narrate the code. Remove it and the similar comment before the mutation-independence assertion on line 51. This repository requirement must be satisfied before merging.
**Context Used:** CLAUDE.md ([source](https://github.com/capsoftware/cap/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Fixed in 212781d. Removed redundant explanatory comments before reference-identity assertions to comply with repository comment guidelines.
…t direct point positioning (CapSoftware#2230) - Deep-clone mode when splitting zoom segments to prevent sibling reference sharing - Safely update mode in ZoomSegmentConfig without attempting property mutation on string primitives - Handle immediate point positioning on mouse down in zoom preview canvas - Add unit tests verifying zoom segment split independence
massmarketconsumer-arch
force-pushed
the
fix/split-zoom-area-identity
branch
from
September 12, 2026 20:59
212781d to
021b97b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #2230
Problem
When a user splits a zoom segment into two and adjusts the new split zoom segment in the editor, the platform continued zooming into the original area (or adjustments affected both segments). This was caused by:
splitZoomSegmentshallow-copyingsegment({ ...segment }), causing both zoom segments to share the exact samemodeobject reference in memory. Mutating the mode on one segment mutated both segments.ZoomSegmentConfig, mouse drag calledsetProject("timeline", "zoomSegments", props.segmentIndex, "mode", "manual", { x, y }). In Solid Store, attempting to set propertymanualon a string primitive throwsTypeError: Cannot create property 'manual' on string 'auto', preventing coordinates from updating when switching modes.ZoomSegmentConfig,onMouseDownon the preview canvas only attachedmousemove/mouseuplisteners without immediately setting the position on click, requiring the user to drag to register any change.Solution
splitZoomSegmentsListwithcloneZoomModehelper inapps/desktop/src/routes/editor/zoom.tsto ensure each split segment owns an isolatedmodeconfiguration.ZoomSegmentConfigto safely replace the entiremodeobject ({ manual: { x, y } }) and handle click-to-position on mouse down in addition to drag.apps/desktop/src/routes/editor/zoom.test.tsverifying zoom segment split independence and boundary enforcement.The behavior appears correct, but the explicit repository comments requirement must be satisfied before merging.
Findings
Fix with agent prompt
Summary
Reviews (1) · Last reviewed commit: "fix(desktop): unlink zoom mode reference..."