[PR #14463] fix: prevent sidebar from animating on initial app load #14688

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14463
Author: @Anandesh-Sharma
Created: 2/26/2026
Status: 🔄 Open

Base: mainHead: fix-sidebar-animation-on-load


📝 Commits (1)

  • 631bd17 fix: prevent sidebar from animating on initial app load

📊 Changes

1 file changed (+13 additions, -4 deletions)

View changed files

📝 app/ui/app/src/components/layout/layout.tsx (+13 -4)

📄 Description

Summary

  • Disable CSS transitions on the sidebar layout during initial render
  • Transitions are re-enabled after the first paint via requestAnimationFrame
  • Subsequent sidebar open/close toggles still animate smoothly

Details

The sidebar has transition-[width] duration-300 CSS classes that animate its width. When the app loads, settings are fetched asynchronously via React Query, so sidebarOpen transitions from false (default) to true (persisted setting). This causes the sidebar to visually slide in from width 0 to 256px.

The fix uses a useState/useEffect pattern to suppress transitions until after the initial render is complete. Once requestAnimationFrame fires after the first paint, transitions are enabled for all subsequent user interactions.

Test plan

  • Sidebar appears instantly on app load (no slide-in animation)
  • Clicking the sidebar toggle button still animates open/close
  • Sidebar button position transitions correctly after initial load

Fixes #12954

🤖 Generated with Claude Code


🔄 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/14463 **Author:** [@Anandesh-Sharma](https://github.com/Anandesh-Sharma) **Created:** 2/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-sidebar-animation-on-load` --- ### 📝 Commits (1) - [`631bd17`](https://github.com/ollama/ollama/commit/631bd172547140d3b05ae0512fa3f462479e865f) fix: prevent sidebar from animating on initial app load ### 📊 Changes **1 file changed** (+13 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/layout/layout.tsx` (+13 -4) </details> ### 📄 Description ## Summary - Disable CSS transitions on the sidebar layout during initial render - Transitions are re-enabled after the first paint via `requestAnimationFrame` - Subsequent sidebar open/close toggles still animate smoothly ## Details The sidebar has `transition-[width] duration-300` CSS classes that animate its width. When the app loads, settings are fetched asynchronously via React Query, so `sidebarOpen` transitions from `false` (default) to `true` (persisted setting). This causes the sidebar to visually slide in from width 0 to 256px. The fix uses a `useState`/`useEffect` pattern to suppress transitions until after the initial render is complete. Once `requestAnimationFrame` fires after the first paint, transitions are enabled for all subsequent user interactions. ## Test plan - [x] Sidebar appears instantly on app load (no slide-in animation) - [x] Clicking the sidebar toggle button still animates open/close - [x] Sidebar button position transitions correctly after initial load Fixes #12954 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:00:46 -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#14688