Conversation
`cycle_workspace` hardcoded "default" when entering the named-workspace scope from the "all" scope (and when wrapping around). This assumed the server-provided `workspace_names` list always contains "default" and lists it first. That assumption does not hold: the TUI populates `workspace_names` from `ListWorkspaces`, which is membership-scoped per principal. A non-admin user who is not a member of the "default" workspace receives a list that omits it entirely. In that case, after one full cycle the scope indicator lands on "default" — a workspace that does not exist in the list — and the next cycle finds no match, flipping straight back to "all". The user can never return to any of their real workspaces by cycling. Enter the named scope at `workspace_names.first()` instead, and only when at least one workspace is known. The stale `current_workspace = "default"` writes in the "all" branches are dropped since `current_workspace` is unused while `all_workspaces` is set. Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
udsy19
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
October 2, 2026 15:15
|
All contributors have signed the DCO ✍️ ✅ |
Contributor
Author
|
I have read the DCO document and I hereby sign the DCO. |
Contributor
Author
|
recheck |
This branch has not been deployed
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
The dashboard workspace-scope shortcut (
w) permanently breaks for any principal whose visible workspace list does not contain"default": after one cycle it oscillates between theallscope and a nonexistent"default"workspace, and the named workspaces can never be selected again.Root cause
App::cycle_workspace(crates/openshell-tui/src/app.rs) leaves theallscope by hardcodingself.current_workspace = "default", then walks forward viaposition(current) + 1. Butworkspace_namescomes from the server'sListWorkspaces, which is membership-scoped per principal (openshell-server/src/grpc/workspace.rs::membership_filter_subject) — a non-admin only sees workspaces they belong to. If that list omits"default"(e.g.["team-a","team-b"]), the next press hasposition("default") == None, hitting the wrap-to-allarm, so the selector is stuck betweenalland a phantom forever and the follow-up refresh queries a workspace the user isn't in.Fix
Leave the
allscope by returning to the first known workspace (workspace_names.first()), only entering named scope when at least one workspace is known. The stalecurrent_workspace = "default"assignments in the all-scope branches are removed (unused whileall_workspacesis set;workspace_display()returns"all").Tests
cycle_workspace_without_default_stays_on_real_workspaces(app.rs): with["team-a","team-b"], every named-scope landing must be a real workspace and both must be reachable. Fails before (cycled to 'default', which is not a known workspace), passes after.cargo test -p openshell-tui: 88 passed (the sibling default-first test still passes).