Skip to content

Conversation

@multiplex55
Copy link
Owner

Motivation

  • Avoid unnecessary Dashboard.diagnostics_snapshot() calls while still providing diagnostics to widgets when present by gating snapshotting on either the dev flag or a diagnostics widget being configured.
  • Make behavior explicit and testable so the dashboard context includes diagnostics only when required.

Description

  • Change the diagnostics assignment in src/gui/mod.rs to compute diagnostics as Some(self.dashboard.diagnostics_snapshot()) when self.show_dashboard_diagnostics || has_diagnostics_widget is true, and None otherwise.
  • Add two unit tests to the existing tests in src/gui/mod.rs: diagnostics_context_includes_snapshot_when_widget_present and diagnostics_context_omits_snapshot_when_disabled_and_missing_widget to cover both inclusion and exclusion cases.
  • The change touches src/gui/mod.rs only and reuses the existing has_diagnostics_widget() helper and Dashboard.diagnostics_snapshot() accessor.

Testing

  • No automated test suite was executed as part of this change; the two new unit tests were added but not run here: diagnostics_context_includes_snapshot_when_widget_present and diagnostics_context_omits_snapshot_when_disabled_and_missing_widget in src/gui/mod.rs.
  • Existing tests were not executed in this rollout.

Codex Task

@multiplex55 multiplex55 merged commit 48847fc into master Jan 17, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/update-diagnostics-assignment-in-dashboardcontext branch January 18, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants