Skip to content

refactor(taskbar): refactor taskbar layout with flex and button - #3377

Merged
Ly-sec merged 4 commits into
noctalia-dev:mainfrom
enklht:refactor-taskbar-layout
Jul 13, 2026
Merged

refactor(taskbar): refactor taskbar layout with flex and button#3377
Ly-sec merged 4 commits into
noctalia-dev:mainfrom
enklht:refactor-taskbar-layout

Conversation

@enklht

@enklht enklht commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR rewrites taskbar implementation to use ui::flex, ui::button to reduce manually computed positionings.

Motivation

The manual layout math made it hard to reason about the placement.
I believe making proper use of flex layout makes the codebase more maintainable, verifiable.

Type of Change

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

Related Issue

none

Testing

  • Confirmed that just build, just build release, and just test all pass successfully.
  • Verified the taskbar layout across multiple option combinations, focusing on configuration settings that impact layout positioning (group_by_workspace, show_workspace_label, and workspace_label_positioning).
    Testing was primarily on a horizontal bar, with additional validation on a vertical bar.

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

screenshots on horizontal bars:

without workspace grouping:
Screenshot from 2026-07-11 20-52-49

without workspace labels:
Screenshot from 2026-07-11 20-52-41

workspace labels at corners:
Screenshot from 2026-07-11 20-52-19

workspace labels at center:
Screenshot from 2026-07-11 20-52-28

workspace labels inside the pill:
Screenshot from 2026-07-11 20-52-34

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

@enklht enklht changed the title Refactor taskbar layout refactor(taskbar): refactor taskbar layout with flex and button Jul 11, 2026
@Ly-sec

Ly-sec commented Jul 11, 2026

Copy link
Copy Markdown
Member

Hey @enklht I just tested your PR and it seems like there are some miscalculations uappening.
image

It seems like the badges can get clipped, there were a few reasons why we had this random math in place, mostly to keep the badges properly positioned :).

@enklht
enklht marked this pull request as draft July 11, 2026 12:28
@enklht

enklht commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Ly-sec for checking! I've converted this to a draft PR.
Do you have any idea how I could reproduce the bug you encountered?

@enklht
enklht force-pushed the refactor-taskbar-layout branch from fa054e7 to 5b17186 Compare July 11, 2026 16:47
@enklht
enklht marked this pull request as ready for review July 11, 2026 16:54
@enklht

enklht commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Ly-sec, I adjusted the padding dimension so badges wont get clipped.
Could you give it another try and let me know if it fixes the issue on your end?

@Ly-sec

Ly-sec commented Jul 13, 2026

Copy link
Copy Markdown
Member

Hey @enklht sorry for the late response, I was quite busy :). Would you mind resolving the conflicts? Afterwards I'll gladly merge it.

@enklht
enklht force-pushed the refactor-taskbar-layout branch from 5b17186 to 2c14992 Compare July 13, 2026 14:38
@enklht

enklht commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Ly-sec for the review!
I've resolved the merge conflict and added one small follow-up commit to respect the m_minimal flag introduced in the previous PR.

@Ly-sec

Ly-sec commented Jul 13, 2026

Copy link
Copy Markdown
Member

Thank you very much, I'll merge it :).

@Ly-sec
Ly-sec merged commit d177dcc into noctalia-dev:main Jul 13, 2026
1 of 2 checks passed
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.

2 participants