Cork icon indicating copy to clipboard operation
Cork copied to clipboard

Regression: "Customize Toolbar..." menu

Open Grublady opened this issue 11 months ago • 2 comments

What were you trying to do?

Upon control-clicking on the title bar and selecting "Customize Toolbar...", it is expected that a menu appears allowing the user to rearrange the toolbar via drag-and-drop.

What was the problem?

Instead, Cork enters an in-between state where:

  • Toolbar icons are rearrangeable via drag-and-drop
  • The app window is still interactive
  • No menu appears

Since toolbar icons are in a rearrangeable state, they cannot be interacted with. Additionally, since there is no menu, this state cannot be exited without restarting the app.

The problem seems to be related to these two lines: https://github.com/buresdv/Cork/blob/6842ec5ed595290809cdbc153c6f8db42d969a47/Cork/ContentView.swift#L165 https://github.com/buresdv/Cork/blob/6842ec5ed595290809cdbc153c6f8db42d969a47/Cork/ContentView.swift#L171 Setting placement to .primaryAction on both of these reverts the behavior back to a working state.

Error logs

"""
FAULT: NSInternalInconsistencyException: NSToolbar 0x600003931cb0 already contains an item with the identifier maintenance. Duplicate items of this type are not allowed.; {
    NSAssertFile = "NSToolbar.m";
    NSAssertLine = 1621;
}
"""

and

"""
FAULT: NSInternalInconsistencyException: NSToolbar 0x6000022050e0 already contains an item with the identifier manageServices. Duplicate items of this type are not allowed.; {
    NSAssertFile = "NSToolbar.m";
    NSAssertLine = 1621;
}
"""

App Version

1.5, seems to occur as a result of e75a8a5 ("Merge branch 'main.adjusted-toolbar'")

App Acquisition

Self-Compiled

Final checklist

  • [ ] This report is about the interface, and I included screenshots of the problem

Grublady avatar Jan 28 '25 23:01 Grublady

That's weird, because semantically, both of these should be .secondaryActions. It's also strange why it's complaining about duplicate identifiers, even though they have unique IDs 🤔

buresdv avatar Jan 29 '25 21:01 buresdv

That's weird, because semantically, both of these should be .secondaryActions. It's also strange why it's complaining about duplicate identifiers, even though they have unique IDs 🤔

Agreed 100%, I have no idea why this causes a problem! 😭

For now I'd suggest just reverting it as a quick-fix, and keeping this issue open or opening a new one. The functionality is non-essential and it could potentially take a while to figure out, so it's probably better to not have it broken in the meantime.

Grublady avatar Jan 29 '25 21:01 Grublady