Skip to content

fix(tui): expose workspace switching from providers pane #3112

Closed

Description

@johntmyers

User Story

As an OpenShell TUI user managing providers, I want to switch the active workspace while the Providers pane is focused, so that I can inspect and manage workspace-scoped providers without navigating to the Sandboxes pane first.

Problem Statement

The TUI has one dashboard-wide workspace selection, and changing it refreshes both providers and sandboxes. However, the w workspace shortcut is handled and advertised only while the Sandboxes pane has focus. The Providers pane has no visible workspace-switch action even though provider records are workspace-scoped.

This makes the provider UI appear gateway-global and obscures the isolation behavior implemented by #2243. Users must discover the non-obvious workaround of moving focus to Sandboxes, pressing w, and then returning to Providers.

Impact / Why This Matters

Providers contain workspace-owned credentials and may share the same name across workspaces. Hiding workspace selection from the Providers pane makes it difficult to understand which provider set is being displayed and increases the chance that users inspect or mutate the wrong workspace's provider.

The current workaround is insufficient because workspace is a dashboard-level scope, not a sandbox-only concept, and the title bar alone does not explain how to change it while working with providers.

Acceptance Criteria

  • Pressing w while the Providers pane is focused cycles the dashboard workspace using the same sequence and semantics as the Sandboxes pane.
  • The Providers navigation hints display [w] Workspace when workspace switching is available.
  • Switching workspace from Providers updates the title bar and refreshes both provider and sandbox lists.
  • Provider and sandbox cursor selections reset safely when the workspace changes.
  • The all workspace view remains supported, and provider creation continues to require selecting a specific workspace.
  • Tests cover workspace switching with Providers focused, including the pending refresh state and navigation hint.

Reproduction Steps

  1. Configure a gateway with at least two workspaces and providers in each workspace.
  2. Run openshell term.
  3. Focus the Providers pane.
  4. Observe that the navigation bar does not advertise a workspace action and pressing w has no effect.
  5. Move focus to Sandboxes and press w.
  6. Observe that the dashboard workspace changes and both sandbox and provider rows refresh.

Environment

  • OpenShell: current main at 07453f29
  • OS: all supported TUI platforms
  • Runtime, deployment, or integration: openshell term

Agent Investigation

The provider backend is already workspace-scoped. This issue is limited to TUI discoverability and input handling.

  • App::cycle_workspace changes the dashboard-wide scope, resets both sandbox and provider selection indices, and sets pending_workspace_refresh.
  • The event loop responds by refreshing both providers and sandboxes.
  • refresh_providers sends either the selected workspace or all_workspaces = true to ListProviders.
  • handle_sandboxes_key maps w to cycle_workspace, but handle_providers_key has no equivalent mapping.
  • The Sandboxes navigation bar advertises [w] Workspace; the Providers navigation bar does not.

Relevant locations:

  • crates/openshell-tui/src/app.rs: cycle_workspace, handle_providers_key, handle_sandboxes_key
  • crates/openshell-tui/src/lib.rs: pending workspace refresh handling and refresh_providers
  • crates/openshell-tui/src/ui/mod.rs: dashboard navigation hints

Alternatives Considered

A separate provider-only workspace selector would create two competing scopes on the same dashboard and allow provider and sandbox panes to show different workspaces. Reusing the existing dashboard-wide workspace selection preserves the current model and requires only exposing the existing action consistently.

Activity

  1. johntmyers commented on Sep 1, 2026

    @johntmyers
    CollaboratorAuthor

    🏗️ build-plan

    Implementation Plan

    Issue type: fix
    Complexity: Low
    Confidence: High — clear path

    Summary

    Expose the dashboard's existing workspace cycle action while the Providers tab is focused and advertise the shortcut in the Providers navigation bar. Reuse the existing cycle_workspace and pending-refresh path, which already updates the title-bar scope, resets both cursors, preserves the all view, and refreshes provider and sandbox lists.

    Scope

    • crates/openshell-tui/src/app.rs: bind w in the Providers key handler and add focused state-transition coverage.
    • crates/openshell-tui/src/ui/mod.rs: add the Providers [w] Workspace hint and a render-level assertion for it.
    • crates/openshell-tui/src/lib.rs: no code change; verify the existing pending-refresh handler remains the shared provider/sandbox refresh path.

    Implementation Steps

    1. Route Providers-tab w input through the existing App::cycle_workspace method.
    2. Add [w] Workspace to the Providers-tab navigation hints.
    3. Add an App unit test covering workspace sequence, provider/sandbox cursor reset, and the pending refresh state.
    4. Add a UI render test covering the Providers navigation hint.
    5. Run targeted TUI tests and the repository pre-commit checks.

    Test Plan

    • Unit tests: Add coverage in app.rs for Providers-focused workspace cycling and state reset; add render coverage in ui/mod.rs for the Providers navigation hint.
    • Integration tests: N/A — the shared refresh dispatch already exists and this change only exposes its existing state transition from another focused pane.
    • E2E tests: N/A — no e2e/ behavior or gateway/sandbox infrastructure changes.

    Risks & Open Questions

    • Keep the change scoped to the Providers tab. Global Settings uses a separate handler and navigation variant and is not named by this issue.
    • No LSM compatibility impact; the change does not touch process identity, /proc, binary execution, or inter-process visibility.

    Documentation Impact

    • No published, architecture, gateway configuration, compute-driver, or Helm documentation changes expected; the visible in-product navigation hint documents the shortcut.

    Revision 1 — initial plan

  2. johntmyers commented on Sep 1, 2026

    @johntmyers
    CollaboratorAuthor

    🏗️ build-from-issue-agent

    Implementation Complete

    PR: #3115

    What was built

    The Providers tab now handles w with the existing dashboard workspace cycle action and advertises [w] Workspace. The shared refresh path continues to update both provider and sandbox lists and reset both selections safely.

    Tests

    • Unit/render: 2 tests added
    • Integration: N/A
    • E2E: N/A
    • Verification: mise run pre-commit and the full mise run test suite pass

    Docs updated

    • .agents/skills/tui-development/SKILL.md shortcut table and workspace-switch lifecycle

    The issue will auto-close when the PR is merged.

  3. added a commit that references this issue on Sep 2, 2026
    3c30abc
  4. added a commit that references this issue on Sep 2, 2026
    da35138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions