Skip to content

fix(plasmic-mcp): Tier 3+4 — removal/states, interaction DX, expression safety#198

Merged
field123 merged 2 commits into
masterfrom
feat/mcp-tier1-hostless
Mar 27, 2026
Merged

fix(plasmic-mcp): Tier 3+4 — removal/states, interaction DX, expression safety#198
field123 merged 2 commits into
masterfrom
feat/mcp-tier1-hostless

Conversation

@field123
Copy link
Copy Markdown
Collaborator

@field123 field123 commented Mar 27, 2026

Summary

Two tiers of fixes in one PR:

Tier 3: Component Removal & Implicit States (55, 56, 58)

  • 55 node.remove state cleanup: Fallback removal path now calls removeImplicitStatesAfterRemovingTplNode() from @/wab/shared/core/states before manual splice for TplComponent nodes
  • 56 list-states includeImplicit: component.list-states accepts includeImplicit boolean to expose implicit states with implicit: true and tplNodeUuid markers
  • 58 cascade delete: component.delete with force: true cascade-removes all TplComponent instances via TplQuery tryRemove({ deep: true }) before calling TplMgr.removeComponent

Tier 4: Interaction & Expression DX (47, 31, 49, 48, 54)

  • 47 $state. prefix stripping: buildActionArgs strips accidental $state. prefix from updateVariable variable arg to prevent $state.$state.x
  • 31 bare scope variable auto-correction: createAttrExpr detects props.x/state.x/ctx.x after $ stripping and re-adds the $ prefix with a warning
  • 54 $expr: rejection: Explicit rejection with clear error pointing to $expression or {{expression}} syntax
  • 49 customFunction arg validation: Warns on unknown arg keys
  • 48 event variable docs: Tool description documents event, $state, $props, $ctx, $steps availability

Also confirmed during this session: Gaps 26, 29 (hostless components), 33 (toggle variant), 34 (visibility alias), 39 (toggle auto-value) are all already fixed by prior PRs.

Test plan

  • 2296 tests pass
  • Build succeeds, type check passes
  • Manual: TplComponent removal + save succeeds
  • Manual: cascade delete removes instances from other components
  • Manual: list-states includeImplicit works

…ibility, cascade delete

- node.remove fallback path: call removeImplicitStatesAfterRemovingTplNode
  from @/wab/shared/core/states before manual splice for TplComponent nodes
  without parent pointers (#55)
- list-states: add includeImplicit parameter to expose implicit states
  created by TplComponent instances and variant groups (#56)
- component.delete with force: cascade-remove all TplComponent instances
  referencing the deleted component via TplQuery tryRemove({ deep: true })
  before calling TplMgr.removeComponent (#58)
…pe correction, arg validation

- $state. prefix stripping: buildActionArgs updateVariable strips accidental
  $state. prefix from variable arg to prevent $state.$state.x double-prefix (#47)
- Bare scope variable auto-correction: createAttrExpr detects props.x/state.x/ctx.x
  after $ stripping and re-adds the $ prefix with a warning (#31)
- $expr: rejection: createAttrExpr explicitly rejects $expr: prefix with clear
  error pointing to $expression or {{expression}} syntax (#54)
- customFunction arg validation: warns on unknown arg keys (#49)
- Event variable documentation: interaction.add tool description now documents
  that customFunction code has access to event, $state, $props, $ctx, $steps (#48)
- buildActionArgs returns { nameArgs, warnings } for warning propagation
@field123 field123 changed the title fix(plasmic-mcp): Tier 3 — component removal, implicit states, cascade delete fix(plasmic-mcp): Tier 3+4 — removal/states, interaction DX, expression safety Mar 27, 2026
@field123 field123 merged commit e177852 into master Mar 27, 2026
9 checks passed
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