[PR #15177] fix(app): prevent sidebar animation on initial load #15061

Open
opened 2026-04-13 01:09:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15177
Author: @renezander030
Created: 3/31/2026
Status: 🔄 Open

Base: mainHead: fix/12954-sidebar-animation


📝 Commits (1)

  • 53df7a4 fix(app): prevent sidebar animation on initial load

📊 Changes

1 file changed (+15 additions, -5 deletions)

View changed files

📝 app/ui/app/src/components/layout/layout.tsx (+15 -5)

📄 Description

Summary

When the app loads with the sidebar in its open state, the sidebar animates from collapsed to open instead of appearing open immediately. This is because CSS transitions (transition-[width], transition-[left], transition-opacity, transition-all) are always active, including during the initial render.

This PR introduces an enableTransitions state that starts as false and flips to true after the first paint via requestAnimationFrame. All transition classes in the SidebarLayout component are conditionally applied only after this flag is set, so the sidebar renders in its correct position instantly on load while still animating smoothly on subsequent user interactions.

Test plan

  • Open the app with the sidebar setting saved as open — sidebar should appear immediately without sliding in
  • Toggle the sidebar closed and open — transitions should animate smoothly as before
  • Refresh with the sidebar closed — main content should fill the space immediately without animating
  • Test on both macOS and Windows layouts (the toggle button positioning differs)

Fixes #12954


🔄 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/15177 **Author:** [@renezander030](https://github.com/renezander030) **Created:** 3/31/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/12954-sidebar-animation` --- ### 📝 Commits (1) - [`53df7a4`](https://github.com/ollama/ollama/commit/53df7a42b4cb26ae08f68df92ddf72c8636cd90d) fix(app): prevent sidebar animation on initial load ### 📊 Changes **1 file changed** (+15 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/layout/layout.tsx` (+15 -5) </details> ### 📄 Description ## Summary When the app loads with the sidebar in its open state, the sidebar animates from collapsed to open instead of appearing open immediately. This is because CSS transitions (`transition-[width]`, `transition-[left]`, `transition-opacity`, `transition-all`) are always active, including during the initial render. This PR introduces an `enableTransitions` state that starts as `false` and flips to `true` after the first paint via `requestAnimationFrame`. All transition classes in the `SidebarLayout` component are conditionally applied only after this flag is set, so the sidebar renders in its correct position instantly on load while still animating smoothly on subsequent user interactions. ## Test plan - Open the app with the sidebar setting saved as open — sidebar should appear immediately without sliding in - Toggle the sidebar closed and open — transitions should animate smoothly as before - Refresh with the sidebar closed — main content should fill the space immediately without animating - Test on both macOS and Windows layouts (the toggle button positioning differs) Fixes #12954 --- <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-13 01:09:33 -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#15061