feat(minimap): add workspace window minimap module#817
Open
kiryl wants to merge 3 commits into
Open
Conversation
CompositorService used to embed CompositorState by value, so every ServiceEvent<CompositorService> variant carried ~280 bytes. Modules that included ServiceEvent in their own Message enum (e.g. window_title) had to box it themselves to keep clippy's large_enum_variant lint happy — boilerplate scattered across consumers for a problem that lives at the source. Move the indirection into CompositorService itself: state is now Box<CompositorState>. The handle stays ~16 bytes, ServiceEvent becomes small, and consumers don't need to box anything. window_title sheds its Box<ServiceEvent<...>> as a result. App::Message is a top-level dispatcher whose variant size disparity is intrinsic to its role (network/bluetooth service messages are naturally big; unit variants are tiny). Box-ing every "big" sub- message there would just push verbosity onto call sites without runtime benefit, so it gets a documented allow(clippy::large_enum_variant).
Introduces a per-window record (CompositorWindow) carrying workspace membership, focus/floating/urgent flags, and tile geometry (grid index and size), plus a window list in the generic compositor state. The Niri backend populates it from its event stream; the Hyprland backend leaves the list empty for now (placeholder), so window-level features are Niri-only until it's filled in. No consumer yet — the new state intentionally warns as unread until the minimap module is added.
A compact visualisation of the active workspace's tiled window layout in the status bar. Tiled windows are laid out by their column/row index with proportional sizes and scaled to fit; the focused window is highlighted and urgent windows use the danger color. Floating windows have no grid position, so they aren't rendered; showing them is something to explore later, once niri exposes enough information to place them. Hyprland doesn't expose per-window layout, so the widget stays hidden there. Adds a `Minimap` module name to config; opt-in via the user's module order list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Minimap module: a compact, scaled visualisation of the active
workspace's tiled window layout in the bar. Tiled windows are drawn by their
column/row index with proportional sizes; the focused window is highlighted and
urgent windows use the danger color. Opt-in — add
"Minimap"to a module listin your config.
Behaviour
per-window layout info.
What's inside
Three commits:
refactor(compositor): box state inside CompositorService— boxes theservice state so
ServiceEventstays small.refactor(compositor): track per-window state in compositor abstraction—adds a per-window record (
CompositorWindow: workspace, focus/floating/urgentflags, tile grid index + size) to the generic compositor state, produced by
the Niri backend (Hyprland leaves the window list empty for now).
feat(minimap): add workspace window minimap module— the module itself: asingle
icedcanvas renderer, wired into config/app, with a website docsentry.
Net: +333/-10 across 10 files; the module is ~250 lines.
Follow-up (not in this PR)
A spatial variant — drawing the on-screen viewport rectangle and placing
floating windows within it — needs the workspace scrolling view position,
which I've proposed for niri in niri-wm/niri#4147. A working implementation
built on that lives on my branch
kiryl/ashell@feat/minimap-scrolling-view-pos.It's intentionally left out here so this PR builds against released
niri-ipcand works on any current niri; I'll follow up once the niri side lands.