Skip to content

Macros settings: searching marks existing group macros as deleted #2614

Description

@Hannott

Mainsail Version:

v2.18.2 (present since v2.14.0)

Browser:

Edge

Device:

Desktop PC

Operating System:

Windows

What happened?

In Settings > Macros with Management set to Expert, typing in the Available Macros search box makes macros in the group you are editing look deleted. They get the Deleted macro subtitle, and their color and visibility buttons disappear, leaving only the delete button.

The macros are fine. Nothing is saved or lost, and clearing the search restores the row. It just looks like the group is full of dead entries, which is alarming when you are only trying to find a macro to add.

The cause is in SettingsMacrosTabExpert.vue. The allMacros getter returns the search-filtered list:

get allMacros() {
    const macros = this.$store.getters['printer/getMacros'] ?? []
    return macros.filter((macro) => macro.name.toLowerCase().includes(this.searchMacros.toLowerCase()) || ...)
}

existsMacro() and getMacroDescription() then use that same filtered list to decide whether a macro still exists in the printer config. Anything the search excludes reads as deleted, and v-if="existsMacro(macro.name)" hides the buttons.

The search box arrived in #2141, so this affects v2.14.0 onwards.

What did you expect to happen instead?

The search box should narrow the Available Macros list only. Macros in the group being edited should keep their real description and their color and visibility buttons, and Deleted macro should appear only when the macro is genuinely gone from the printer config.

How to reproduce this bug?

  1. Go to Settings > Macros and set Management to Expert
  2. Create a macro group, or edit an existing one
  3. Add two or more macros to the group
  4. Type part of one macro's name into the Available Macros search box

Every macro in the group that does not match what you typed now shows Deleted macro and loses its color and visibility buttons. Clearing the search box brings them back.

Additional information:

A second, unrelated issue in the same two settings tabs: both search fields use clearable, and Vuetify sets the model to null when you click the clear icon. searchMacros.toLowerCase() then throws a TypeError, the computed fails, and the macro list stops rendering until you navigate away from the tab. Pressing backspace to empty the field is fine, since that leaves an empty string. Only the clear icon triggers it.

I have a branch with fixes and unit tests for both. I opened it as #2613, which the vouch bot closed since I am not a vouched contributor yet. Happy to have it reviewed if a maintainer is willing to vouch, or to leave this as a report if someone else would rather pick it up.

🤖 This issue was created with the help of Claude Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions