Skip to content

app: fix workspace flicker when switching directories#18207

Merged
nexxeln merged 10 commits intodevfrom
brendan/fix-workspace-flicker
Mar 19, 2026
Merged

app: fix workspace flicker when switching directories#18207
nexxeln merged 10 commits intodevfrom
brendan/fix-workspace-flicker

Conversation

@Brendonovich
Copy link
Copy Markdown
Member

@Brendonovich Brendonovich commented Mar 19, 2026

  • Navigating between sessions in different directories (workspaces, projects) causes DirectoryLayout to tear down and remount its children as it uses <Show keyed>
  • Remounted children load a bunch of new async data via createResource
  • This is expected to pause the navigation via a Transition, but instead navigation was happening and the Session route Suspense was showing its fallback
  • This occurs due to DirectoryLayout's resolved being set after an async operation outside of the reactive graph (in this case in an effect)
    • Navigation creates transition -> Updates location -> Transition ends (unaware of async in DirectoryLayout) -> Effect runs -> Components remount + route switches -> Async resources fetched outside of transition (causes Suspense flicker)
  • The fix is to source resolved from its own createResource, so that Solid knows that fetching resolved should participate in transitions, causing async resources created by children when remounting to also participate in the transition
    • Navigation creates transition -> Updates location -> Resource runs -> Components remount -> Async resources fetched -> Transition ends + Route switches (no flicker!)

@nexxeln nexxeln merged commit 84f60d9 into dev Mar 19, 2026
6 checks passed
@nexxeln nexxeln deleted the brendan/fix-workspace-flicker branch March 19, 2026 13:59
AvatarGanymede pushed a commit to AvatarGanymede/opencode-dev that referenced this pull request Mar 19, 2026
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
filipeandre pushed a commit to filipeandre/opencode that referenced this pull request Mar 19, 2026
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
raf1hh pushed a commit to raf1hh/opencode that referenced this pull request Mar 20, 2026
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
demostanis pushed a commit to demostanis/opencode that referenced this pull request Mar 20, 2026
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
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.

2 participants