Skip to content

refactor(groups): post-merge cleanup bundle#64

Merged
u8array merged 1 commit into
mainfrom
refactor/groups-followup
May 15, 2026
Merged

refactor(groups): post-merge cleanup bundle#64
u8array merged 1 commit into
mainfrom
refactor/groups-followup

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented May 15, 2026

No description provided.

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`.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@u8array u8array merged commit 933a32a into main May 15, 2026
2 checks passed
@u8array u8array deleted the refactor/groups-followup branch May 15, 2026 07:47
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.

1 participant