Skip to content

Widgets flash/reload on mobile PWA cold start #213

@jaylfc

Description

@jaylfc

My earlier widget-store fix (shapesEqual pre-check before setState) only helps when localStorage already has cached data. On PWA reinstall / cache wipe / first load, the store init is DEFAULT_WIDGETS → server fetch → setState → grid re-layout. Result: wrong widgets flash on screen before the real layout replaces them.

Fix options

  1. Hide widget area until `hydrated: true`. Brief blank desktop (~200ms) on cold start, no wrong-widgets flash. Simpler.
  2. Skeleton placeholders while hydrating. More polish, more code.

I'd go with (1) — less jarring than default-then-replace.

Where to touch

  • `desktop/src/stores/widget-store.ts` — already exposes `hydrated` state
  • `desktop/src/components/WidgetLayer.tsx` — gate the render on `hydrated`

Acceptance

  • Cold-start PWA on iOS shows no default widgets before real layout lands
  • Cached state still renders instantly (no regression from the shapesEqual work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeatureNew featurekilo-auto-fixAuto-generated label by Kilokilo-triagedAuto-generated label by Kilo

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions