Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6e5bd33
select: Fix `perform_search` to call `SelectItem::matches` (#1968)
fhluo Jan 23, 2026
35f5576
context_menu: Fix context menu shadow. (#1874)
huacnlee Jan 24, 2026
fa110eb
input: Fix clear button showing in disabled state (#1973)
iainlau Jan 26, 2026
3522e0d
input: Fix custom `text_view_style` not working (#1975)
ylinwind Jan 27, 2026
2a3c297
focus_trap: Add to support `focus_trap`. (#1977)
huacnlee Jan 28, 2026
6a06463
dialog: Fix unexpected opening behavior of dialog after closing (#1981)
madcodelife Jan 30, 2026
1a6c9ce
input: Fix ghost lines offsetting all line numbers (#1980)
zanmato Jan 30, 2026
1ec942c
input: Fix ghost first line suffix y offset (#1982)
zanmato Jan 31, 2026
e452801
editor: Add `show_whitespaces` to option whether to show spaces and t…
zanmato Jan 31, 2026
023f2e8
input: Allow insert on input state when disabled (#1984)
z-jxy Jan 31, 2026
5e37e7f
Added Theme Color Viewer Story (#1985)
scottcg Feb 2, 2026
405a236
Add typos extend identifiers (#1987)
madcodelife Feb 3, 2026
26e66af
select: Update placeholder text color to muted (#1988)
madcodelife Feb 3, 2026
7f3af1a
editor: Adding support of PHP and fix combined injection (#1970)
PRRPCHT Feb 4, 2026
b91e996
editor: Add debounce to `document_colors` for fix performance issue. …
huacnlee Feb 4, 2026
38b3e6c
color_picker: Add HSLA slider to ColorPicker. (#1992)
huacnlee Feb 4, 2026
3ca686e
dialog: Fix events failing due to duplicate focus trap IDs (#1996)
madcodelife Feb 5, 2026
e05d382
chore: Locking `core-text` version & sync 0.5.1 (#1999)
madcodelife Feb 5, 2026
af86c8b
color_picker: Add I18n to ColorPicker. (#2000)
huacnlee Feb 6, 2026
da45962
table: Add more keybindings to Table. (#1916)
Hizome Feb 6, 2026
6fbd330
settings: Add support for set default selected index (#2001)
IHadACookie Feb 6, 2026
ea0f48d
input: Update word matching to include more characters (#2003)
zanmato Feb 9, 2026
c66b065
settings: Add support for custom header style (#2004)
IHadACookie Feb 9, 2026
d0708d4
table: Add support for centering text in `Column` (#2006)
madcodelife Feb 9, 2026
849d0c2
feat: merge upstream/main (longbridge) — focus trap, PHP syntax, colo…
BumpyClock Feb 10, 2026
ea27558
Add surface, state, and theme animation improvements
BumpyClock Feb 10, 2026
9c73464
Remove .ai_agents/ from tracking
BumpyClock Feb 10, 2026
11c27f4
Add .ai_agents/ to .gitignore
BumpyClock Feb 10, 2026
ef5e5ca
fix: refine command palette staged reveal and sizing
BumpyClock Feb 10, 2026
607dc7c
fix: stabilize sidebar and accordion motion transitions
BumpyClock Feb 10, 2026
e42293d
Centralize open/close animation with keyed presence state
BumpyClock Feb 10, 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ target/
index.scip
*.log
node_modules/
.ai_agents/
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,17 @@ bd sync # Sync with git
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds

## Animation Guardrails (GPUI)

- Failure mode: open animation flashes (open -> collapse -> open).
- Root cause: using `bounce(...)` easing for reveal/size/opacity. `bounce` is forward-then-reverse; at `delta=1` it returns ~0, so the end frame collapses.
- Rule: only use monotonic easings (fast_invoke/point_to_point/soft_dismiss) for reveal/size/opacity.
- If you want “spring” feel: simulate with a snappier monotonic curve or staged animations; avoid `bounce` unless you want ping-pong.
- Required pattern for open/close motion:
1. Keep `target_state` (source-of-truth open/closed).
2. Keep `visual_state` (mounted/visible during exit animation).
3. Compute `transition_active = target_changed || (visual_state != target_state)`.
4. Run `with_animation(...)` **only** when `transition_active`.
5. On close, delay `visual_state=false` until close duration elapses; guard timer with latest `target_state`.
- For dialogs/surfaces: do not unmount on close request if animation enabled; mark as closing, remove after timer.
- Reduced motion / `animate(false)`: bypass delay + animation, apply final state immediately.
41 changes: 31 additions & 10 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ members = [
"examples/dialog_overlay",
"examples/webview",
"examples/system_monitor",
"examples/focus_trap",
]
resolver = "2"

Expand All @@ -21,9 +22,9 @@ publish = false
edition = "2024"

[workspace.dependencies]
gpui-component = { path = "crates/ui", version = "0.5.0" }
gpui-component-macros = { path = "crates/macros", version = "0.5.0" }
gpui-component-assets = { path = "crates/assets", version = "0.5.0" }
gpui-component = { path = "crates/ui", version = "0.5.1" }
gpui-component-macros = { path = "crates/macros", version = "0.5.1" }
gpui-component-assets = { path = "crates/assets", version = "0.5.1" }
story = { path = "crates/story" }

gpui = { git = "https://github.com/BumpyClock/zed", rev = "b0ca6e65c7ae3ed7fafd03ce26f2d095bc002e31" }
Expand Down Expand Up @@ -93,3 +94,6 @@ ttf-parser = { opt-level = 3 }

[workspace.metadata.typos]
files.extend-exclude = ["**/fixtures/*"]

[workspace.metadata.typos.default.extend-identifiers]
consts = "consts"
85 changes: 76 additions & 9 deletions LEARNINGS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,80 @@
# Learnings

## 2026-01-22
Context: restore glass styling for popup menus and selects.
What I tried: wrapped menu content with SurfacePreset::flyout and used blur_enabled from GlobalState.
Outcome: popover surfaces now handle opacity, border, elevation, and noise consistently.
Next time: prefer SurfacePreset::flyout for popover containers and keep content styling separate.
Context: popup/select glass surface styling and noise overlay consistency.
What worked:
- Use `SurfacePreset::flyout` on popover containers; keep content styling separate.
- Read noise texture via `ImageSource::Resource(Resource::Embedded(...))`, not `img("...")`.
Outcome: consistent opacity, border, elevation, and noise; no URI-loading failures.
Next time: default to flyout preset + embedded resource images for non-URI assets.

## 2026-01-22
Context: noise asset failing to load for surface overlays.
What I tried: used `img("NoiseAsset_256.png")` with gpui assets.
Outcome: gpui treated the path as a URI; loading failed until using `ImageSource::Resource(Resource::Embedded(...))`.
Next time: use explicit embedded resource sources for non-URI image assets.
## 2026-02-10
Context: command palette animation stability and quality.
What worked:
- Clamp/sanitize custom easing output to `[0, 1]` to avoid `delta should always be between 0 and 1`.
- Stage motion: shell instant (`animate(false)`), then list/content reveal.
- Keep container expand and child reveal aligned; avoid conflicting opacity/height phases on translucent surfaces.
Outcome: no animation assert panic and cleaner open sequence without white flash.
Next time: add regression test for overshoot cubic-bezier curves; keep dismiss curves simpler than entrance curves.

## 2026-02-10
Context: collapsible/accordion motion felt abrupt.
What worked:
- Keep content mounted during close (delayed commit), animate both open and close.
- Use spring-style easing on open (`bounce(ease_in_out)`) and simpler close easing.
Outcome: smoother sibling reflow and playful open without heavy dismiss.
Next time: avoid conditional unmount when exit/layout animation is required.

## 2026-02-10
Context: command palette selection crash (`cannot update ... while it is already being updated`).
What worked: in `cx.subscribe(...)` callbacks, update `this` directly; remove nested `view.update(...)` on the same entity.
Outcome: no re-entrant lease panic; selection updates render normally.
Next time: treat subscribe callbacks as the update scope; avoid nested entity updates.

## 2026-02-10
Context: command palette empty state clipping/blankness during expand.
What worked:
- Use dedicated `EMPTY_STATE_HEIGHT` instead of row `item_height`.
- Top-align empty-state content (`pt_6`) instead of vertical centering.
Outcome: icon/text render fully and appear earlier during expansion.
Next time: design empty-state layout independently from row metrics when height is animated.

## 2026-02-10
Context: command palette still showed a blank strip under search before results reveal.
What worked:
- Make header row explicitly match `HEADER_HEIGHT` (`h + flex + items_center`) instead of relying on padding-only sizing.
Outcome: collapsed shell height and header layout now match; removed mismatch strip.
Next time: when using fixed layout constants, size the corresponding section explicitly to that constant.

## 2026-02-10
Context: blank strip persisted even after palette view-level fixes.
What worked: override dialog default minimum height for command palette (`.min_h(px(0.))`), because `Dialog` enforces `.min_h_24()` by default.
Outcome: command palette collapsed height now respects its own shell height during pre-reveal.
Next time: when embedding compact overlays inside `Dialog`, explicitly set min-height if default dialog floor is too large.

## 2026-02-10
Context: sidebar and nested menu sections had snap-open/snap-close behavior.
What worked:
- animate sidebar width from a dedicated expanded width source (`Sidebar::width(...)`) instead of style-only width overrides.
- keep a delayed visual-collapsed state so compact paddings/icon-only layout applies after close width animation.
- keep submenu mounted during close and unmount after animation duration.
Outcome: sidebar collapse/expand and submenu section open/close now animate as continuous layout motion; reduced-motion path remains instant.
Next time: if caret icon rotation should animate, avoid coupling icon transform to `Button::icon(...)` and render a custom caret container with direct animation hook.

## 2026-02-10
Context: recurring motion regressions (snap-back, reopen-on-close, no-exit) across dialog/sidebar/accordion/popover.
What worked:
- Introduce shared keyed presence state machine in `animation::keyed_presence` (Entering/Entered/Exiting/Exited).
- Use generation-guarded timers to ignore stale async transitions.
- Drive render + animation from presence phase (`should_render`, `transition_active`, `progress`) instead of ad-hoc booleans.
- For dropdown menus, delay menu entity reset until popover exit completes.
Outcome: motion lifecycle is centralized; avoids per-component timer drift and repeated transition bugs.
Next time: default new animated components to keyed presence first; avoid custom target/visible timer code.

## 2026-02-10
Context: open animations flashed (open -> collapse -> open) on Accordion/Sidebar/Dialog.
What worked:
- Remove `bounce(...)` easing from reveal/size/opacity transitions.
- Use monotonic easings (fast_invoke/point_to_point) for open/close.
Outcome: no end-frame collapse; open state stays stable.
Next time: avoid `bounce` for reveal/size/opacity; it is forward-then-reverse.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ UI components for building fantastic desktop applications using [GPUI](https://g

```toml
gpui = "0.2.2"
gpui-component = "0.5.0"
gpui-component = "0.5.1"
```

### Basic Example
Expand Down
2 changes: 1 addition & 1 deletion crates/assets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/longbridge/gpui-component"
readme = "README.md"
edition.workspace = true
publish = true
version = "0.5.0"
version = "0.5.1"

[lib]
doctest = false
Expand Down
4 changes: 2 additions & 2 deletions crates/macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "gpui-component-macros"
description = "Macros for GPUI Component."
version = "0.5.0"
version = "0.5.1"
license = "Apache-2.0"
publish = true
edition.workspace = true
Expand All @@ -18,4 +18,4 @@ quote = "1.0"
syn = "2.0"

[package.metadata.cargo-machete]
ignored = ["proc-macro2"]
ignored = ["proc-macro2", "core-text"]
2 changes: 1 addition & 1 deletion crates/reqwest_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reqwest_client"
version = "0.5.0"
version = "0.5.1"
license = "Apache-2.0"
publish = false
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/story/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gpui-component-story"
version = "0.5.0"
version = "0.5.1"
publish = false
edition.workspace = true

Expand Down
22 changes: 22 additions & 0 deletions crates/story/examples/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub struct Example {
line_number: bool,
indent_guides: bool,
soft_wrap: bool,
show_whitespaces: bool,
lsp_store: ExampleLspStore,
_subscriptions: Vec<Subscription>,
_lint_task: Task<()>,
Expand Down Expand Up @@ -728,6 +729,7 @@ impl Example {
line_number: true,
indent_guides: true,
soft_wrap: false,
show_whitespaces: false,
lsp_store,
_subscriptions,
_lint_task: Task::ready(()),
Expand Down Expand Up @@ -987,6 +989,25 @@ impl Example {
}))
}

fn render_show_whitespaces_button(
&self,
_: &mut Window,
cx: &mut Context<Self>,
) -> impl IntoElement {
Button::new("show-whitespace")
.ghost()
.xsmall()
.when(self.show_whitespaces, |this| this.icon(IconName::Check))
.label("Show Whitespaces")
.on_click(cx.listener(|this, _, window, cx| {
this.show_whitespaces = !this.show_whitespaces;
this.editor.update(cx, |state, cx| {
state.set_show_whitespaces(this.show_whitespaces, window, cx);
});
cx.notify();
}))
}

fn render_indent_guides_button(
&self,
_: &mut Window,
Expand Down Expand Up @@ -1079,6 +1100,7 @@ impl Render for Example {
.gap_3()
.child(self.render_line_number_button(window, cx))
.child(self.render_soft_wrap_button(window, cx))
.child(self.render_show_whitespaces_button(window, cx))
.child(self.render_indent_guides_button(window, cx)),
)
.child(self.render_go_to_line_button(window, cx)),
Expand Down
Loading