Migrate entity widget configuration to Compose
Summary
- migrate
EntityWidgetConfigureActivityfrom XML views to Compose and Home Assistant Material 3 components - move configuration state, validation, creation, and update persistence into an assisted ViewModel
- preserve server selection, custom attributes, tap actions, widget themes, text colors, and existing widget values
- add focused ViewModel tests for restoration, recreation, persistence, and server changes
Closes #6307
Screenshots
| Light | Dark | Review feedback state |
|---|---|---|
Server picker fix
Testing
./gradlew --no-daemon --console=plain :build-logic:convention:ktlintFormat ktlintFormat./gradlew --no-daemon --console=plain :app:testFullDebugUnitTest --tests io.homeassistant.companion.android.widgets.entity.EntityWidgetConfigureViewModelTest
The CLA check is now passing, but the original Home Assistant CLA bot review still shows Changes requested and keeps the PR in a blocked state. Could a maintainer please dismiss the stale review when convenient? All review threads are resolved, the branch is rebased onto the latest main, and the focused tests, ktlint, and full debug build pass.
Hi @himu-gupta
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
CLA was signed.
Could you update the PR description to add screenshots, thanks.
Added light and dark screenshots to the PR description.
The UI does already look much better than from the old one.
Things to address
- Should be centered
- The picker should be aligned with the size of the inputs
- Clicking Append attributes could animate nicely the hidden field
- The
Attributemenu could/should be merge with theAdd attributeinput, to improve the UX - Changing the entity selected doesn't update the label anymore
- Server picker is using the old style
Things to change/discuss
- Update widget button logic should be improved (in another PR), to include validation on inputs today you can input a huge number for instance in the Widget text size.
- We could add a top left close button in the topbar
Added a review-feedback screenshot to the PR description showing the updated centered form with the modern server picker and append-attributes section expanded, including the merged Add attribute input/chips and entity-derived label.
Added a dedicated server picker fix screenshot to the PR description. This one matches the dark top-of-screen state from your attached image: the server picker now uses the HA dropdown style and is aligned with the selected entity picker.
I think we could remove the "Append attribute value" checkbox by only showing the tags to pick. Does it make sense to even allow custom attributes? @jpelgrom wdyt
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
Also I would like to see a close button in the topbar