Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
422c3b2
✨ feat: Add fade and unfold animation to popover menus
srbsingh3 Feb 1, 2026
0f242ba
♻️ refactor: Replace height-unfold with fade+slide for popover menus
srbsingh3 Feb 1, 2026
7636cda
✨ feat: Add slide-in animation to dock panels
srbsingh3 Feb 1, 2026
9a8d67d
♻️ refactor: Replace opacity-based with size-based dock animations
srbsingh3 Feb 1, 2026
a91bc97
⚡️ perf: Refine dock animation timing and easing
srbsingh3 Feb 1, 2026
5d33197
🐛 fix: Prevent dock close animation from being skipped
srbsingh3 Feb 1, 2026
3b5a1c8
♻️ refactor: Simplify dock animation ID generation
srbsingh3 Feb 1, 2026
64b36b9
✨ feat: Add entry/exit animations to modal dialogs
srbsingh3 Feb 1, 2026
fdf706f
✨ feat: Add reduce motion setting with macOS accessibility support
srbsingh3 Feb 1, 2026
fa0f054
♻️ refactor: Simplify reduce_motion usage with free function
srbsingh3 Feb 1, 2026
9ee614b
♻️ refactor: Simplify modal layer animation code
srbsingh3 Feb 1, 2026
5392bdf
✨ feat: Add slide-in/out animations to utility panes
srbsingh3 Feb 1, 2026
93ed225
♻️ refactor: Simplify utility pane slot access pattern
srbsingh3 Feb 1, 2026
ad4f04b
🔧 chore: Remove accidentally committed patch file
srbsingh3 Feb 1, 2026
9e7c6c4
✨ feat: Add smooth sliding animation to picker selection
srbsingh3 Feb 1, 2026
a2c6ee3
💄 style: Refine picker selection animation timing and behavior
srbsingh3 Feb 1, 2026
6653e3e
🐛 fix: Skip picker animation at scroll boundaries
srbsingh3 Feb 1, 2026
7f06ae4
♻️ refactor: Simplify picker selection animation logic
srbsingh3 Feb 1, 2026
14c7325
♻️ refactor: Optimize animation code for reduce motion
srbsingh3 Feb 2, 2026
a73a1ab
✅ test: Add comprehensive unit tests for animation logic
srbsingh3 Feb 2, 2026
6d1f597
♻️ refactor: Simplify animation test code
srbsingh3 Feb 2, 2026
f711f3e
✅ test: Consolidate redundant animation tests
srbsingh3 Feb 2, 2026
c64a79b
🐛 fix: Resolve critical animation lifecycle bugs
srbsingh3 Feb 2, 2026
081febd
✅ test: Add unit tests for animation easing and utility pane
srbsingh3 Feb 2, 2026
a8ece24
📝 docs: Improve code comments per CLAUDE.md standards
srbsingh3 Feb 2, 2026
4e956e2
🐛 fix: Correct reduce_motion doc comment values
srbsingh3 Feb 2, 2026
0b76865
🐛 fix: Cancel close animation on utility pane re-expand
srbsingh3 Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@
//
// Default: "client"
"window_decorations": "client",
// Whether to reduce motion in UI animations.
// May take 3 values:
// 1. Follow the OS accessibility setting:
// "reduce_motion": "system"
// 2. Always reduce motion (skip animations):
// "reduce_motion": "on"
// 3. Never reduce motion (always animate):
// "reduce_motion": "off"
"reduce_motion": "system",
// Whether to use the system provided dialogs for Open and Save As.
// When set to false, Zed will use the built-in keyboard-first pickers.
"use_system_path_prompts": true,
Expand Down
5 changes: 5 additions & 0 deletions crates/gpui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,11 @@ impl App {
self.platform.should_auto_hide_scrollbars()
}

/// Returns whether the platform's accessibility settings request reduced motion.
pub fn should_reduce_motion(&self) -> bool {
self.platform.should_reduce_motion()
}

/// Restarts the application.
pub fn restart(&mut self) {
self.restart_observers
Expand Down
40 changes: 40 additions & 0 deletions crates/gpui/src/elements/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ mod easing {
}
}

/// The cubic ease-out function, which starts quickly and decelerates to a stop
pub fn ease_out_cubic(delta: f32) -> f32 {
1.0 - (1.0 - delta).powi(3)
}

/// The Quint ease-out function, which starts quickly and decelerates to a stop
pub fn ease_out_quint() -> impl Fn(f32) -> f32 {
move |delta| 1.0 - (1.0 - delta).powi(5)
Expand Down Expand Up @@ -261,3 +266,38 @@ mod easing {
}
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_ease_out_cubic_boundaries() {
assert_eq!(ease_out_cubic(0.0), 0.0);
assert_eq!(ease_out_cubic(1.0), 1.0);
}

#[test]
fn test_ease_out_cubic_monotonically_increasing() {
let mut previous = 0.0f32;
for i in 1..=100 {
let t = i as f32 / 100.0;
let value = ease_out_cubic(t);
assert!(
value >= previous,
"ease_out_cubic should be monotonically increasing: f({t}) = {value} < f({}) = {previous}",
(i - 1) as f32 / 100.0
);
previous = value;
}
}

#[test]
fn test_ease_out_cubic_midpoint() {
let mid = ease_out_cubic(0.5);
assert!(
mid > 0.5,
"ease-out should be above linear at midpoint, got {mid}"
);
}
}
7 changes: 4 additions & 3 deletions crates/gpui/src/elements/uniform_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,13 @@ impl Element for UniformList {
window,
cx,
|_, window, cx| {
for item in &mut request_layout.items {
item.paint(window, cx);
}
// Decorations paint before items so backgrounds (e.g. selection highlights) render behind item content.
for decoration in &mut request_layout.decorations {
decoration.paint(window, cx);
}
for item in &mut request_layout.items {
item.paint(window, cx);
}
},
)
}
Expand Down
4 changes: 4 additions & 0 deletions crates/gpui/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ pub(crate) trait Platform: 'static {
fn set_cursor_style(&self, style: CursorStyle);
fn should_auto_hide_scrollbars(&self) -> bool;

fn should_reduce_motion(&self) -> bool {
false
}

fn read_from_clipboard(&self) -> Option<ClipboardItem>;
fn write_to_clipboard(&self, item: ClipboardItem);

Expand Down
8 changes: 8 additions & 0 deletions crates/gpui/src/platform/mac/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,14 @@ impl Platform for MacPlatform {
}
}

fn should_reduce_motion(&self) -> bool {
unsafe {
let workspace: id = msg_send![class!(NSWorkspace), sharedWorkspace];
let reduce: BOOL = msg_send![workspace, accessibilityDisplayShouldReduceMotion];
reduce != NO
}
}

fn read_from_clipboard(&self) -> Option<ClipboardItem> {
let state = self.0.lock();
state.general_pasteboard.read()
Expand Down
1 change: 1 addition & 0 deletions crates/picker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ gpui.workspace = true
menu.workspace = true
schemars.workspace = true
serde.workspace = true
settings.workspace = true
theme.workspace = true
ui.workspace = true
ui_input.workspace = true
Expand Down
Loading