Late review comments for entity widget configuration - #7302
Merged
jpelgrom merged 3 commits intoAug 5, 2026
Conversation
TimoPtr
approved these changes
Aug 4, 2026
jpelgrom
commented
Aug 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Addresses late review feedback for the Compose-based entity widget configuration flow (#7007), focusing on code style/visibility cleanups and improving screenshot coverage around the server picker behavior.
Changes:
- Moves constants/helpers to file scope and adjusts visibility/order of ViewModel functions for consistency.
- Updates entity widget screenshot tests to cover states with and without the server picker.
- Tweaks server selector behavior in the Compose screen (enabled/visibility handling).
Reviewed changes
Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/test/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureViewModelTest.kt | Moves test helpers/constants out of a companion object to file-level privates. |
| app/src/screenshotTest/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureScreenshotTest.kt | Renames preview state and adjusts state to exercise server-picker vs single-server UI. |
| app/src/main/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureViewModel.kt | Reorders and adjusts visibility of ViewModel methods (public/private/internal). |
| app/src/main/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureState.kt | Moves default text size constant to a private file-level constant. |
| app/src/main/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureScreen.kt | Removes dropdown enabled gating in server selector (behavior change). |
Comment on lines
249
to
258
| if (!showServerSelector) return | ||
|
|
||
| HADropdownMenu( | ||
| items = items, | ||
| selectedKey = selectedServerId, | ||
| onItemSelected = onServerSelected, | ||
| label = stringResource(commonR.string.server_select), | ||
| placeholder = stringResource(commonR.string.server_select), | ||
| modifier = Modifier.formControlWidth(), | ||
| enabled = items.isNotEmpty(), | ||
| ) |
Member
Author
There was a problem hiding this comment.
Perfect second-guessing :D
The servers list being empty is quite unlikely, as it's read from the database and uses that list size > 1 OR a widget with invalid configuration exists (no valid server selected at all).
val showServerSelector = serversDropdownItems.size > 1 ||
serversDropdownItems.none { it.key == selectedServerId }
TimoPtr
approved these changes
Aug 4, 2026
8 tasks
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.
Summary
Adresses some late review comments on #7007 which were posted on #7288 but apply equally here
internalmodifierChecklist
Select exactly one option that describes AI usage in this contribution:
Screenshots
n/a
Link to pull request in documentation repositories
n/a
Any other notes