Skip to content

fix(AppShell): correct Inventory take/drop editor and Attributes editor gaps - #1960

Merged
alexwarren merged 1 commit into
mainfrom
fix/appshell-editor-inventory-attributes
Jul 29, 2026
Merged

fix(AppShell): correct Inventory take/drop editor and Attributes editor gaps#1960
alexwarren merged 1 commit into
mainfrom
fix/appshell-editor-inventory-attributes

Conversation

@alexwarren

Copy link
Copy Markdown
Contributor

Summary

Fixes several gaps in the AppShell editor found while comparing it against the v5 desktop/web editors:

Inventory tab (Take/Drop):

  • AddDropdownTypeValues (WASM bridge) never resolved bool values to "boolean", so the Take/Drop dropdown showed blank instead of defaulting to "Default behaviour", and the "Object can be taken"/"Take message" controls never rendered (no boolean branch existed in PropertyEditor.svelte's "multi" control renderer).
  • SetMultiType had no "boolean" case, so switching the dropdown back from "Run script" to "Default behaviour" silently failed (hit the unknown-type fallback).
  • Forwarded the ASLX <checkbox> caption through a new checkboxCaption field on ControlInfo so the checkbox label ("Object can be taken") renders correctly.

Attributes editor:

  • elementtype/type are now fully locked (type dropdown + value), since they identify the element and must never be hand-edited.
  • name's type dropdown is locked to string, but its value stays editable (renaming still works).
  • Added an "Add Change Script" button (creates a changed<attr> script attribute), matching v5's WFAttributesControl.AddChangeScriptAllowed — including for inherited attributes, which v5 also allows (unlike delete, which v5 blocks for inherited attributes).
  • When a changed<attr> already exists, shows a "Go to Change Script" button instead, which selects and scrolls to that attribute.

Test plan

  • dotnet build src/WasmEditor/WasmEditor.csproj — 0 errors/warnings
  • npm run check (svelte-check) in src/AppShell — 0 errors/warnings
  • Verified live in the editor (local draft game, player object):
    • Take dropdown defaults to "Default behaviour"; "Object can be taken"/"Take message" render and toggle correctly
    • Switching Take from "Run script" back to "Default behaviour" correctly clears the script and resets to a boolean checkbox
    • elementtype/type rows: type dropdown and value both disabled
    • name row: type dropdown disabled, value still editable
    • "Add Change Script" on take creates changedtake and selects it; hidden for elementtype/type/name
    • "Go to Change Script" shown for inherited isopen (has changedisopen) and correctly navigates to it
  • No console errors during manual verification

🤖 Generated with Claude Code

…or gaps

The WASM editor bridge's multi-attribute dropdown type resolution never
recognized boolean values, so the Inventory tab's "Take"/"Drop" dropdown
appeared blank instead of defaulting to "Default behaviour", and its
"Object can be taken"/"Take message" controls never rendered. Switching
the dropdown back from "Run script" to "Default behaviour" also silently
failed since SetMultiType had no boolean case.

Also fixes the Attributes editor to match the v5 desktop editor:
elementtype/type are now fully locked (never editable), name's type is
locked to string (but its value can still be edited to rename), and adds
an "Add Change Script" button (creates a changed<attr> script attribute)
that's available for inherited attributes as v5 allows, with a "Go to
Change Script" button shown instead when one already exists.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alexwarren
alexwarren enabled auto-merge (squash) July 29, 2026 21:53
@alexwarren
alexwarren merged commit 24a1eab into main Jul 29, 2026
7 checks passed
@alexwarren
alexwarren deleted the fix/appshell-editor-inventory-attributes branch July 29, 2026 21:54
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