refactor(groups): post-merge cleanup bundle#64
Merged
Conversation
Three independent follow-up threads from the groups feature merge: * refactor(types): move `LabelObject` from `registry/index.ts` to `types/Group.ts`. Breaks the type-only cycle where registry imported `GroupObject` only to compose `LabelObject`, which `types/Group` then imported back. Now one-way: `types/Group` depends on registry for `LeafObject`. About 25 consumer imports updated. * fix(store): cascade lock through ancestor groups in `applyObjectChanges`. `updateObject` reads ancestor state once via `findAncestors`; `updateObjects` carries `inheritedLocked` through the recursive walk. Load-bearing, because `expandSelection`-driven flows (arrow-key nudges, multi-drag) previously sidestepped a locked group by targeting its leaf children directly. Bypass keys (locked, visible, includeInExport, comment, name) still pass so the layers panel can release the cascade. * refactor(design-file): split `labelObjectSchema` into discriminated leaf / group shapes (leaf requires `props`, group requires `children`). Adds a round-trip test for nested groups plus negative cases for malformed leaves and groups. Also drops the dead `inheritedHidden` walk parameter in `LabelCanvas.visibleLeaves` (early-continue meant it never propagated) and aligns the new cascade tests with the `isGroup`- narrowing pattern used elsewhere in `labelStore.test.ts`.
There was a problem hiding this comment.
Code Review
This pull request refactors the LabelObject type definition, moving it to src/types/Group.ts to resolve circular dependencies. It introduces a lock cascade feature where children of a locked group inherit the locked state, preventing positional changes while still allowing metadata updates. Additionally, the Zod schema for design files was improved to strictly validate leaf and group structures, and comprehensive tests were added for these changes. I have no feedback to provide.
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.
No description provided.