Skip to content

Enable UpdateEffect animation after successful app update#203

Merged
iamEvanYT merged 2 commits intomainfrom
opencode/enable-update-effect
Mar 1, 2026
Merged

Enable UpdateEffect animation after successful app update#203
iamEvanYT merged 2 commits intomainfrom
opencode/enable-update-effect

Conversation

@iamEvanYT
Copy link
Member

Summary

  • Exposes the existing hasUpdated flag from the main process auto-update controller to the renderer via a new hasUpdated() IPC method
  • Wires up the previously disabled UpdateEffect sweep animation in the browser UI to play when the app restarts after a successful update

Details

The auto-update controller already detected post-update restarts by persisting the pre-update version to an ephemeral datastore and comparing on launch (autoUpdateController.hasUpdated), but this flag was never consumed (marked with a // TODO). This PR completes the pipeline:

  1. IPC layer: Adds hasUpdated() to FlowUpdatesAPI, with an IPC handler and preload bridge
  2. Renderer: Adds hasUpdated boolean to AppUpdatesProvider context (fetched once on mount), and replaces the disabled {false && <UpdateEffect />} with a memoized ConditionalUpdateEffect component that renders only when the app has just been updated

The UpdateEffect component auto-dismisses after ~1.2s (existing behavior).

Files changed

  • src/shared/flow/interfaces/app/updates.ts — Added hasUpdated to API interface
  • src/main/controllers/auto-update-controller/index.ts — Removed stale TODO comment
  • src/main/ipc/app/updates.ts — Added updates:has-updated IPC handler
  • src/preload/index.ts — Added preload bridge
  • src/renderer/src/components/providers/app-updates-provider.tsx — Added hasUpdated to context
  • src/renderer/src/components/browser-ui/main.tsx — Enabled UpdateEffect via ConditionalUpdateEffect

The auto-update controller already detected when the app restarted
after an update (via ephemeral datastore version comparison), but the
hasUpdated flag was never exposed to the renderer.

- Add hasUpdated() to FlowUpdatesAPI interface
- Add updates:has-updated IPC handler
- Add preload bridge for hasUpdated
- Remove stale TODO comment in auto-update controller
Wire up the hasUpdated flag in the renderer to conditionally show the
UpdateEffect sweep animation when the app restarts after an update.

- Add hasUpdated to AppUpdatesProvider context, fetched on mount
- Replace disabled {false && <UpdateEffect />} with a memoized
  ConditionalUpdateEffect component that renders only when hasUpdated
  is true
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Build artifacts for all platforms are ready! 🚀

Download the artifacts for:

One-line installer (Unstable):
bunx flow-debug-build --open 22531840648

(execution 22531840648 / attempt 1)

@greptile-apps
Copy link

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR completes the auto-update UX by wiring up the previously disabled UpdateEffect animation to display when the app restarts after a successful update.

Implementation Details

The implementation follows a clean architecture pattern across the Electron IPC boundary:

  • Main Process: The existing AutoUpdateController.hasUpdated flag (set when detecting post-update restarts) is now exposed via IPC
  • IPC Layer: New updates:has-updated handler bridges the main and renderer processes
  • Renderer: The AppUpdatesProvider fetches the flag once on mount and adds it to the context
  • UI: Replaced the disabled {false && <UpdateEffect />} with a memoized ConditionalUpdateEffect component that conditionally renders the sweep animation

The UpdateEffect animation automatically dismisses after ~1.2 seconds, providing visual feedback that the update was successful without requiring user interaction.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • The implementation is clean, follows established patterns in the codebase, and correctly implements the feature across all layers (main process, IPC, preload, provider, UI). All changes are straightforward, well-typed, and include proper error handling. The feature is non-invasive and only activates after successful updates.
  • No files require special attention

Important Files Changed

Filename Overview
src/main/controllers/auto-update-controller/index.ts Removed stale TODO comment now that the hasUpdated flag is consumed
src/main/ipc/app/updates.ts Added IPC handler for updates:has-updated that returns the hasUpdated flag
src/renderer/src/components/providers/app-updates-provider.tsx Added hasUpdated state to context, fetched once on mount via IPC with error handling
src/renderer/src/components/browser-ui/main.tsx Replaced disabled UpdateEffect with ConditionalUpdateEffect that renders only when app has updated

Sequence Diagram

sequenceDiagram
    participant AU as AutoUpdateController
    participant IPC as IPC Handler
    participant Preload as Preload Bridge
    participant Provider as AppUpdatesProvider
    participant UI as ConditionalUpdateEffect
    
    Note over AU: App starts after update
    AU->>AU: getVersionUpdatedFrom()
    AU->>AU: Compare versions
    AU->>AU: Set hasUpdated = true
    
    Note over Provider: Component mounts
    Provider->>Preload: hasUpdated()
    Preload->>IPC: invoke('updates:has-updated')
    IPC->>AU: Read hasUpdated flag
    AU-->>IPC: Return true
    IPC-->>Preload: Return true
    Preload-->>Provider: Return true
    Provider->>Provider: setHasUpdated(true)
    
    Note over UI: Render cycle
    UI->>Provider: useAppUpdates()
    Provider-->>UI: { hasUpdated: true }
    UI->>UI: Render UpdateEffect
    
    Note over UI: After ~1.2s
    UI->>UI: Animation completes
    UI->>UI: Return null (dismiss)
Loading

Last reviewed commit: c8bfad5

@iamEvanYT iamEvanYT merged commit 9cccf1a into main Mar 1, 2026
10 checks passed
@iamEvanYT iamEvanYT deleted the opencode/enable-update-effect branch March 1, 2026 01:30
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.

1 participant