Repository navigation
Commit 31f230e
authored
fix(tui): cycle to real workspaces instead of a phantom "default" (#4126)
`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>1 parent bfa68b2 commit 31f230e
1 file changed
Lines changed: 38 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
1218 | | - | |
1219 | | - | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1220 | 1226 | | |
1221 | 1227 | | |
1222 | | - | |
1223 | 1228 | | |
1224 | 1229 | | |
1225 | 1230 | | |
| |||
1231 | 1236 | | |
1232 | 1237 | | |
1233 | 1238 | | |
1234 | | - | |
1235 | 1239 | | |
1236 | 1240 | | |
1237 | 1241 | | |
| |||
4177 | 4181 | | |
4178 | 4182 | | |
4179 | 4183 | | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + | |
4180 | 4214 | | |
4181 | 4215 | | |
4182 | 4216 | | |
| |||
0 commit comments