[PR #15756] [CLOSED] app/ui: fix sidebar animating open on initial load #61990

Closed
opened 2026-04-29 16:56:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15756
Author: @anishesg
Created: 4/22/2026
Status: Closed

Base: mainHead: fix/ph-issue-12954


📝 Commits (1)

  • 439603d app/ui: fix sidebar animating open on initial load

📊 Changes

3 files changed (+42 additions, -5 deletions)

View changed files

📝 app/ui/app/src/components/layout/layout.tsx (+4 -3)
📝 app/ui/app/src/hooks/useSettings.ts (+3 -2)
app/ui/app/src/utils/sidebarAnimation.test.ts (+35 -0)

📄 Description

When the app loads, the sidebar animates from closed to open instead of
appearing in its persisted state immediately. This happens because
useSettings defaults sidebarOpen to false while the settings API
request is in flight. Once the response arrives with SidebarOpen: true,
the width class flips from w-0 to w-64 and the CSS transition-[width]
kicks in, producing a visible slide animation.

The fix suppresses all sidebar-related CSS transitions until after the
initial settings have been fetched and a frame has been painted. A
requestAnimationFrame callback is used so the browser paints the correct
sidebar width before transitions are re-enabled. Subsequent user-driven
toggles animate normally.

Fixes #12954

Test plan

  • New unit tests covering the transition-suppression logic
  • Existing test suite passes (npx vitest run, 33/33)
  • Manual: load the app with SidebarOpen: true in persisted settings
    and confirm the sidebar appears open without animating
  • Manual: toggle the sidebar after load and confirm it still animates
    smoothly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15756 **Author:** [@anishesg](https://github.com/anishesg) **Created:** 4/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/ph-issue-12954` --- ### 📝 Commits (1) - [`439603d`](https://github.com/ollama/ollama/commit/439603db7d73fe6c7b01ca3182934a809ed34edd) app/ui: fix sidebar animating open on initial load ### 📊 Changes **3 files changed** (+42 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/layout/layout.tsx` (+4 -3) 📝 `app/ui/app/src/hooks/useSettings.ts` (+3 -2) ➕ `app/ui/app/src/utils/sidebarAnimation.test.ts` (+35 -0) </details> ### 📄 Description When the app loads, the sidebar animates from closed to open instead of appearing in its persisted state immediately. This happens because `useSettings` defaults `sidebarOpen` to `false` while the settings API request is in flight. Once the response arrives with `SidebarOpen: true`, the width class flips from `w-0` to `w-64` and the CSS `transition-[width]` kicks in, producing a visible slide animation. The fix suppresses all sidebar-related CSS transitions until after the initial settings have been fetched and a frame has been painted. A `requestAnimationFrame` callback is used so the browser paints the correct sidebar width before transitions are re-enabled. Subsequent user-driven toggles animate normally. Fixes #12954 ## Test plan - [x] New unit tests covering the transition-suppression logic - [x] Existing test suite passes (`npx vitest run`, 33/33) - [ ] Manual: load the app with `SidebarOpen: true` in persisted settings and confirm the sidebar appears open without animating - [ ] Manual: toggle the sidebar after load and confirm it still animates smoothly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 16:56:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#61990