Skip to content

Conversation

@frenck
Copy link
Member

@frenck frenck commented Nov 18, 2025

Proposed change

This PR introduces Home Assistant Labs.

A feature that allows integrations to expose preview features that an user can opt-in to.

CleanShot 2025-11-20 at 13 59 00

It provides a standardized way to ship preview features that users can opt into before they become standard / generally available. Labs preview features are critical bug free, fully functional features that are being refined through real-world usage and feedback before becoming standard in Home Assistant. They differ from beta testing, which evaluates release stability.

They differ from betas. A beta test, tests for general stability of Home Assistant, while these previews are aimed at validating and iterating new features that might not have yet reached the envisioned feature set.

Demo video:

CleanShot.2025-11-20.at.14.05.31.mp4

A small example implementation is provided in the Core kitchen_sink integration.

My link support and behavior; supporting deep links to specific features as well.

CleanShot.2025-11-19.at.10.22.39.mp4

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@frenck frenck marked this pull request as ready for review November 20, 2025 13:13
frenck and others added 4 commits November 20, 2025 16:02
- Fix dialog-labs-preview-feature-enable closeDialog pattern
  - Use @query to get dialog reference and call .close()
  - Create separate _dialogClosed handler for cleanup
  - Reset state properly (_backupConfig, _createBackup)

- Fix _fetchBackupConfig toggle logic
  - Always set _createBackup based on config (enable or disable)
  - Fix TypeScript optional chaining issues

- Update CSS spacing to use design tokens
  - Replace hardcoded px values with --ha-space-* tokens
  - Apply to both dialogs consistently

- Fix switch event handler
  - Use proper HaSwitch type cast instead of HTMLInputElement

- Fix ha-config-labs lifecycle and patterns
  - Use UnsubscribeFunc type from home-assistant-js-websocket
  - Make firstUpdated non-async (don't await _loadPreviewFeatures)
  - Extract URL param handling to _handleUrlParams()
  - Add proper cleanup pattern with undefined assignment

- Improve code organization
  - Remove duplicate hass-subpage wrapper
  - Use domainToName helper for integration names
  - Load title translations properly
  - Fix button variant property binding (use dot notation)
  - Remove useless confirmed/createBackup variables
  - Convert disable confirmation to cleaner await pattern

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Implements the collection pattern similar to area_registry as suggested
in review feedback. This provides better performance and cleaner code
organization.

Changes:
- Create ws-labs.ts with subscribeLabFeatures collection
- Convert HaConfigLabs to use SubscribeMixin
- Remove manual subscription and disconnectedCallback
- Automatic updates via labs_updated event through collection
- Separate translation loading from feature loading

Benefits:
- Automatic state management via collection
- Debounced updates (500ms) to prevent excessive re-renders
- Consistent pattern with other registries
- Cleaner lifecycle management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The ha-md-dialog style block with only --dialog-content-padding was
redundant since we control padding directly in the .summary element.

Changes:
- Remove ha-md-dialog CSS block
- Update .summary padding from (var(--ha-space-4) 0) to var(--ha-space-6)
- This provides consistent spacing without the unnecessary override

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
frenck and others added 2 commits November 20, 2025 17:59
- Consolidate ws-labs.ts into labs.ts file
- Sort preview features by localized integration name
- Add haStyle and clean up h1/h2 styling
- Apply spacing variable suggestions in dialogs
- Use ha-space-* variables for consistent spacing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Only load title translations for integrations that have preview features,
instead of loading all integration titles.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@frenck frenck requested a review from bramkragten November 20, 2025 18:15
frenck and others added 3 commits November 20, 2025 18:22
Use memoizeOne to ensure features are re-sorted when translations
change (e.g., language switch), while avoiding unnecessary re-sorting
on every render when dependencies haven't changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Use memoizeOne to ensure features are re-sorted when translations
change (e.g., language switch), while avoiding unnecessary re-sorting
on every render when dependencies haven't changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…istant-polymer into frenck-2025-0545

# Conflicts:
#	src/panels/config/labs/ha-config-labs.ts
bramkragten
bramkragten previously approved these changes Nov 20, 2025
@frenck frenck merged commit bb5fefc into dev Nov 20, 2025
15 checks passed
@frenck frenck deleted the frenck-2025-0545 branch November 20, 2025 20:22
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.

6 participants