fix(rift): use workspace name for menu bar label, consistent with other backends - #4
Open
Hariketsu wants to merge 1 commit into
Open
fix(rift): use workspace name for menu bar label, consistent with other backends#4Hariketsu wants to merge 1 commit into
Hariketsu wants to merge 1 commit into
Conversation
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.
Problem
With Rift as the window manager, workspace indicator labels are always the
raw 0-based index (
0, 1, 2, 3…), even when the user has configuredworkspace_namesin Rift's config.toml. The configured names never surfacein the menu bar.
This is also an inconsistency across the three WM backends: the
labelfield of
WMSpaceexists precisely to carry the WM's workspace name —AeroSpace maps
ws.nameto it (AeroSpaceAdapter.swift:50) and Yabaidecodes its per-space
labelstraight into the model — andSpaceIndicatorViewis designed to preferlabelover the index. The Riftadapter is the only backend that drops the name, leaving Rift users with
bare indices while the other two backends show names.
Cause
RiftWorkspace.toWMSpace()inRiftAdapter.swifthardcodes the label fromthe index and discards the
namefield thatrift-cli query workspacesalready returns:
Rift's workspace indices are 0-based internally (its own menu bar component
defaults to showing the index, and its CLI/commands are 0-based), so without
mapping
namethere is no way for configured names to appear.Fix
Prefer the workspace
name; fall back to the previous behavior (bareindex) when the name is empty:
Display-only change:
labelis consumed bySpaceIndicatorViewand contextmenu strings. All workspace commands (focus, move-window) use the unchanged
indexfield, whichRiftServiceconverts back to 0-based when callingrift-cli.
Compatibility note for reviewers
Rift auto-generates names (
Workspace X) for workspaces not covered byworkspace_names, sonameis effectively always non-empty. That meansusers without custom names will see
Workspace Xinstead of the bare index.If you'd rather keep the bare index in that case, I can gate name display
behind a config option — let me know.
Testing
workspace_names = ["1", "2", "3", "4"]in config.toml, indicatorsdisplay
1–4instead of0–3