Skip to content

fix(ui): prevent install screen flash when already on main content#1280

Open
dataCenter430 wants to merge 1 commit intoeigent-ai:mainfrom
dataCenter430:fix-layout-visibility-race
Open

fix(ui): prevent install screen flash when already on main content#1280
dataCenter430 wants to merge 1 commit intoeigent-ai:mainfrom
dataCenter430:fix-layout-visibility-race

Conversation

@dataCenter430
Copy link

Closes: #1260

Related Issue

Layout visibility race: setWaitingBackend() could briefly show the install
screen after main content had already rendered.

  • useInstallationSetup: only call setWaitingBackend() when initState !== 'done'
  • Layout: derive install-screen visibility from shouldShowInstallScreen and
    initState only; stop using installationState === 'waiting-backend'.

Description

  • useInstallationSetup: only call setWaitingBackend() when initState !== 'done'
    so we never switch to the install UI if the user is already "done". Still run
    backend polling in the background.
  • Layout: derive install-screen visibility from shouldShowInstallScreen and
    initState only; stop using installationState === 'waiting-backend' so that
    a late waiting-backend state cannot override and show the install screen when
    initState is already 'done'.

Expected behavior

Before: User sees main app (initState is "done"). An async path (e.g. initial “tools installed, wait for backend” or login-after-logout) calls setWaitingBackend(). Layout sees installationState === 'waiting-backend' and shows the install screen, causing a brief flash or full switch back to the install screen.
After: If the user is already "done", we never call setWaitingBackend() for that flow, and Layout no longer uses waiting-backend alone to show the install screen. So the install screen does not appear after main content has rendered. Backend polling still runs; when the backend is ready we stay on main content (or show an error dialog if it fails). During normal first-time setup (initState carousel/permissions), the install screen still shows and “waiting for backend” still appears as before.

Why it’s better

  • Better UX: No more install screen flashing over the main app once the user is already in.
  • Correct source of truth: What the user sees is driven by initState (and explicit install flags), not by a late waiting-backend state that can fire after we’re already “done”.
  • Defense in depth: Both the hook (don’t set waiting-backend UI when done) and Layout (don’t show install screen when done) are aligned, so the race is fixed and future similar bugs are less likely.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

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.

[Feature Request] Architecture and UX Improvement

1 participant