Skip to content

Remove "Go to Log" from Restart Required notice #88

@tashda

Description

@tashda

Problem

The "Restart Required" notice in Settings (single-bridge layout) and per-bridge BridgeSettingsView gained a long-press context menu with Go to Log in #85. The intent was to deep-link to the Z2M log entry that flagged restart_required: true.

After implementation we verified against Z2M source (zigbee2mqtt/lib/extension/bridge.ts, lib/util/settings.ts):

  • Z2M never logs the words "restart required". The flag is set silently inside settings.apply() (global options) and settings.changeEntityOptions() (entity options).
  • The only log lines emitted around those code paths are "Successfully changed options" and "Changed config for <type> <id>" — neither contains "restart" or "required", and both fire even for changes that don't require a restart.
  • Z2M's bridge.restartRequired is a private, in-memory bool. It can be set by any MQTT client (Shellbee, HA, windfront, mqtt-cli, …) at any point and persists until the Z2M process restarts. There is no log breadcrumb associated with the transition.
  • Z2M's official frontend (windfront) reflects this honestly: it shows a small pulsing dot on the inbox icon (NavBar.tsx:43-44) and a pulsing red power button next to the source in the Notifications drawer (Notifications.tsx:64-74). It does not link to a log entry — because there is no entry to link to.

Our keyword-based search ("restart required" in message text) will therefore never match. On initial connect the app has no log entries to scan anyway, so restartTriggerLogID stays nil and "Go to Log" opens the Logs page unfiltered — pure guesswork dressed as precision.

Decision

Don't try to find the log entry. Match windfront's honest minimalism: show that a restart is required, offer the restart action, stop.

Scope of revert

In #85 we added:

  • AppStore.restartTriggerLogID: UUID? (Shellbee/Core/Store/AppStore.swift)
  • updateRestartTrigger(previous:current:) and recentRestartRequiredLogID() (Shellbee/Core/Store/AppStore+Events.swift) plus their two call sites (bridge/info, bridge/response/options)
  • LogDeepLinkRequest route type (Shellbee/Core/Models/NavigationRoutes.swift)
  • @State private var logDeepLink + .navigationDestination(item:) in both SettingsView and BridgeSettingsView
  • .contextMenu with "Go to Log" + "Restart Now" on restartRequiredNotice in both views
  • restartTriggerLogID computed property in both views

All of the above should be reverted. The original restartRequiredNotice (tap → restart confirm alert) stays exactly as it was before #85.

Optional follow-up (not required by this issue)

  • Consider matching windfront's tab-bar badge: surface a small indicator on the Settings tab icon when any bridge has restart_required: true, so the notice is reachable in one glance from anywhere in the app.

Acceptance criteria

  • No long-press / context menu on the Restart Required notice
  • No restartTriggerLogID / recentRestartRequiredLogID on AppStore
  • No LogDeepLinkRequest (unless re-used elsewhere — check)
  • Tap on the notice still opens the Restart confirm alert, identical to v1.6.0 behavior

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions