Skip to content

Multi-bridge Phase 2.3: Update every UI consumer to specify bridge #71

@tashda

Description

@tashda

Why

After #2.2 re-keys AppStore, the ~50 view files that read environment.store.* flatly all need to declare which bridge they're bound to. This is the bulk UI sweep.

Pattern

  • Add a SwiftUI environment value BridgeScope:
    • @Environment(\.bridgeScope) var bridgeScope: BridgeID?
    • nil = "all bridges" (used for merged Home, merged Logs).
    • non-nil = single bridge (every detail view).
  • Top-level views set .bridgeScope based on the active switcher selection or the current navigation stack.
  • Detail views read bridgeScope and use store.devices(for:) / store.device(named:in:) etc.

Files (full inventory)

Home (7): HomeView.swift, HomeLogsCard.swift, PermitJoinSheet.swift, HomeBridgeCard.swift, HomeDevicesCard.swift, HomeGroupsCard.swift, HomeMeshCard.swift. Home's layout decision (merged vs per-bridge) is in #2.4.

Devices (11): DeviceListView.swift, DeviceDetailView.swift, DeviceFirmwareMenu.swift, DeviceListViewModel.swift, DeviceBindView.swift, AddBindingSheet.swift, DeviceSettingsView.swift, DeviceReportingView.swift, DeviceLogsView.swift, DeviceDocView.swift, DevicePairingSheet.swift.

Groups (8): GroupListView.swift, GroupDetailView.swift, GroupDetailViewModel.swift, GroupMembersSection.swift, GroupListViewModel.swift, GroupSettingsView.swift, AddGroupMembersSheet.swift, AddGroupMemberDeviceRow.swift.

Logs (6): LogsView.swift (gains a bridge filter chip group; nil chip = all), LogDetailView.swift, BridgeLogView.swift, LogRowView.swift (gains bridge badge), LogDeviceFilterSheet.swift, LogDetailDevicesSection.swift.

Bridge (2): TouchlinkView.swift, TouchlinkGuideView.swift — inherently per-bridge; gate with a bridge picker if entered from merged Home.

Pairing (1): PairingWizardView.swift — single-bridge by nature; carry bridgeID through wizard state.

Notifications (1): InAppNotificationOverlay.swift — show optional bridge badge on notification cards.

Settings (16): MQTTSettingsView, NetworkSettingsView, HealthSettingsView, FrontendSettingsView, SerialSettingsView, OTASettingsView, LogOutputView, HomeAssistantSettingsView, AvailabilitySettingsView, NetworkAccessSettingsView, AboutView, Backup/BackupView.swift, Developer/MQTTInspectorView.swift. MainSettingsView lists settings per active bridge — picker at top.

Onboarding (1): OnboardingView.swift.

Shared (3): Shared/Components/CopyableRow.swift (no change — uses global notification queue), Shared/Components/DevicePickerRow.swift (passes bridgeID for isAvailable()), Shared/Components/Doc/PairingGuideExperienceView.swift.

Verification

Phase

Phase 2 of multi-bridge support. Depends on #2.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions