feat(update): integrate shared studio update dialog behind flag - #70
Merged
Conversation
Mount @pickforge/tauri-updater's shared controller and dialog element on PickGauge's main window when studioUpdateDialog is on (default off via @pickforge/flags); the legacy window.confirm flow in updater.ts is untouched while the flag is off. Eligibility excludes the floating capsule by Tauri window label and defers a hidden main window until its first focus event, preserving the existing checkForUpdatesWhenVisible deferral. Adds a dev-only ?updateDialogFixture= route for the available and downloading states, tree-shaken from production builds, since PickGauge has no visual-regression baseline harness. Refs pickforge/pickforge-platform#36
createMainWindowEligibility resolved eligible on visibility alone and trusted a focus-changed event's payload without re-checking visibility, so a hidden main window receiving an early focus event could pass, and a window that became visible+focused during listener registration could hang until a later focus event that might not come. Now eligibility requires both isVisible() and isFocused(), re-queries both on every focus-changed event instead of trusting the payload, and re-checks once right after the listener registers to close that gap. Also extracts the flag-on/flag-off startup routing decision (legacy window.confirm vs. the shared dialog) out of main.ts/App.svelte into src/lib/updateRouting.ts so the no-double-prompt guarantee between them is directly unit tested. Refs pickforge/pickforge-platform#36
21 tasks
# Conflicts: # bun.lock # docs/releases/UNRELEASED.md
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
@pickforge/tauri-updater's shared controller +<pickforge-update-dialog>element on PickGauge's main window when thestudioUpdateDialogflag is on. Default off (@pickforge/flags,src/lib/flags.ts) — no PickGauge-local flag registry existed before this PR, so a thin per-app wrapper was added matching the pattern already used inpickforge/src/stores/flags.ts(own definitions per app repo, not a monorepo-shared registry).window.confirmupdater insrc/lib/updater.tsis untouched (removal is a later PR per the issue's rollout plan).src/lib/updateDialog.tsenforces the hard rules from the issue:createMainWindowEligibilitychecks the real Tauri window label (win.label !== "main") — the floating capsule (Float.svelte, label"float") never imports this module at all, and even if it did, the label check independently blocks it.onFocusChanged, resolving eligible only on first focus — this mirrors the pre-existingcheckForUpdatesWhenVisibledeferral inupdater.tsso behavior doesn't regress.createProcessCheckGate().main.tsskips the legacycheckForUpdatesWhenVisiblecall on the main window only when the flag is on, so the two flows can never double-prompt.?updateDialogFixture=available|downloadingroute (src/lib/updateDialogFixture.ts) with injected deterministic state for manual visual inspection at PickGauge's normal (1000×700) and minimum (820×580) sizes. PickGauge has no VRT/screenshot-baseline harness (confirmed — no such workflow or fixture infra exists in this repo), so per the issue's fallback this fixture is kept/polished instead of building one;import.meta.env.DEVelimination confirmed by build (fixture code appears only in the sourcemap, not the executable bundle).docs/releases/UNRELEASED.mdupdated (internal/release change entry + validation).Fixed from the inherited work
@pickforge/flagsand@pickforge/tauri-updaterwere pinned exact (0.4.0,0.12.0) inpackage.json/bun.lock. Every other@pickforge/*dependency across PickForge/PickScribe/PickGauge uses a caret range except@pickforge/brand(deliberately exact-pinned for asset consistency). Changed both to^0.4.0/^0.12.0to match the workspace convention and re-synced the lockfile.Validation
bun run lint— cleanbun run check(svelte-check) — 0 errors, 0 warningsbun run test— 85 vitest tests (incl. newflags.test.ts,updateDialog.test.ts) + 18 Node tests, all passingbun run test:coverage— ratchet holds (existing thresholds: 16/23/26/17)bun run build— succeeds; confirmed the dev-only fixture module is tree-shaken from the production bundlecargo check/cargo testnot runOwner-gated packaged-update smoke (old build → staged newer build) and floating/hidden-window smoke on a real packaged app are deferred, per the issue's PR plan, to the flag-enable PR later in the rollout.
Refs pickforge/pickforge-platform#36
🤖 Generated with Claude Code