Skip to content

Load settings once per preview and skip unchanged breadcrumb writes - #4

Merged
marcoduering merged 1 commit into
mainfrom
claude/settings-io
Sep 27, 2026
Merged

marcoduering merged 1 commit into
mainfrom
claude/settings-io

Conversation

@marcoduering

Copy link
Copy Markdown
Owner

Summary

Every Space press called MiqSettings.Load() twice: once in Prepare on QuickLook's UI thread, once in View's background task. Each call also rewrote MIQ settings location.txt in 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: View reuses the settings Prepare loaded. Settings are still re-read on every preview, so ini edits apply on the next Space. View loads its own only if the host skipped Prepare. MiqSettings holds only frozen WPF resources, so passing it to the background task is safe.
  • MiqSettings.cs: WriteBreadcrumb writes 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:

  1. Press Space on a supported file. MIQ settings location.txt exists in the plugin folder, and its modified time does not change on later previews.
  2. Delete it and preview again. It is recreated.
  3. Edit a value in 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

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
@marcoduering
marcoduering merged commit ae8c348 into main Sep 27, 2026
1 check passed
@marcoduering
marcoduering deleted the claude/settings-io branch September 27, 2026 12:02
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.

2 participants