Conversation
…rocedural parity (AK-09, failing first) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tem and procedural adopt it (AK-09 1/2)
Capabilities.mechanism { has, isOn, set, verb? } with transient state in
useInteractive (mechanisms map for single-switch kinds). The action menu's
Play/Stop and the E fallback read it instead of item/procedural-item checks,
so a plugin kind gets both by declaring it. Item and procedural-item declare
it with their existing semantics; their light switch stays as it was.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: 5e39e498-5714-421b-bd63-c5d1b0f52f7e |
This branch has not been deployed
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.
AK-09 first slice, part 1 of 2. Part 2 is #955 (GLB clip listing, baked viewer, walkthrough), stacked on this branch and targeting
main.What and why
Play/Stop and E were wired to
node.type === 'item' | 'procedural-item'(nodes/src/shared/item-interactions.ts), so a plugin kind with moving parts (Articraft's joints) could not get either.capabilities.mechanism: { has, isOn, set, verb? }(MechanismCapability), plusnodeMechanism(node),toggleMechanism(mechanism, node)andtoggleNodeMechanism(node). Operating state is transient:setwritesuseInteractive, never the node. Kinds with one switch use the newuseInteractive.mechanismsmap (setMechanism,removeMechanism).InteractiveStateis exported.registry-action-contributions.tsx): the single selected node gets it when its kind declares the capability andhas(node). The item/procedural contribution keeps only the light switch, so they show the same two buttons, in the same order, with the same classes.runNodeInteraction(node): the kind's ownkeyboardActions.e, else its mechanism, else the door/window fallbacks as before.itemMechanism,proceduralMechanism). Their E still does mechanisms, else lights. Lights keep their kind checks; alightscapability is the next slice.node-definitions.mdgainscapabilities.mechanism.Visible only once a plugin adopts it. The owner preview ships with the Articraft adoption (AK-ART).
Failing case first
690041dc4(tests only), onmain's code: coremechanism.test.ts0 pass / 1 fail (no capability); nodesitem-interactions.test.ts0/1 (item and procedural declare none); editoruse-keyboard.test.ts+registry-action-contributions.test.tsxfail (E does nothing for a capability-only kind; there is no Play for it).Proof
bun run --cwd packages/core test: 2983 pass, 0 fail.bun run --cwd packages/nodes test: 3506 tests, 0 fail. The item/procedural parity tests (item-interactions.test.ts,item/definition.test.ts,procedural-item/definition.test.ts) assert the same control values and part states as before.bun run --cwd packages/editor test: 1117 pass, 0 fail.bun run check: no errors (6 infos, all pre-existing).bun run check-types: every package passes.apps/editorfails on the missing local@webxr/plugin, as onmain.bun typecheckagainst these dists: 12/12.useInteractivestate: no scene write, no history step (test:running a mechanism is transient).R3–R5, R7 and R9 are unaffected: no references, rooms, geometry or recipes change.
House effect: no change. /next has no plugin mechanisms, and item/procedural behave as before.
For Wassim (procedural items, #930)
nodes/src/shared/item-interactions.ts:proceduralMechanismwrapssetProceduralParts(node.id, motionPartIds(node), on), with the same "any running → stop all, else start all" rule, now intoggleMechanism.procedural-item/definition.ts:capabilities.mechanism: proceduralMechanism. E runstoggleMechanism(proceduralMechanism, n), elsetoggleItemLights(n).shared/item-interaction-actions.tsx: the Play button moved to the editor's genericMechanismButton, with the same markup and order. The light button is unchanged.🤖 Generated with Claude Code