Skip to content

Conversation

@fx
Copy link
Owner

@fx fx commented Jun 30, 2025

Summary

  • Removed development-specific code and debug logging from panel.js and useHomeAssistantRouting
  • Cleaned up obsolete code patterns while maintaining iframe integration and navigation functionality
  • Simplified codebase by removing unnecessary differentiation between development and production environments

Test plan

  • Verify panel loads correctly in Home Assistant
  • Confirm navigation between routes works as expected
  • Check that no console errors appear during normal operation
  • Test that iframe communication remains functional

fx added 20 commits June 30, 2025 15:57
- Remove dev-entry.js and all development-specific files
- Remove useDevHass hook and DevHomeAssistantProvider component
- Simplify routing by removing iframe-specific logic
- Update documentation to remove dev mode references
- Create unified build approach for both local and remote development
- Clean up all references to liebe-dev and localhost:3000
- Simplify Home Assistant integration to use only panel_custom

The dashboard now has a single, consistent approach for both development
and production, eliminating the complexity of maintaining separate dev modes.
- Update package name from liebe-dashboard to liebe
- Change build output directory from dist/liebe-dashboard to dist/liebe
- Rename custom panel element from liebe-dashboard-panel to liebe-panel
- Update storage keys from liebe-dashboard-config to liebe-config
- Change export filenames from liebe-dashboard-*.yaml to liebe-*.yaml
- Update all documentation to remove -dashboard references
- Change Home Assistant module paths from /local/liebe-dashboard to /local/liebe
- Update sidebar icon from mdi:view-dashboard to mdi:heart
- Update all tests to match new naming conventions

The project is now simply called "Liebe" without the redundant -dashboard suffix.
- Remove -panel suffix from custom element (now just 'liebe')
- Rename output file from custom-panel.js to panel.js
- Add support for running from any URL (localhost:3000 or remote servers)
- Create development entry point at public/panel.js for localhost:3000
- Add RemoteHomeAssistantProvider for iframe-based deployments
- Update routing to handle both local and remote deployments
- Update all documentation with remote deployment examples

Liebe can now be:
1. Installed locally in Home Assistant's www folder
2. Run from localhost:3000 during development
3. Hosted on any remote server and integrated via URL
- Remove all build:ha script references
- Remove symlink instructions
- Remove /config/www and /local/liebe references
- Simplify to just two deployment options:
  1. Development: npm run dev with localhost:3000
  2. Production: Host on any web server
- Update all documentation to reflect simplified approach

No more building, copying files, or symlinking. Just run the dev server
locally or deploy to a web server for production use.
- Remove "development" references from panel.js comments
- Change hardcoded localhost:3000 to use window.location.origin
- This allows panel.js to work from any server, not just localhost

The panel.js file is a bridge for both development and production
remote deployments, not just for development.
- Custom element names must contain a hyphen per Web Components spec
- Update panel.js to define 'liebe-panel' instead of 'liebe'
- Update all documentation to use 'liebe-panel' in Home Assistant config
- This fixes the error: 'liebe' is not a valid custom element name
- Fix formatting issues in files
- Update useHomeAssistantRouting tests to match current implementation
- Remove tests for removed message event handling functionality
- Fix ViewTabs test to check navigation instead of postMessage
- Ensure window.parent mock is set correctly in tests
@fx fx merged commit e029274 into main Jul 1, 2025
2 checks passed
@fx fx deleted the refactor/remove-dev-specific-code branch July 1, 2025 00:29
fx added a commit that referenced this pull request Jul 8, 2025
…on (#35)

* refactor: remove all development-specific code and simplify integration

- Remove dev-entry.js and all development-specific files
- Remove useDevHass hook and DevHomeAssistantProvider component
- Simplify routing by removing iframe-specific logic
- Update documentation to remove dev mode references
- Create unified build approach for both local and remote development
- Clean up all references to liebe-dev and localhost:3000
- Simplify Home Assistant integration to use only panel_custom

The dashboard now has a single, consistent approach for both development
and production, eliminating the complexity of maintaining separate dev modes.

* chore: add .claude/settings.local.json to gitignore

* refactor: remove all -dashboard suffixes from the project

- Update package name from liebe-dashboard to liebe
- Change build output directory from dist/liebe-dashboard to dist/liebe
- Rename custom panel element from liebe-dashboard-panel to liebe-panel
- Update storage keys from liebe-dashboard-config to liebe-config
- Change export filenames from liebe-dashboard-*.yaml to liebe-*.yaml
- Update all documentation to remove -dashboard references
- Change Home Assistant module paths from /local/liebe-dashboard to /local/liebe
- Update sidebar icon from mdi:view-dashboard to mdi:heart
- Update all tests to match new naming conventions

The project is now simply called "Liebe" without the redundant -dashboard suffix.

* refactor: simplify naming and enable remote server deployment

- Remove -panel suffix from custom element (now just 'liebe')
- Rename output file from custom-panel.js to panel.js
- Add support for running from any URL (localhost:3000 or remote servers)
- Create development entry point at public/panel.js for localhost:3000
- Add RemoteHomeAssistantProvider for iframe-based deployments
- Update routing to handle both local and remote deployments
- Update all documentation with remote deployment examples

Liebe can now be:
1. Installed locally in Home Assistant's www folder
2. Run from localhost:3000 during development
3. Hosted on any remote server and integrated via URL

* docs: remove all local build and installation references

- Remove all build:ha script references
- Remove symlink instructions
- Remove /config/www and /local/liebe references
- Simplify to just two deployment options:
  1. Development: npm run dev with localhost:3000
  2. Production: Host on any web server
- Update all documentation to reflect simplified approach

No more building, copying files, or symlinking. Just run the dev server
locally or deploy to a web server for production use.

* fix: update panel.js to work with any URL, not just localhost

- Remove "development" references from panel.js comments
- Change hardcoded localhost:3000 to use window.location.origin
- This allows panel.js to work from any server, not just localhost

The panel.js file is a bridge for both development and production
remote deployments, not just for development.

* fix: use valid custom element name 'liebe-panel' instead of 'liebe'

- Custom element names must contain a hyphen per Web Components spec
- Update panel.js to define 'liebe-panel' instead of 'liebe'
- Update all documentation to use 'liebe-panel' in Home Assistant config
- This fixes the error: 'liebe' is not a valid custom element name

* fix: add null checks to prevent postMessage errors in panel.js

* fix: add null checks to route setter in panel.js

* fix: use script source origin for iframe URL instead of window.location.origin

* fix: handle iframe mode without WebSocket connection

* fix: check if stateChangeUnsubscribe is a function before calling

* fix: use updateEntities instead of non-existent setEntities

* fix: disable URL updates to prevent Home Assistant navigation issues

* Revert "fix: disable URL updates to prevent Home Assistant navigation issues"

This reverts commit 5e26cbf.

* fix: prevent Home Assistant navigation errors by not dispatching location-changed for sub-routes

* fix: correct URL handling to prevent double appending and support initial route loading

* fix: implement proper initial route loading with iframe requesting route when ready

* chore: remove debug logging from panel.js and useHomeAssistantRouting

* fix: resolve linting and test failures

- Fix formatting issues in files
- Update useHomeAssistantRouting tests to match current implementation
- Remove tests for removed message event handling functionality
- Fix ViewTabs test to check navigation instead of postMessage
- Ensure window.parent mock is set correctly in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants