Skip to content

Hide unsaved Area and Advertise controls on Discovery - #336

Merged
bbangert merged 2 commits into
mainfrom
fix/discovery-hide-unsaved-controls
Nov 19, 2026
Merged

bbangert merged 2 commits into
mainfrom
fix/discovery-hide-unsaved-controls

Conversation

@bbangert

Copy link
Copy Markdown
Owner

The Discovery tab's Area select and Advertise toggle were never persisted or read by anything (save only sends name and friendly_name to ESPHome.update_config/1). This removes them, plus the dead toggle_advertise handler, @areas, the form fields, the mock defaults, and the area suffix in the preview card.

Tests: new discovery_live_test.exs (controls absent; editing friendly name updates the preview; saving persists it and restores the original). Full suite, format, compile --warnings-as-errors, credo --strict and dialyzer pass. No CSS/JS change, so no mix assets.deploy needed. Not hardware-verified.

🤖 Generated with Claude Code

Only the friendly name and ESPHome device name are persisted; the Area select and Advertise toggle were mock-only and never stored or used. Removed them with their handlers, assigns and mock defaults.

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The friendly-name assertion can pass from the form input value even if the Discovery preview breaks or disappears, so it must target the preview element specifically.

1 open issue
What changed in this PR

Removes nonfunctional Area and Advertise controls from Discovery so the page no longer presents settings that are not saved.

Changes:

  • Removes the unused controls, event handler, form state, mock defaults, and preview area suffix.
  • Updates module documentation to distinguish saved settings from read-only values.
  • Adds LiveView tests for control removal, friendly-name editing, and persistence, with configuration cleanup.
File Description
test/​universal_proxy_web/​live/​discovery_live_test.exs Adds Discovery rendering and friendly-name persistence tests.
lib/​universal_proxy_web/​mock_data.ex Removes unused Area and Advertise defaults.
lib/​universal_proxy_web/​live/​discovery_live.ex Removes unsaved controls and related state; updates documentation and preview.

Review effort: Balanced

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified in the removal of unsupported Discovery controls and related state.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@bbangert
bbangert merged commit 9ea73ef into main Nov 19, 2026
9 checks passed
@bbangert
bbangert deleted the fix/discovery-hide-unsaved-controls branch November 19, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants