Repository navigation
Load settings once per preview and skip unchanged breadcrumb writes - #4
Merged
Merged
Conversation
Every Space press called MiqSettings.Load twice (Prepare on the UI thread, then View's background task), and each Load unconditionally rewrote "MIQ settings location.txt" in the plugin folder: two ini reads and two file writes per preview, one of each on QuickLook's UI thread. - View reuses the settings Prepare loaded (still re-read every preview, so ini edits apply on the next Space); it loads its own only if the host skipped Prepare. MiqSettings holds only frozen WPF resources, so handing it to the background task is safe. - WriteBreadcrumb writes only when the file is missing or its text differs (wiped by an upgrade, or the settings path moved). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqBwhnTRsqxk3SEvp9z4T9
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
Every Space press called
MiqSettings.Load()twice: once inPrepareon QuickLook's UI thread, once inView's background task. Each call also rewroteMIQ settings location.txtin the plugin folder unconditionally. That is two ini reads and two file writes per preview, one of each on the UI thread. The cost is small but adds latency on slow or antivirus-scanned profile folders.Plugin.cs:Viewreuses the settingsPrepareloaded. Settings are still re-read on every preview, so ini edits apply on the next Space.Viewloads its own only if the host skippedPrepare.MiqSettingsholds only frozen WPF resources, so passing it to the background task is safe.MiqSettings.cs:WriteBreadcrumbwrites only when the file is missing or its text differs (wiped by a plugin upgrade, or the settings path moved).No behaviour change for users beyond the reduced I/O.
Tests
Both files are in the plugin project, which has no test project, so there are no automated tests. Suggested manual check:
MIQ settings location.txtexists in the plugin folder, and its modified time does not change on later previews.MIQ.settings.ini(e.g.BackgroundColor) and preview again. The change applies.Not yet built: the authoring environment had no .NET SDK. CI builds the plugin on this PR, which covers compilation.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XqBwhnTRsqxk3SEvp9z4T9
Generated by Claude Code