Open
Conversation
Move root.visibility = View.VISIBLE before the first safelyAttachOrUpdate() call in shrinkToBubble() so the overlay window is added to the WindowManager as VISIBLE from the start. On the FireTV Cube (AFTGAZL / SDK 28), adding the root as GONE and then flipping to VISIBLE afterwards was not picked up by the compositor without an explicit updateViewLayout(), leaving the bubble clock invisible until a dashboard overlay or picker triggered a full WM pass. https://claude.ai/code/session_01DuqQ5oXJhwe63UtFLaxDxL
The bootstrap ticker re-injects injectSpaNavigationHook() every 500ms via evaluateJavascript(). When the hook was already installed (__vaNavHooked == true), the re-injection path updated __vaLastHref to the current URL but never called onPathChange(). On the FireTV Cube, the WebView is reparented into the overlay root FrameLayout before the root is attached to the WindowManager. In this detached state, in-page JS timers (setTimeout/setInterval) are throttled, so the pushState interceptor's debouncedNotify() callback and the 500ms polling setInterval never fire. The re-injection was the only mechanism that could still detect the change (evaluateJavascript runs from the main Handler), but it silently absorbed it. Now the re-injection path compares location.href against __vaLastHref and calls onPathChange() when they differ, acting as a reliable fallback for devices that throttle detached-view JS timers. https://claude.ai/code/session_01DuqQ5oXJhwe63UtFLaxDxL
The JS navigation hook relies on in-page setTimeout/setInterval
timers which may not fire when the WebView is in a detached view
tree (not yet attached to WindowManager). Add a native-level
fallback: the bootstrap ticker now also calls
evaluateJavascript("location.href") with a callback — the
callback fires on the main thread regardless of in-page timer
state, so it reliably detects URL changes.
Also add diagnostic logging at every step:
- install() sequence + webView.url at entry
- bootstrap ticker native-poll URL changes
- NavBridge.onPathChange (promoted from debug to info)
- handlePossibleInAppNavigation entry + profile + phase
- shrinkToBubble entry + rootToken + dimensions after attach
https://claude.ai/code/session_01DuqQ5oXJhwe63UtFLaxDxL
Replace Unicode left/right double quotation marks (U+201C/U+201D) with ASCII double quotes (U+0022) throughout OverlayController.kt and OverlayHost.kt. These were inadvertently introduced by the edit tool and caused syntax errors on the Windows build. https://claude.ai/code/session_01DuqQ5oXJhwe63UtFLaxDxL
…/clock On the FireTV Cube, after moveTaskToBack the WebView loads HA and stays on /lovelace/default_view. Home Assistant never pushes a navigation to /view-assist/clock, so shrinkToBubble() was never called and the overlay root was never attached to the WindowManager. Add a fallback in the bootstrap ticker: after 20 ticks (~10s) if no clock navigation has been seen, proactively call shrinkToBubble() to show the bubble clock and attach the overlay to the WindowManager. https://claude.ai/code/session_01DuqQ5oXJhwe63UtFLaxDxL
On the FireTV Cube, the overlay root is never attached to the WindowManager at boot because shrinkToBubble() is only called when a /view-assist/clock navigation is detected -- but that navigation never arrives because the WebView is in a detached view tree (root not added to WM yet), preventing HA's Lovelace frontend from processing SPA navigation commands. Fix the chicken-and-egg problem by calling shrinkToBubble() at the end of install(). This immediately attaches the root to the WindowManager, puts the WebView in an attached view hierarchy so HA can process navigation, and makes the bubble clock visible from boot. https://claude.ai/code/session_01DuqQ5oXJhwe63UtFLaxDxL
Owner
|
Hey @baileyboy0304 . Not yet had chance to look at this as been workign through some additional stuff for the 0.10.0 release. That is due out today so will start to work through this with you after. Thx |
Add a timestamp+URL guard at the top of handlePossibleInAppNavigation() so that when js-nav-hook and native-poll both detect the same URL change, only the first one processes it. The second is skipped within a 5-second window, eliminating the double chrome-hiding that caused the visible flicker. https://claude.ai/code/session_01RiL3PzQbpeUGnWKCQGPL5q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this code I have added android flavors - FireTv and universal.
univeral - the standard VACA code.
FireTV - this enables overlay code so that the VACA app can overlay on top of anything that is on the android screen - either the desktop or another app. This allows VA dashboards to be shown on a fireTV stick, over the top of TV pictures etc.
I needed to disable the microphone input (otherwise fireOS always shows a microphone icon on the screen). This has touched a few of the VACA files.
I needed to rename MainActivity to BaseMainActivity, to allow minimal changes to the VACA code, and for me to make the overlay changes I needed.
Let me now what you think!