Skip to content

Refactor ButtonWidget to use Jetpack Compose - #6915

Draft
BFadairo wants to merge 26 commits into
home-assistant:mainfrom
BFadairo:rework/button_config_activity_compose
Draft

Refactor ButtonWidget to use Jetpack Compose#6915
BFadairo wants to merge 26 commits into
home-assistant:mainfrom
BFadairo:rework/button_config_activity_compose

Conversation

@BFadairo

@BFadairo BFadairo commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Migration of ButtonWidget from XML to Jetpack Compose & Material 3 for #6305

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Screenshots

Link to pull request in documentation repositories

User Documentation: home-assistant/companion.home-assistant#

Developer Documentation: home-assistant/developers.home-assistant#

Any other notes

@github-advanced-security github-advanced-security 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.

ktlint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

service = action,
label = label,
iconName = selectedIcon.mdiName,
serviceData = kotlinJsonMapper.encodeToString(MapAnySerializer, actionDataMap),
service = action,
label = label,
iconName = selectedIcon.mdiName,
serviceData = kotlinJsonMapper.encodeToString(MapAnySerializer, actionDataMap),
@jpelgrom

Copy link
Copy Markdown
Member

This PR appears to have become a migration to Glance for the widget and migrating the configuration to Compose. Please keep those separate to prevent a huge PR, even if it means a little more work because you have to update the configuration twice (one Compose migration, one changing the logic).

@TimoPtr

TimoPtr commented Jul 28, 2026

Copy link
Copy Markdown
Member

For the configure screen we've just migrated the Entity Widget to the new architecture. I invite you to look at it so you see what we are going to expect.

}

val dbMap: Map<String, Any?> = kotlinJsonMapper.decodeFromString(
MapAnySerializer,
}

val dbMap: Map<String, Any?> = kotlinJsonMapper.decodeFromString(
MapAnySerializer,
@BFadairo

Copy link
Copy Markdown
Contributor Author

This PR appears to have become a migration to Glance for the widget and migrating the configuration to Compose. Please keep those separate to prevent a huge PR, even if it means a little more work because you have to update the configuration twice (one Compose migration, one changing the logic).

Yea no problem, I can make some changes to split this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants