Conversation
…ing window Previously, preview.sh used `entr -r` which killed and relaunched the entire qml6 process on every file change, causing the window to close and reopen. Now the preview window stays open and theme content reloads in-place via a QML Loader. - Extract theme UI from Preview.qml into ThemeLayout.qml - Load ThemeLayout via Loader.setSource() with required property passing - preview.sh launches qml6 once, entr writes a timestamp to a signal file, and a QML Timer polls it to trigger reload - Set QML_XHR_ALLOW_FILE_READ=1 for local file polling - Cleanly exit when user closes the preview window 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The previous approach used entr + QML XHR polling with a Loader, but QML's component cache prevented sub-component changes from being picked up. clearComponentCache() only works when no live instances reference the cached components. Fix: replace qml6 with a PyQt6 host (preview-host.py) that uses a 3-phase reload cycle: 1. Signal QML to unload the Loader (destroys all component instances) 2. Call engine.clearComponentCache() on the now-unreferenced types 3. Signal QML to reload the Loader from disk Also disable QML disk cache (QML_DISABLE_DISK_CACHE=1) and drop the entr/signal-file mechanism in favor of QFileSystemWatcher. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Loaderinstead of killing/relaunchingqml6Preview.qmlintoThemeLayout.qml, loaded viaLoader.setSource()with required property passingpreview.shlaunchesqml6once;entrwrites a timestamp to a signal file that QML polls every 500ms to trigger reloadTest plan
./scripts/preview.shand verify the preview window opens with the full theme (background, clock, login form, footer)spacinginClock.qml) and verify the preview updates in-place without the window closing./scripts/lint-qml.shand verify it passes🤖 Generated with Claude Code