fix(widgets): min-height resize no longer re-enters the legacy migration (F-379)#92
Merged
Merged
Conversation
…ion (F-323) migrateWidgetRecord classified a record as pre-7.3b legacy when w<=6 OR h<=6 cells — but WIDGET_MIN_H is exactly 6, so resizing a widget to its minimum height made the next load scale its x/y (and footprint) x10 and teleport the card ~3200px below the fold (dogfood session 375). Width alone discriminates the formats: current-format min width (8) is above the legacy ceiling (6), legacy footprints were <=4 cells wide. Regression tests pin the h=6 boundary and the legacy path. Co-Authored-By: Claude Fable 5 <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.
What
Resizing a dashboard widget to its minimum height teleported it ×10 off-screen (to ~y 4000px) on the next dashboard load, and follow-up writes baked the wrong position in — the card looked deleted after a restart.
Why
migrateWidgetRecordtreats a record as a pre-7.3b legacy footprint whenw ≤ 6 OR h ≤ 6cells and scales it ×10. ButWIDGET_MIN_His exactly 6, so a current-format widget at min height re-enters the migration. The "self-terminating" invariant only ever held for width (WIDGET_MIN_W8 > 6).Fix
Discriminate on width alone: every current-format record has
w ≥ 8 > LEGACY_WIDGET_MAX_CELL; legacy footprints were ≤ 4 icon cells wide. Comment updated with the invariant + F-379 reference.Tests
bun --bun vitest run …/dashboard/grid.test.ts …/app-icon-cache.test.ts→ 30/30 green.Found in dogfood session 375 (harness PR #24,
tests/dogfood/sessions/375-widgets-dogfood.spec.ts) — friction log F-379 has the full decode of the teleported record.🤖 Generated with Claude Code