Spaces map: a full-screen overview on Mod+O #36

Open
opened 2026-11-08 07:27:12 +01:00 by arne · 1 comment
Owner

The first version of #18. It settles where the overview lives: a full-screen view of its own, not a drawer page and not niri's overview. #3's window list goes into it; what is inside a window (tabs, terminal contents, Rex status) waits until this works.

Prototyped on a canvas: https://claude.ai/artifact/KaPeJfZrCENeFE9QkN3fjV (private). Board B is the look, and B · Map, crowded shows how it copes with 15, 40 and 80 windows.

What it is

One shell surface covering everything right of the rail, so the rail's dots line up with the rows. Mod+O opens and closes it, taking the key from niri's overview. The touchpad gesture can keep niri's.

  • One row per space, in niri's order, with the trailing empty space as a dashed box.
  • Each row draws the space's columns left to right as boxes, sized by column width. Windows stacked in a column split its box.
  • Each box shows the app and the title. No thumbnails: they stay readable when small, and niri's screenshot-window would put every capture into clipboard history (#3).
  • An outline marks what each screen shows: accent on the space with the cursor, dim on the others.
  • A space shows its name, or its number and a dim "unnamed". The count under it reads "here · 4 windows" on the space with the cursor.

Keys

h / l cursor to the column left / right
j / k cursor to the space below / above
⏎ go to the window and close the map
x close the window
r rename the space in place (⏎ saves, esc cancels, empty unsets)
H / L move the column left / right
J / K move the window to the space below / above
Mod+O, esc close

The moves are niri actions on the window under the cursor, and the map stays open after them. Moving into the trailing empty space makes a new one under it; emptying a space removes it, as niri does.

Names

Runtime only: set-workspace-name / unset-workspace-name. A name is lost at logout, and nothing in the config declares one (#35 removes programs.fjordxy.workspaces).

When it gets crowded

These come from the prototype; tune them against the dev session.

  • Rows share the height: 72px each, down to a 44px minimum.
  • A row wider than the screen is squeezed, down to 88px per column. Below 150px a box shows only the app name.
  • Past that, a row scrolls sideways to keep the cursor in view. The prototype draws a +N box instead.
  • A stack too tall for the row collapses into one box, foot (3), showing the window under the cursor.
  • At 80 windows this hides a lot. If it's still too much, make the map scroll vertically, or give the space with the cursor full height and squeeze only the others.

To check before building

  • Do WindowOpenedOrChanged, WindowClosed and WindowLayoutsChanged arrive? pos_in_scrolling_layout gives a window's column and row. #3 never saw the events on the wire.
  • Column widths: does niri report enough (tile size, or a proportion) to size the boxes?
  • The outline: can niri tell us which columns each screen is showing? If not, approximate from the focused column, or drop the outline.
  • Keyboard: an exclusive grab while open, as the drawer does.

Not in this version

  • / to filter, dimming windows that don't match
  • what runs in each terminal: Rex status, foreground process, directory, branch (#18)
  • browser tabs (#3)
  • several outputs

🤖 Generated with Claude Code

The first version of #18. It settles where the overview lives: a full-screen view of its own, not a drawer page and not niri's overview. #3's window list goes into it; what is inside a window (tabs, terminal contents, Rex status) waits until this works. Prototyped on a canvas: https://claude.ai/artifact/KaPeJfZrCENeFE9QkN3fjV (private). Board **B** is the look, and **B · Map, crowded** shows how it copes with 15, 40 and 80 windows. ## What it is One shell surface covering everything right of the rail, so the rail's dots line up with the rows. Mod+O opens and closes it, taking the key from niri's overview. The touchpad gesture can keep niri's. - **One row per space**, in niri's order, with the trailing empty space as a dashed box. - **Each row draws the space's columns left to right** as boxes, sized by column width. Windows stacked in a column split its box. - **Each box shows the app and the title.** No thumbnails: they stay readable when small, and niri's `screenshot-window` would put every capture into clipboard history (#3). - **An outline marks what each screen shows**: accent on the space with the cursor, dim on the others. - **A space shows its name, or its number and a dim "unnamed".** The count under it reads "here · 4 windows" on the space with the cursor. ## Keys | | | |---|---| | h / l | cursor to the column left / right | | j / k | cursor to the space below / above | | ⏎ | go to the window and close the map | | x | close the window | | r | rename the space in place (⏎ saves, esc cancels, empty unsets) | | H / L | move the column left / right | | J / K | move the window to the space below / above | | Mod+O, esc | close | The moves are niri actions on the window under the cursor, and the map stays open after them. Moving into the trailing empty space makes a new one under it; emptying a space removes it, as niri does. ## Names Runtime only: `set-workspace-name` / `unset-workspace-name`. A name is lost at logout, and nothing in the config declares one (#35 removes `programs.fjordxy.workspaces`). ## When it gets crowded These come from the prototype; tune them against the dev session. - **Rows share the height**: 72px each, down to a 44px minimum. - **A row wider than the screen is squeezed**, down to 88px per column. Below 150px a box shows only the app name. - **Past that, a row scrolls sideways** to keep the cursor in view. The prototype draws a `+N` box instead. - **A stack too tall for the row** collapses into one box, `foot (3)`, showing the window under the cursor. - At 80 windows this hides a lot. If it's still too much, make the map scroll vertically, or give the space with the cursor full height and squeeze only the others. ## To check before building - [ ] Do `WindowOpenedOrChanged`, `WindowClosed` and `WindowLayoutsChanged` arrive? `pos_in_scrolling_layout` gives a window's column and row. #3 never saw the events on the wire. - [ ] Column widths: does niri report enough (tile size, or a proportion) to size the boxes? - [ ] The outline: can niri tell us which columns each screen is showing? If not, approximate from the focused column, or drop the outline. - [ ] Keyboard: an exclusive grab while open, as the drawer does. ## Not in this version - `/` to filter, dimming windows that don't match - what runs in each terminal: Rex status, foreground process, directory, branch (#18) - browser tabs (#3) - several outputs 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

What niri 26.04 reports

Checked on the running session (8 windows, 5 workspaces) and in the nested dev session by moving windows by hand.

Enough to draw the map:

  • Each window's layout has pos_in_scrolling_layout (column, row) and tile_size, in logical px. Windows on inactive workspaces have them too. Box widths are tile_size[0] over the output width (1440 on eDP-1).
  • WindowLayoutsChanged arrives on every move and lists only the windows that changed. A cross-workspace move also sends WindowOpenedOrChanged with the new workspace_id. Consuming into a column shows up as the tile heights halving (928 → 460).
  • Each workspace has an active_window_id.

Not reported:

  • Which columns a screen is showing. tile_pos_in_workspace_view is null for every tiled window, even the focused one on the active workspace. The outline can't be drawn exactly. Instead, mark each space's active window, which is where you'd land.

Behaviour that changes the plan:

  • A named workspace isn't removed when it empties, and goes away once its name is unset. So "emptying a space removes it" holds only for unnamed spaces.
  • Rex already names workspaces. The running session has rune, sparkling-basin, misty-tundra and brave-ember from rexy-desk, kept while empty, and Rex status finds its desk by that name. r on one of them would cut it off from its Rex session. Either rename only unnamed spaces, or rename the Rex session too.
  • Commands sent from separate processes run in any order. Six niri msg action move-column-* calls started together landed on column 3, 2 and 3 across three identical runs. Niri.action() sends them that way today (Quickshell.execDetached). Each call also costs about 24 ms to spawn.

Requirements for the feel

  1. The map moves first. On a key it updates its own copy of the layout and animates there in the same frame, then checks that copy against niri's events. Every box is tracked by window id.
  2. Moves animate on niri's spring. Theme.spring* already matches niri's numbers. A held key carries the spring's speed into the next move instead of restarting. Rows grow and shrink when spaces come and go.
  3. One socket for actions, sent in order, in place of a process per action. This is required before held Shift+H/L can work.
  4. What niri can target:
    • By id: focus-window, move-window-to-workspace --window-id … --focus false, set-workspace-name --workspace.
    • Focused window only: move-column-left/right/to-index, consume, expel and swap.
    • So moving the cursor stays inside the map, and Shift+H/L focus the window before moving it.
    • Esc restores the focus you opened the map with, and ⏎ goes to the cursor.
  5. The map is opaque, so niri's scrolling behind it doesn't show. On ⏎, focus first, then fade the map out, so niri's last scroll is the one you see.
  6. One relayout per frame. A single move sends 2–4 events, so the map collects them and redraws once.

Target: motion within one frame (~16 ms) of a key. Only 1 and 3 together get there.

🤖 Generated with Claude Code

## What niri 26.04 reports Checked on the running session (8 windows, 5 workspaces) and in the nested dev session by moving windows by hand. **Enough to draw the map:** - Each window's `layout` has `pos_in_scrolling_layout` (column, row) and `tile_size`, in logical px. Windows on inactive workspaces have them too. Box widths are `tile_size[0]` over the output width (1440 on eDP-1). - `WindowLayoutsChanged` arrives on every move and lists only the windows that changed. A cross-workspace move also sends `WindowOpenedOrChanged` with the new `workspace_id`. Consuming into a column shows up as the tile heights halving (928 → 460). - Each workspace has an `active_window_id`. **Not reported:** - **Which columns a screen is showing.** `tile_pos_in_workspace_view` is `null` for every tiled window, even the focused one on the active workspace. The outline can't be drawn exactly. Instead, mark each space's active window, which is where you'd land. **Behaviour that changes the plan:** - **A named workspace isn't removed when it empties**, and goes away once its name is unset. So "emptying a space removes it" holds only for unnamed spaces. - **Rex already names workspaces.** The running session has `rune`, `sparkling-basin`, `misty-tundra` and `brave-ember` from rexy-desk, kept while empty, and Rex status finds its desk by that name. `r` on one of them would cut it off from its Rex session. Either rename only unnamed spaces, or rename the Rex session too. - **Commands sent from separate processes run in any order.** Six `niri msg action move-column-*` calls started together landed on column 3, 2 and 3 across three identical runs. `Niri.action()` sends them that way today (`Quickshell.execDetached`). Each call also costs about 24 ms to spawn. ## Requirements for the feel 1. **The map moves first.** On a key it updates its own copy of the layout and animates there in the same frame, then checks that copy against niri's events. Every box is tracked by window id. 2. **Moves animate on niri's spring.** `Theme.spring*` already matches niri's numbers. A held key carries the spring's speed into the next move instead of restarting. Rows grow and shrink when spaces come and go. 3. **One socket for actions, sent in order**, in place of a process per action. This is required before held Shift+H/L can work. 4. **What niri can target:** - By id: `focus-window`, `move-window-to-workspace --window-id … --focus false`, `set-workspace-name --workspace`. - Focused window only: `move-column-left/right/to-index`, consume, expel and swap. - So moving the cursor stays inside the map, and Shift+H/L focus the window before moving it. - Esc restores the focus you opened the map with, and ⏎ goes to the cursor. 5. **The map is opaque**, so niri's scrolling behind it doesn't show. On ⏎, focus first, then fade the map out, so niri's last scroll is the one you see. 6. **One relayout per frame.** A single move sends 2–4 events, so the map collects them and redraws once. Target: motion within one frame (~16 ms) of a key. Only 1 and 3 together get there. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bases/fjord#36
No description provided.