Skip to content

feat: Add MeshCore Message Card with link copying and multi-language …#22

Closed
dida886 wants to merge 3 commits into
jpettitt:mainfrom
dida886:main
Closed

feat: Add MeshCore Message Card with link copying and multi-language …#22
dida886 wants to merge 3 commits into
jpettitt:mainfrom
dida886:main

Conversation

@dida886

@dida886 dida886 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🚀 What's New?

This PR introduces a fully-featured MeshCore Message Card for Home Assistant, allowing users to send and receive messages via MeshCore channels and contacts directly from the dashboard.


✨ Features

Core Functionality

  • Send messages to MeshCore channels and contacts
  • View message history – last 20 messages from Home Assistant logbook
  • Auto-refresh – history updates automatically 5 seconds after sending a message
  • Channel/Contact selection – dynamic list with easy switching between modes

Link Handling & Copying

  • Auto-detect URLs – links (http/https) are automatically detected in messages
  • Highlighted links – displayed in blue with underline for easy identification
  • Click to copy URL – clicking on a link copies its address to clipboard
  • Long press to copy – long press (500ms) on any message copies the full text
  • Visual feedback – "Copied!" overlay appears on the copied element (link or message)

User Experience

  • Color-coded messages – green for sent, blue for received messages
  • Time formatting – human-readable timestamps (e.g., "5m ago", "2h ago")
  • Status indicators – sending, success, and error messages
  • Manual refresh – refresh button to manually update message history
  • Responsive design – works perfectly on both mobile (touch) and desktop (mouse)

Internationalization

  • Multi-language support – EN, FR, NL, DE, PL
  • Localized messages – all user-facing text is translated
  • "Copied!" feedback – translated based on user's language preference

📊 Technical Implementation

  • Logbook API – uses Home Assistant logbook endpoint to fetch message history
  • MeshCore servicessend_message and send_channel_message for sending
  • Entity discovery – automatic detection of message entities for channels/contacts
  • Web Components – built as a custom Home Assistant card
  • Long press detection – uses pointerdown/pointerup events for universal compatibility
  • Link detection – regex-based URL detection with secure HTML rendering

🧪 Testing

  • Sending messages to channels
  • Sending messages to contacts
  • Message history loading
  • Auto-refresh after sending (5 seconds)
  • Link detection and highlighting
  • Link copying (click)
  • Full message copying (long press)
  • Long press on mobile (touch)
  • Long press on desktop (mouse)
  • Multi-language support (EN, PL tested)
  • Error handling and status messages
  • Responsive layout (mobile/desktop)
  • Clipboard fallback

📝 Additional Notes

Configuration

The card auto-discovers all available channels and contacts from the MeshCore integration. No manual configuration is needed – users just add the card and start using it.

type: custom:meshcore-message-card
message-card-screenshot

Damon and others added 3 commits June 16, 2026 14:54
- Remove spinning icon from the initial empty state message
- Only show loading spinner during actual history loading (when a channel/contact is selected)
- Prevents misleading 'loading' indicator when no channel/contact is selected

Before: Spinner displayed with 'Select channel...' text
After: Clean text only, spinner appears only during actual data fetch
@dida886 dida886 closed this Jun 17, 2026
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.

1 participant