diff --git a/CHANGELOG.md b/CHANGELOG.md index 824800f..57303a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to the OpenClaw Home Assistant Integration will be documented in this file. +## [0.1.53] - 2026-02-23 + +### Fixed +- Fixed chat scrolling UP to an older message instead of staying at the bottom when a bot reply arrives. +- Eliminated requestAnimationFrame race condition in `_scrollToBottom()` that caused `_autoScrollPinned` to be incorrectly set to false when rapid re-renders overlapped. +- Added `overflow-anchor: none` to the messages container to prevent browser scroll anchoring artifacts after innerHTML replacement. + ## [0.1.52] - 2026-02-23 ### Added diff --git a/custom_components/openclaw/__init__.py b/custom_components/openclaw/__init__.py index 7963865..00a89ae 100644 --- a/custom_components/openclaw/__init__.py +++ b/custom_components/openclaw/__init__.py @@ -93,7 +93,7 @@ _CARD_PATH = Path(__file__).parent / "www" / _CARD_FILENAME # URL at which the card JS is served (registered via register_static_path) _CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}" # Versioned URL used for Lovelace resource registration to avoid stale browser cache -_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.52" +_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.53" OpenClawConfigEntry = ConfigEntry diff --git a/custom_components/openclaw/manifest.json b/custom_components/openclaw/manifest.json index 5f7189f..aedc099 100644 --- a/custom_components/openclaw/manifest.json +++ b/custom_components/openclaw/manifest.json @@ -8,7 +8,7 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues", "requirements": [], - "version": "0.1.52", + "version": "0.1.53", "dependencies": ["conversation"], "after_dependencies": ["hassio", "lovelace"] } diff --git a/custom_components/openclaw/www/openclaw-chat-card.js b/custom_components/openclaw/www/openclaw-chat-card.js index 8500a20..be42504 100644 --- a/custom_components/openclaw/www/openclaw-chat-card.js +++ b/custom_components/openclaw/www/openclaw-chat-card.js @@ -13,7 +13,7 @@ * + subscribes to openclaw_message_received events. */ -const CARD_VERSION = "0.3.10"; +const CARD_VERSION = "0.3.11"; // Max time (ms) to show the thinking indicator before falling back to an error const THINKING_TIMEOUT_MS = 120_000; @@ -1782,12 +1782,10 @@ class OpenClawChatCard extends HTMLElement { } _scrollToBottom(force = false) { - requestAnimationFrame(() => { - const container = this.shadowRoot?.querySelector(".messages"); - if (container && (force || this._autoScrollPinned)) { - container.scrollTop = container.scrollHeight; - } - }); + const container = this.shadowRoot?.querySelector(".messages"); + if (container && (force || this._autoScrollPinned)) { + container.scrollTop = container.scrollHeight; + } } _formatTime(isoString) { @@ -1909,6 +1907,7 @@ class OpenClawChatCard extends HTMLElement { .messages { height: ${config.height || "500px"}; overflow-y: auto; + overflow-anchor: none; padding: 12px 16px; display: flex; flex-direction: column;