Skip to content

fix(bar): update widget selection index after deletion - #4022

Open
Aron-dxd wants to merge 2 commits into
noctalia-dev:mainfrom
Aron-dxd:fix/clear-selection-on-widget-delete
Open

fix(bar): update widget selection index after deletion#4022
Aron-dxd wants to merge 2 commits into
noctalia-dev:mainfrom
Aron-dxd:fix/clear-selection-on-widget-delete

Conversation

@Aron-dxd

@Aron-dxd Aron-dxd commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes selection state of widgets when deleting a widget from a lane in Bar Widget Editor. Removing a widget kept the tokens in selectedLaneWidgets, causing ghost selections and widgets being selected when the same deleted widget was added again. The deleted widget's token should now be pruned and higher indexes shifted down.

Motivation

When users had one or more widgets widgets selected and removed one, the selection persisted. Later, when the same widget was added back, they remained selected. This causes visual inconsistencies and unpredictable behavior.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

Testing

  1. Ran just format, just build and just run.
  2. Ran the debug binary directly after killing noctalia process.

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

Before:

recording_20260820_000401.mp4

After:

recording_20260820_001942.mp4

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

Additional Notes

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