Skip to content

Integrate Home Assistant data table with enhanced UI features #756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

brayStorm
Copy link

Summary

  • Integrate Home Assistant style data table component for device list view
  • Add text-based online/offline status indicators with visual dots for better accessibility
  • Implement comprehensive table view with sorting and filtering capabilities
  • Fix mDNS display to use configuration filename instead of device name
  • Enhance card layout with improved grid responsiveness and theming
  • Fix icon colors in dropdown menus for better visibility

Key Features

  • HA Data Table Integration: Implements Home Assistant's data table pattern for consistent UX across ESPHome and HA ecosystem
  • Dual View Modes: Toggle between card view and table view with persistent user preferences
  • Advanced Sorting: Sort by device name, IP address, or connection status with proper status ordering
  • Status Filtering: Filter devices by online/offline status for easier management
  • Responsive Design: Adaptive grid layout supporting 1-5 columns based on screen size
  • Enhanced Accessibility: Text-based status indicators combined with visual dots

Technical Implementation

  • New esphome-data-table component following HA design patterns
  • Device IP resolution API integration for accurate network information
  • LocalStorage-based preference persistence for view settings
  • Comprehensive CSS theming supporting both light and dark modes
  • Proper mDNS address formatting using configuration filenames

Test Plan

  • Verify HA-style data table renders correctly with proper theming
  • Test table sorting by name, IP address, and status with correct ordering
  • Confirm status filtering works for online/offline devices
  • Verify text status indicators display correctly in both card and table views
  • Confirm mDNS addresses show configuration filename (e.g., "device-name.local")
  • Check responsive grid layout across different screen sizes (1-5 columns)
  • Validate icon colors in dropdown menus are properly visible in all themes
  • Test preference persistence across browser sessions
  • Verify compatibility with existing device management workflows

Major Features:
- Add table view with HA-style data table implementation
- Enhanced card view with status badges and IP/mDNS information display
- Sorting and filtering functionality for both views
- Persistent user preferences (view mode, sort, filter settings)
- Mobile responsive controls and overflow menus

UI/UX Improvements:
- Consistent status indicators with proper colors (online/offline/discovered)
- Clean status badges without background colors as requested
- Proper mDNS hostname display and formatting
- Fixed z-index layering issues between dropdowns and action buttons
- Improved icon colors in action menus (both light and dark modes)
- Consolidated styling architecture in respective components

Technical Enhancements:
- Device IP resolution API integration with 30-second refresh intervals
- Proper component separation (styles moved to correct components)
- Enhanced CSS specificity for icon color overrides
- Fixed TypeScript compilation errors and code formatting
- Improved error handling and graceful fallbacks

Bug Fixes:
- Fixed duplicate status indicators in card view
- Resolved status indicator visibility in table view
- Fixed action menu icon colors in both views
- Corrected web visit URL formatting for mDNS hostnames
- Fixed sorting functionality in table view
- Resolved filter functionality issues
- Fixed z-index conflicts between UI elements
- Use device configuration filename (without .yaml/.yml extension) for mDNS construction
- Maintains fallback to device.address if it ends with .local
- Fixes both card view and table view displays
@swoboda1337
Copy link
Contributor

swoboda1337 commented Jun 18, 2025

I tried this. IP shows as the mDNS name for all devices except one and in table view there is no IP address at all everything is "-":

image
image

@balloob
Copy link
Member

balloob commented Jun 18, 2025

Let's pull in the data table like how HACS does it, with a git submodule: https://github.com/hacs/frontend

Could you also include screenshots?

Here is a mockup that we've been working on based on the data table. Could you make it look like this?

App

@brayStorm
Copy link
Author

I tried this. IP shows as the mDNS name for all devices except one and in table view there is no IP address at all everything is "-":

image image

Waiting on PR on esphome esphome/esphome#9006

@brayStorm
Copy link
Author

Let's pull in the data table like how HACS does it, with a git submodule: https://github.com/hacs/frontend

Could you also include screenshots?

Here is a mockup that we've been working on based on the data table. Could you make it look like this?

App

Yes - give me a little bit.

@balloob
Copy link
Member

balloob commented Jun 20, 2025

Any reason we would want to show the IP address and not just show the mdns name? (as-in, do we need that new API?)

@swoboda1337
Copy link
Contributor

Any reason we would want to show the IP address and not just show the mdns name? (as-in, do we need that new API?)

Agreed, not sure we even need the mdns name as its in the config.

@Misiu
Copy link
Contributor

Misiu commented Jun 24, 2025

Agreed, not sure we even need the mdns name as its in the config.

name_add_mac_suffix affects the device name. Doesn't it also affect the mDNS name? If yes, then maybe we should display the actual mDNS name.

@jesserockz
Copy link
Member

Agreed, not sure we even need the mdns name as its in the config.

name_add_mac_suffix affects the device name. Doesn't it also affect the mDNS name? If yes, then maybe we should display the actual mDNS name.

Yes, but the dashboard is not the place if you are writing a config that has the suffix enabled. The dashboard works on one YAML per one device only

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.

5 participants