Skip to content

feat: render the workspace sidebar as a grid in Grid layout - #318

Open
AldenDana wants to merge 2 commits into
pop-os:masterfrom
AldenDana:grid-workspaces
Open

feat: render the workspace sidebar as a grid in Grid layout#318
AldenDana wants to merge 2 commits into
pop-os:masterfrom
AldenDana:grid-workspaces

Conversation

@AldenDana

@AldenDana AldenDana commented Jul 11, 2026

Copy link
Copy Markdown

Implements the overview half of #51, companion to pop-os/cosmic-comp#2555.

When workspace_layout is Grid, the workspace sidebar arranges thumbnails in a columns x rows grid (cosmic::widget::grid, chunked by workspace_grid_columns from the already-subscribed comp config) instead of a single strip; otherwise behaves like Vertical.

Sort order fix. Workspace coordinates are [x, y, ...] per the protocol convention. The previous code sorted workspaces with a plain lexicographic comparison on that coordinate vector, which sorts column-first — a no-op for the single-column case Vertical layout always produced, but it scrambles the reading order once Grid coordinates are genuinely 2D. Now sorts row-first (y, then x) so the grid reads left-to-right, top-to-bottom.

Rename support. Adds a pencil button (shown on hover, next to the existing pin button) that turns a workspace's label into an inline text field; Enter submits a zcosmic_workspace_handle_v2 rename request, Escape or the X cancels. Depends on pop-os/cosmic-comp#2556 handling that request compositor-side (previously defined in the protocol but unhandled).

Depends on the cosmic-comp-config changes from pop-os/cosmic-comp#2555 (same [patch] note as the settings PR).

@AldenDana

Copy link
Copy Markdown
Author

AI disclosure

This implementation was developed with assistance from Claude (Anthropic's AI coding assistant), directed and reviewed by me throughout — I specified the requirements, reviewed the generated diffs, and tested every feature live on my own machine. I'm continuing to work with Claude to address review feedback, so turnaround should be quick either way.

  • I have disclosed use of any AI generated code in my commit messages.
    • (Disclosing here in the PR rather than retroactively rewriting already-pushed commit messages.)
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

When the compositor's workspace_layout is Grid, arrange the workspace
thumbnails in a columns x rows grid (chunked by workspace_grid_columns)
instead of a single strip. The overview otherwise behaves like the
Vertical layout (sidebar beside the toplevels).

Requires the cosmic-comp Grid layout change (WorkspaceLayout::Grid in
cosmic-comp-config). Implements the overview half of pop-os#51.

AI-assisted commit: implemented with Claude (Anthropic's AI coding assistant); the author directed the requirements, reviewed the generated diff, and tested the resulting behavior.
Sort the overview in row-major reading order: coordinates are
[x, y, ...] per protocol convention, and a plain lexicographic sort
on the coordinate vector was sorting column-first instead of
row-first, scrambling the Grid layout.

Also adds a pencil button (shown on hover, next to the pin button)
that turns a workspace's label into an inline text field. Enter
submits a zcosmic_workspace_handle_v2 rename request; Escape or the
X cancels.

AI-assisted commit: implemented with Claude (Anthropic's AI coding assistant); the author directed the requirements, reviewed the generated diff, and tested the resulting behavior.
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