Repository navigation
Hide unsaved Area and Advertise controls on Discovery - #336
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟡 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The Discovery tab's Area select and Advertise toggle were never persisted or read by anything (save only sends
nameandfriendly_nametoESPHome.update_config/1). This removes them, plus the deadtoggle_advertisehandler,@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 nomix assets.deployneeded. Not hardware-verified.🤖 Generated with Claude Code