Skip to content

Buttons are silently never emitted #58

Description

@TheLastDarkthorne

src/main/groovy/muddler/mudlet/items/Button.groovy exists, but nothing in
App.groovy constructs one. App.groovy builds five packages - alias,
script, timer, trigger, key - and yields those five into the MudletPackage
XML. There is no sixth for buttons, so a project with a populated
src/buttons/ builds without any error and simply produces no buttons.

The failure is silent - the build reports success and every other item type
in the same project comes through fine.

Reproduce

mfile:

{ "package": "buttons-repro", "version": "1.0.0" }

src/buttons/buttons.json - a toolbar with one button:

[
  { "name": "Toolbar", "isFolder": "yes", "isActive": "yes",
    "children": [
      { "name": "Show affs", "isActive": "yes", "script": "Show_affs.lua" }
    ]
  }
]

src/buttons/Show_affs.lua:

svo.affs.show()

src/triggers/triggers.json - a canary, to show every other item type still
builds normally:

[ { "name": "Canary", "patterns": [{"pattern": "x", "type": "exactMatch"}], "script": "X" } ]

Run muddle.

Expected

The log prints "Scanning for buttons", the way it does for aliases, scripts,
timers, triggers and keys. The output XML has an ActionPackage/Action
element for "Show affs" inside an ActionGroup for "Toolbar".

Actual

"Scanning for buttons" never appears in the log. The canary trigger builds
correctly, but there is no Action or ActionGroup element anywhere in the
output - the button leaves no trace at all.

Cause

App.groovy only builds AliasPackage, ScriptPackage, TimerPackage,
TriggerPackage and KeyPackage, and only yields those five into the
package XML. There is no ButtonPackage/ActionPackage to scan
src/buttons/ and construct Buttons. Button.groovy itself only looks
finished, too: it declares fields for the button's options but its
constructor sets none of them, so even a Button built by hand would
serialise as all-null.

Impact

A project with a src/buttons/ folder silently loses every button on
build - there is no error, warning, or partial output to indicate anything
is missing. Converting an existing package with a toolbar drops the toolbar
entirely.

Runnable reproduction

https://github.com/TheLastDarkthorne/mudlet-tooling-repros/tree/main/muddler/bug6-missing-buttons


Found while converting svof (in-client-svof branch) from XML into a muddler project.

muddler version: fork of 1.1.0, pre-fix (TheLastDarkthorne/muddler @ svof-fixes)
Java: OpenJDK 17
OS: Windows 11

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions