Skip to content

Multi-bridge Phase 1.3: Bridge switcher in toolbar #64

@tashda

Description

@tashda

Why

Once multiple bridges are saved (#1.1, #1.2), switching between them needs to be one tap, not three taps via Settings. The switcher is the primary daily-use UX for users who run more than one Z2M instance.

What

  • New shared component Shellbee/Shared/Components/BridgeSwitcherToolbarItem.swift:
    • Shows the active bridge's displayName plus a chevron.
    • Tap → menu listing all saved bridges with a checkmark on the active one.
    • Selecting another bridge calls environment.connect(config:) (which already calls session.disconnect() + store.reset() internally — but see Implement stateful Z2M engine and enhance UI test coverage #1.7 for connect-failure UX).
    • Hide the switcher entirely if there's only one saved bridge (avoid clutter for single-bridge users).
    • Show a brief inline progress indicator while reconnecting (read connectionState from ConnectionSessionController).
  • Wire into the toolbar of:
    • Shellbee/Features/Home/HomeView.swift
    • Shellbee/Features/Devices/DeviceListView.swift
    • Shellbee/Features/Groups/GroupListView.swift
    • Shellbee/Features/Logs/LogsView.swift

Files

  • New: Shellbee/Shared/Components/BridgeSwitcherToolbarItem.swift
  • Edit toolbars: HomeView.swift, DeviceListView.swift, GroupListView.swift, LogsView.swift
  • Add new file to membershipExceptions if it imports AppEnvironment.

Verification

Phase

Phase 1 of multi-bridge support. Depends on #1.1, #1.2.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions