Commit graph

1372 commits

Author SHA1 Message Date
Jason Lee
3500e5d5bc
label: Fix Label highlight may crash of not a char boundary. (#1574) 2025-11-12 10:19:43 +00:00
Jason Lee
cbd4346b87
root: Impl Styled for Root. (#1573) 2025-11-12 17:57:15 +08:00
Jason Lee
a2c16bfae6
popover: Revert defer_to focus on Popover open. (#1571)
Revert #1559 added defer to focus.

Removed the behavior of focus back to was focused handle on close
Popover, this is not correct for Popover.
2025-11-12 17:29:22 +08:00
Jason Lee
f26f01909e
root: Render overlays inside Root element by default. (#1570)
## Break Change

- The `Root::render_notification_layer`, `Root::render_sheet_layer`,
`Root::render_dialog_layer` has been removed, we don't need it now, the
Root element has default rendered them.
2025-11-12 08:04:54 +00:00
Jason Lee
f88b547b70 Bump v0.4.0-preview2 2025-11-12 15:16:49 +08:00
Jason Lee
214d3f6622
notification: Add &mut Self to content and action method. (#1569) 2025-11-12 15:10:42 +08:00
ihavecoke
e97689f12c
chore: Dependency gpui-macros/inspector to inspector features (#1568) 2025-11-12 15:10:13 +08:00
Jason Lee
b3c0188940
context_menu: Fix ContextMenu to cover parent element area. (#1566)
Close #1541
2025-11-12 06:19:52 +00:00
ihavecoke
838fd6411a
webview: Add inspector feature to enable WebView developer tools (#1564) 2025-11-12 11:11:18 +08:00
Jason Lee
a185d8ed24
menu: Fix #1545 Popover change broken submenu click in dropdown menu. (#1563)
This bug was caused by #1545.
2025-11-11 22:18:26 +08:00
Jason Lee
3cd94ea0be
popover: Fix click trigger to close popover. (#1559) 2025-11-11 21:14:56 +08:00
Jason Lee
eef8abaa15
popover: Fix #1545 incorrect to sync on_open_change to state. (#1557) 2025-11-11 18:41:23 +08:00
Floyd Wang
fbc3a6e4f4
form(field): Fix label line break not working (#1558) 2025-11-11 10:36:10 +00:00
Jason Lee
2dbfba3490
popover: Improve Popover API. (#1545)
- Add `open`, `on_open_change` method to control open state.
- Add `default_open` method.

## Break Change

This PR to rewrite the API of Popover API to make it easy to use. 

- The `content` method now can receive an element directly.

```diff
- .content(|window, cx| {
-     cx.new(|cx| {
-         PopoverContent::new(window, cx, |_, _| {
-             div().child("This popover content.")
-         })
-     })
- })
+ .content(|state, window, cx| {
+     div().child("This popover content.")
+ })
```

- And you can also just use `child` and `children` to add child
elements.

```rs
Popover::new("my-popover")
    .trigger(Button::new("trigger").label("Open Popover"))
    .child("This popover content.")
```

- Removed `PopoverContent`, and changed `Popover` default paddings to
`p_3`.
2025-11-11 17:45:30 +08:00
Floyd Wang
13f25bc4a9
progress: Fix incorrect border radius (#1555)
| Before | After |
| - | - |
| <img width="848" height="274" alt="SCR-20251111-nduc"
src="https://github.com/user-attachments/assets/e04590a3-6154-41f6-9763-a7de7db2301e"
/> | <img width="821" height="272" alt="SCR-20251111-ndpb"
src="https://github.com/user-attachments/assets/04ba2e28-0c7f-4205-b8b5-cc79b661ecef"
/> |
2025-11-11 06:53:50 +00:00
ihavecoke
1a5dd46acd
tiles: Add to support panel auto-snap while drag movement (#1552)
Before: 


https://github.com/user-attachments/assets/b9171a47-e21b-4132-8b13-7d9bf06f083a

After:


https://github.com/user-attachments/assets/e06c8353-41f8-4124-b9f4-1c44e462ab72
2025-11-11 11:56:58 +08:00
Floyd Wang
74f23bfca8
tab: Refactor creation to use builder pattern (#1553)
## Breaking change

```diff
- Tab::new("Account")
+ Tab::new().label("Account")
```

We can currently create a tab item without a label, such as only an
icon.
2025-11-11 10:35:00 +08:00
FlyingYu
9228dbfb13
editor: Improve double-click for word selection (#1491)
Close #876 

https://github.com/user-attachments/assets/bb04b3ab-05ca-456c-bb14-b812a846701d

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-10 05:02:02 +00:00
Nico Gründel
2cba6e8be9
slider: Add option to choose between linear and logarithmic scale (#1543)
Adds the ability to choose between a linear and a logarithmic scale for
the slider. A logarithmic scale is the right and intuitive choice for
many different slider applications. Building this right into the
component has two advantages:
- The user doesn't have to convert at every point where they might use
or update the slider value
- On a logarithmic scale, the distance between steps varies over the
sliders range. This implementation respects that

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-10 02:56:09 +00:00
Moulberry
a4d792f121
button_group: Fix overriding button click when no on_click (#1546)
When `on_click` is not specified on the button group, this PR allows for
specifying on_click on each individual button.

e.g.

```rs
let buttons = ButtonGroup::new(("buttons", index)).layout(Axis::Vertical)
    .child(Button::new(("install", index)).label("Install").icon(download_icon).success().on_click(move |_, _, cx| {
          // Install
    })
    .child(Button::new(("open", index)).label("Open Page").icon(IconName::Globe).info().on_click(move |_, _, cx| {
         // Open page
    }));
```
2025-11-10 09:43:25 +08:00
Nico Gründel
b899100d09
slider: Improve Slider interaction to click on bar to drag. (#1544)
This pull request adds a drag event to the slider bar itself, analogous
to the drag handles, in case the slider is not a range slider. This
allows for a more intuitive interaction with the slider, where one can
click and drag on any part of the slider bar container.

https://github.com/user-attachments/assets/4d41ba10-2992-4a42-beb6-0bc376185c5e

This doesn't change the behavior for range sliders, as it's ambiguous
which slider should be dragged in case the event starts between the
sliders. Though if desired, it wouldn't be difficult to implement the
same behavior for clicks below the start or above the end slider.
2025-11-09 11:31:21 +08:00
Jason Lee
a2c55dda46
form: Rename FormField to Field. (#1539) 2025-11-07 18:43:01 +08:00
Jason Lee
945db0be56
dialog: Rename Modal to Dialog. (#1538)
## Break Change

- Renamed `Modal` to `Dialog`.

```diff
- window.open_modal(...)
+ window.open_dialog(...)

- window.close_modal(...);
+ window.close_dialog(...);
```

- Renamed `show_close` method to `close_button` in Dialog.
```diff
- .show_close(false)
+ .close_button(true)
```
2025-11-07 17:25:55 +08:00
Moulberry
c78811c4b9
button_group: Add vertical (#1537)
Adds a vertical option to the button group

Also added an example of the vertical button group to the story

Also fixed button rounding only working when both tl/bl and tr/br are
both set, now they can be set individually

I'm not sure if the justify_center in `.when(self.vertical, |this|
this.flex_col().justify_center())` is needed, but I added it to match
the behaviour of `.items_center()` when the flex direction is row.
2025-11-07 16:48:14 +08:00
Jason Lee
001107438f
story: Add lazy load option to List story. (#1535) 2025-11-06 15:23:45 +00:00
Jason Lee
34c589d45b Bump v0.4.0-preview1. 2025-11-06 22:27:26 +08:00
obito
80cdf6a44c
theme: Allows to use alpha color for active_border but at least 0.3. (#1531)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-06 22:23:55 +08:00
Moulberry
7f8eb28cfa
table: Fix missing border on first frame (#1533)
After all the adjustments, the original issue that
https://github.com/longbridge/gpui-component/pull/1505 was trying to fix
reappeared.

The fix is simple: don't consider the table to be filled if the height
is zero.
2025-11-06 22:01:55 +08:00
Moulberry
faee91eda4
table: fix row border missing on first frame (#1505)
Currently, the bounds are zero on the first frame.
Therefore, the extra_rows_count will always be zero on the first frame.
This causes rendering issues for row border & row stripes.

Unfortunately, I don't know how to get the correct height on the first
frame to fix the row stripes.

However, an easy fix for the row border rendering issue is to disable
the table_is_filled check. The check is problematic anyways since the
border affects the height of the element.

I attached a video showing the issue, the border doesn't render on the
first frame and the height of the element also shifts due to the border:


https://github.com/user-attachments/assets/b154c686-cd9c-4b6b-8ba6-c79640297abc

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-06 21:15:13 +08:00
Jason Lee
97ba18fce9
modal: Adjust close button position. (#1532) 2025-11-06 13:10:49 +00:00
Jason Lee
34aa68ad35
table: Fix Table stripe mode overflow scroll. (#1530)
Ref #1505
2025-11-06 19:11:28 +08:00
Floyd Wang
f33d112819
button: Remove duplicate disabled style (#1529) 2025-11-06 18:47:59 +08:00
Jason Lee
80689264e2
sheet: Rename Drawer to Sheet. (#1527)
## Break Change

- Renamed `Drawer` to `Sheet`, also renamed relative method contains
`drawer` to `sheet`.
- Renamed `ContextModal` to `WindowExt`.

```diff
- use gpui_component::drawer::Drawer
+ use gpui_component::sheet::Sheet

- use gpui_component::ContextModal
+ use gpui_component::WindowExt
```
2025-11-06 07:19:10 +00:00
Jason Lee
4dc10165fb
spinner: Rename Indicator to Spinner. (#1526)
## Break Change

- Renamed `Indicator` to `Spinner`.

```diff
- use gpui_component::indicator::Indicator;
+ use gpui_component::spinner::Spinner;
```
2025-11-06 11:36:39 +08:00
Jason Lee
c06e91101e
collapsible: Add Collapsible. (#1525)
Close #1479 

<img width="1171" height="791" alt="image"
src="https://github.com/user-attachments/assets/eac5cd9f-ef8c-4eb4-b93d-f63c9302c99a"
/>
2025-11-06 10:57:18 +08:00
Jason Lee
4b3fb51fb8
editor: Fix indent guides render position. (#1524) 2025-11-05 13:17:32 +00:00
Jason Lee
998a5fd922
chore: Standardize the overall API and improve docs. (#1516) 2025-11-05 19:10:30 +08:00
Jason Lee
2ba0dfbb96
popover: Renamed no_style to appearance like the Input. (#1523)
## Break Change

- The `no_style` method has been removed, use `appearance` instead.
2025-11-05 08:01:27 +00:00
Jason Lee
469b53178b
form: Renamed column to columns. (#1522)
## Break Change

- Renamed `column` to `columns` and receive `usize` type.
2025-11-05 07:32:15 +00:00
Jason Lee
aea8223637
description_list: Renamed child to item, and add child to add DescriptionItem. (#1521)
## Break Change

- The original `child` method has been renamed to `item`.
- Now the add new `child` to accept a `DescriptionItem` type like the
`children` method.
2025-11-05 07:26:17 +00:00
Jason Lee
2093046942
clipboard: Removed content method from Clipboard. (#1520)
## Break Change

- The `content` method has been removed from `Clipboard`, if you want
display something, you can wrap it in a h_flex.
2025-11-05 07:17:58 +00:00
Jason Lee
d3ec1f29f8
breadcrumb: Rename item to child and add children method. (#1519) 2025-11-05 15:13:29 +08:00
Jason Lee
b08f5be97c
radio: Rename on_change to on_click for RadioGroup. (#1517)
## Break Change

- Renamed `on_change` to `on_click` for RadioGroup.
 
```diff
- RadioGroup::horizontal("radio_group_1").on_change(...)
+ RadioGroup::horizontal("radio_group_1").on_click(...)
```
2025-11-05 02:53:22 +00:00
Jason Lee
0524c51b3e
toggle: Refactor Toggle, ToggleGroup API. (#1515)
## Break Changes

- Refactor `Toggle` new API to require a `id`, and renamed `on_change`
to `on_click.
- Renamed `on_change` method to `on_click` for `ToggleGroup`.

```diff
- Toggle::label("Hello").id("hello").on_change(..)
+ Toggle::new("hello).label("Hello").on_click(..)

- ToggleGroup::new("group1).on_change(..)
+ ToggleGroup::new("group1).on_click(..)
```
2025-11-05 10:47:55 +08:00
Moulberry
a4e93132f1
input, select, date_picker: Refactor cleanable to have argument and default to false. (#1506)
https://github.com/longbridge/gpui-component/pull/1502#issuecomment-3485354324

## Break Change

- The `DatePicker` and `Select` has changed `cleanable` default from
`true` to `false`.
- Updated `Input`, `DatePicker` and `Select` the `cleanable` to have a
argument.

```diff
- pub fn cleanable(mut self)
+ pub fn cleanable(mut self, cleanable: bool)
```

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-05 09:33:31 +08:00
Jason Lee
4b8775f7d3
chore: Remove unused image example. (#1510)
Close #1494
2025-11-04 14:55:02 +00:00
Jason Lee
5f39b99fe4
list: Avoid select item when selectable(false). (#1508)
Close #1500
2025-11-04 14:12:31 +00:00
Jason Lee
d037f074dc
chore: Move searchable to ListState and SelectState. (#1507) 2025-11-04 21:26:11 +08:00
Jason Lee
087cb70d00
select, list: Update searchable default to false. (#1504)
Continue #1503 to update the `searchable` default to `false`.
2025-11-04 20:59:38 +08:00
Jason Lee
2870bc6e36
list: Add searchable, search_placeholder option to List and Select. (#1503)
## Break Change

- Removed `set_query_input`, `query_input` and `no_query` method from
List. Now use `List::new(&state).searchable(false)` to intead of
`no_query`.
- Removed `searchable` method from `SelectDelegate`, use
`Select::searchable` instead.
2025-11-04 19:06:50 +08:00
Floyd Wang
27f1f960a0
select: Restore the selection when canceling (#1501)
Fix #1495
2025-11-04 10:22:00 +00:00
Jason Lee
3a9198b5de chore: Hard link crates/ui/LICENSE-APACHE. 2025-11-04 17:54:14 +08:00
ihavecoke
fbaddbe9e3
tiles: Add scrollbar_show option to Tiles (#1496) 2025-11-04 17:42:46 +08:00
Jason Lee
b7815ed6ec
table: Keep scroll to item at bottom when move down. (#1499) 2025-11-04 09:28:37 +00:00
Floyd Wang
2e5bdd0c3a
list: Fix incorrect next selection when select index is none (#1498)
Previously, pressing next would select the second item.
2025-11-04 17:17:17 +08:00
Moulberry
e7aa8983dc
input: Delete selected text with modifier keys (#1497)
In most applications, when text is selected and backspace/delete is
pressed, the selection is simply deleted.

Currently, gpui-component will ignore the selected text and delete the
previous/next word when Ctrl is pressed.

This can be very confusing especially if you do ctrl+a then
ctrl+backspace, expecting the input to be cleared.

This PR makes it so that if there is an active selection, the active
selection is deleted before doing any extra processing.
2025-11-04 16:54:31 +08:00
Jason Lee
893e323692
Fix state internal update to refresh for List, Tree, Table and Select. (#1492)
This to fix #1468, #1449 changes broken the state (e.g.: `SelectState`
to call `cx.notify()`) update not notify parent element (e.g.: `Select`)
to rerender.
2025-11-04 16:25:37 +08:00
Jason Lee
faee23eef8
table: Change context_menu method in TableDelegate to mutable window and cx. (#1487)
## Break Change

- The `window`, `cx` has changed from `&Window`, `&App` to `&mut
Window`, `&mut App`.

```diff
- fn context_menu(&self, row_ix: usize, menu: PopupMenu, window: &Window, cx: &App)
+ fn context_menu(&self, row_ix: usize, menu: PopupMenu, window: &mut Window, cx: &mut App)
```
2025-11-03 18:06:29 +08:00
FlyingYu
be460dcbed
modal, drawer: Block background interaction when Modal, Drawer is active. (#1483)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-03 16:51:38 +08:00
Floyd Wang
3d606a6909
select: Avoid reopen menu when clearing selection (#1484) 2025-11-03 08:24:54 +00:00
Jason Lee
9fa2669ff4
list, table: Refactor List, Table to have ListState, TableState. (#1468)
## Break Change

- Like Select, Input API design, now `List`, `Table` also has ListState
and TableState.

```diff
- let table = cx.new(|_| Table::new(delegate, window, cx).stripe(true).border(true))
+ let table = cx.new(|_| TableState::new(delegate, window, cx))
+ Table::new(&table).stripe(true).border(true) // for render

- let list = cx.new(|_| List::new(delegate, window, cx))
+ let list = cx.new(|_| ListState::new(delegate, window, cx))
+ List::new(&list) // for render
```

- ListDelegate, TableDelegate methods has changed some argument type:
  
- If first argument is `&mut self`, the `cx` has been changed to `&mut
Context<ListState<Self>>` or `&mut Context<TableState<Self>>`.
  

    ```diff
- fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<List<Self>>)
+ fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<ListState<Self>>)
    ```

- If first argument is `&self`, the `cx` has been changed to `&mut App`.

    ```diff
- fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut
Context<List<Self>>)
    + fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut App)
    ```
2025-11-02 12:59:37 +00:00
Floyd Wang
123934237a Bump v0.4.0-preview0 2025-10-30 15:50:45 +08:00
Jason Lee
e75c37a1ac
chore: Update List, Tree, Kbd exports. (#1467)
## Break Change

- Removed `Kbd` from root export, use `gpui_component::kbd::Kbd`
instead.
- Removed `List` from root export, use `gpui_component::list::*`
instead.
- Removed `Tree` from root export, use `gpui_component::tree:*` instead.
2025-10-30 07:19:39 +00:00
Jason Lee
2727a65494
resizable: Simplify Resizable API. (#1459)
- Added `on_resize` callback method to `ResizabelPanelGroup`.

## Break Changes

- Remove `state` argument from `h_resizable`, `v_resizable` method.

```diff
- v_resizable("resizable-1", state)
+ v_resizable("resizable-1")
```

- Removed `group` method from `ResizabelPanelGroup`, use `child`
instead.

```diff
- v_resizable(..).group(..)
+ v_resizable(..).child(..)
```
2025-10-29 23:01:05 +08:00
Jason Lee
a1ca8624af
example: Add file tree to Editor example. (#1457)
<img width="1205" height="861" alt="image"
src="https://github.com/user-attachments/assets/4b3814cd-7dc0-4fc1-8f0f-d98d7cc29294"
/>
2025-10-29 12:58:40 +00:00
Jason Lee
7036415662
chore: Keep spawn task on it owner. (#1456) 2025-10-29 19:11:49 +08:00
Jason Lee
4eb1ed2cfd
tab: Use on_click instead of action for TabBar dropdown menu. (#1454)
Close #1453
2025-10-29 01:04:14 +00:00
Jason Lee
55db53a46d
select: Impl SelectItem for &'static str. (#1451) 2025-10-28 13:37:00 +00:00
Jason Lee
34ef0ff6d0
chore: Rename Dropdown to Select, TextInput to Input. (#1449)
## Break Change

- The `Dropdown` has been renamed to `Select`.
- The `TextInput` has been renamed to `Input`.

| Before | After |
| --- | --- |
| TextInput | Input |
| Dropdown | Select |
| DropdownItem | SelectItem |
| DropdownItemGroup | SelectGroup |
| DropdownState | SelectState |
| DropdownEvent | SelectEvent |
| DropdownDelegate | SelectDelegate |
| dropdown::ListEvent | ~~Removed~~ |

- Renamed `PopupMenuExt` to `DropdownMenu`.
- Removed pub mod `menu::popup_menu`, `menu::context_menu`, they are
moved into `menu` mod.
- Renamed `popup_menu` method to `dropdown_menu` for `DropdownMenu`,
`Panel`, `PanelView` and `DropdownButton`.

| Before | After |
| --- | --- |
| popup_menu::PopupMenuExt | menu::DropdownMenu |
| popup_menu | dropdown_menu |
| popup_menu_with_anchor | dropdown_menu_with_anchor |
2025-10-28 21:22:31 +08:00
Floyd Wang
0e2397cf15
chart(bar): Fix the label is not centered (#1448) 2025-10-28 16:53:42 +08:00
Jason Lee
38a10fe05c
menu: Add item and export PopupMenuItem with builder methods to PopupMenu. (#1445)
Now we can be easy to add a menu item without define `action`, just use
`on_click` callback.

## Break Changes

- Removed complex methods: `menu_element_with_check_and_disabled`,
`menu_element_with_icon_and_disabled`, you can use `item` and
`PopupMenuItem` instead.
2025-10-28 14:42:56 +08:00
Floyd Wang
19a54d6065
chart(pie): Support dynamic inner and outer radius (#1444)
## ⚠️Breaking Change
Add `inner_radius` and `outer_radius` options for `Arc` paint function.

```diff
- arc.paint(a, "#9d9d9d", bounds, window)
+ arc.paint(a, "#9d9d9d", Some(20.), Some(30.), bounds, window)
```
## Demo
<img width="410" height="442" alt="SCR-20251028-kohu"
src="https://github.com/user-attachments/assets/8b849053-22e6-4d6f-933f-b9fb2a47f5e3"
/>
2025-10-28 13:53:28 +08:00
Jason Lee
904c9f3fa7
theme: Export more theme options for schema. (#1442)
- Fix theme switch to support other UI settings (e.g.: radius, shadow,
font_size).
- Update `matrix` theme to use rounded 0px.

<img width="1380" height="1139" alt="image"
src="https://github.com/user-attachments/assets/24832fde-5b5e-4508-9b38-6c3c2890aedb"
/>
2025-10-28 03:28:18 +00:00
Jason Lee
cc0f936348
tiles: Add tile_radius theme option and default 0px. (#1441) 2025-10-28 02:54:41 +00:00
Floyd Wang
183d17731d Bump v0.3.1 2025-10-27 13:52:29 +08:00
Jason Lee
6ebb9418a0
editor: Use measure_indent_width for indent guides width. (#1428)
Continue #1426, this changes I was forgotten to push before #1426
merged.
2025-10-24 20:18:30 +08:00
Jason Lee
178269be63
editor: Add indent guides. (#1426)
<img width="1070" height="1006" alt="image"
src="https://github.com/user-attachments/assets/a456b055-b45f-45ae-84b0-452a952cc19c"
/>
2025-10-24 19:03:09 +08:00
Floyd Wang
21eff06e11
list: Use click events instead of mouse events when confirming (#1427)
Fix the issue where inner list buttons do not respond to clicks.
2025-10-24 16:51:37 +08:00
Jason Lee
fe137caba0 chore: Fix Cargo.toml meta info. 2025-10-24 13:30:11 +08:00
Jason Lee
98c17740c7 docs: Update from 40+ to 60+ components. 2025-10-24 13:25:31 +08:00
Jason Lee
ab7af9c01d Bump v0.3.0 2025-10-24 10:47:04 +08:00
Jason Lee
04fd5e1511
tiles: Ensure to response correct panel on drag or resize. (#1422)
Use `item_id` to store the dragging and resizing item.
2025-10-23 11:29:39 +00:00
Copilot
08b5013b36
theme: Update scrollbar background color to transparent for all themes. (#1421)
## Problem

When scrolling quickly, a distracting background color was appearing in
the scrollbar area, as shown below:

<img
src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04">

## Root Cause

Several theme files had scrollbar background colors configured with
partial transparency (alpha values like `33`, `44`, `80`, etc.) instead
of full transparency (`00`). This caused a semi-transparent background
to become visible during fast scrolling, creating an unwanted visual
artifact.

## Solution

Updated all `scrollbar.background` color values to use full transparency
by setting the alpha channel to `00`. This ensures the scrollbar
background is completely invisible across all themes, with only the
scrollbar thumb (the draggable indicator) remaining visible.

## Changes

Modified 7 theme files with non-transparent scrollbar backgrounds:

- **alduin.json**: `#28282833` → `#28282800`
- **hybrid.json**: `#E0E0E044` → `#E0E0E000`, `#1D1F2144` → `#1D1F2100`
- **jellybeans.json**: `#26262633` → `#26262600`
- **mellifluous.json**: `#fafafa33` → `#fafafa00`
- **molokai.json**: `#FEFAF933` → `#FEFAF900`
- **solarized.json**: `#EEE8D533` → `#EEE8D500`, `#002b3633` →
`#002b3600`
- **default-theme.json**: `#fafafa80` → `#fafafa00`, `#17171780` →
`#17171700`

All other themes already had transparent scrollbar backgrounds and
remain unchanged.

## Impact

- Eliminates the visual glitch where a background color appears during
fast scrolling
- Provides a consistent, clean scrollbar appearance across all 20 themes
plus the default theme
- No functional changes to scrollbar behavior - only visual appearance
- Total of 37 scrollbar.background entries now fully transparent

Fixes the issue reported by @huacnlee in the comments.





<issue_title>A different background color appears when the scroll bar
scrolls quickly</issue_title>
&gt;<issue_description>A different background color appears when the
scroll bar scrolls quickly
&gt; 
&gt;<img
src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04"></issue_description>
&gt; 
&gt;<agent_instructions>Make change to update scrollbar background color
to transparent for all themes.</agent_instructions>
&gt; 
&gt; ## Comments on the Issue (you are @copilot in this section)
&gt; 
&gt;<comments>
&gt;<comment_new><author>@huacnlee</author>
&gt; That is the scrollbar background color. I am still on to consider
removing that color.</comment_new>
&gt;</comments>
&gt;

Fixes longbridge/gpui-component#1402

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>A different background color appears when the scroll bar
scrolls quickly</issue_title>
> <issue_description>A different background color appears when the
scroll bar scrolls quickly
> 
> <img width="1338" height="387" alt="Image"
src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04"
/></issue_description>
> 
> <agent_instructions>Make change to update scrollbar background color
to transparent for all themes.</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@huacnlee</author><body>
> That is the scrollbar background color. I am still on to consider
removing that color.</body></comment_new>
> </comments>
> 


</details>

Fixes longbridge/gpui-component#1402

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute
survey](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-10-23 18:13:33 +08:00
Jason Lee
6dd857a7f7
input: Fix may flash scroll when move cursor in auto grow mode. (#1419) 2025-10-23 17:43:33 +08:00
Floyd Wang
b80fca28c1 Bump v0.3.0-preview2 2025-10-23 16:36:23 +08:00
Jason Lee
b42a429fdc
input: Fix Input to prepare text wrapper. (#1417)
To ensure call update_all in TextWrapper.
2025-10-23 08:03:38 +00:00
Jason Lee
804a89df20
chore: Update GPUI v0.2.2 (#1416) 2025-10-23 07:41:50 +00:00
Copilot
3c6a7b6a9b
highlighter: Make SyntaxHighlighter::styles method public for external use (#1415) 2025-10-23 10:34:13 +08:00
Stephan Aßmus
5ccdba41af
Call dropdown item's display_title() method also for rendering within the dropdown when open (#1410)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2025-10-22 11:35:34 +08:00
Jason Lee
65b53c86e4
input: Hide scrollbar when not overflow in auto grow mode. (#1407) 2025-10-21 11:05:22 +00:00
Jason Lee
1af28c49bd
input: Stop propagation on scroll wheel. (#1406)
Close #1397
2025-10-21 18:50:50 +08:00
Vincent Hanquez
2b37028e08
chore: Update dependencies to smol = 2 (#1404)
just noticed the dependency is set to a fairly old version of smol (=
1), so update to smol = 2.

Also gpui/zed seems to be using smol = 2
2025-10-21 10:56:48 +08:00
Jason Lee
17ec395853 Bump v0.3.0-preview0 2025-10-17 10:37:49 +08:00
Jason Lee
f16487a2cb
chore: Fix license link in crate meta. (#1393)
Close #1392
2025-10-17 10:32:09 +08:00
Jason Lee
31db24b689
editor: Improve hover popover delay. (#1389) 2025-10-17 02:14:20 +00:00
Jason Lee
e0c1f91ed4
virtual_list: Fix VirtualList by measure item to get correct content_size to avoid scroll overflow. (#1388)
- Fixed VirtualList example the horizontal scrollbar not appear.
- Fixed VirtualList example scroll slow, this because not call
`self.scroll_handle.set_offset` to update.
2025-10-16 07:50:09 +00:00
Jason Lee
2a9bc2a2f8
Revert "virtual_list: Fix VirtualList to limit only allow 1 direction scrollable." (#1387)
Reverts longbridge/gpui-component#1386
2025-10-16 14:27:28 +08:00
Jason Lee
4341cf81d3
virtual_list: Fix VirtualList to limit only allow 1 direction scrollable. (#1386)
It should only allow to scroll in one direction.

For example, when `axis` is `vertical`, the horizontal should not able
to scroll.
2025-10-16 14:25:13 +08:00
Floyd Wang
43a2c814a3
checkbox: Do not stop propagation when click (#1385) 2025-10-16 06:01:06 +00:00
Jason Lee
1adaf3ec55
tree: Add Tree. (#1373)
Close #318 


https://github.com/user-attachments/assets/1fed12e2-df53-4213-a3f5-c57bd8b4cadb
2025-10-15 18:39:47 +08:00
Copilot
4fef96e407
story: Fix story panic when save state failed. (#1384)
Close #1383

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-10-15 08:20:44 +00:00
han
1bc5ff03df
story: Add interactive brush drawing canvas (#1370)
<img width="2175" height="1358" alt="image"
src="https://github.com/user-attachments/assets/41716d72-655f-440a-ac9e-cdb91e1b4417"
/>

---------

Co-authored-by: hl <hl@nmcsoft.com>
2025-10-15 15:27:59 +08:00
Jason Lee
59f4e26c7b
input: Fix Input panics when masked have non-ASCII characters. (#1382)
Close #1377
2025-10-15 07:15:50 +00:00
Jason Lee
491bacfd0e
scrollbar: Fix scroll to show mode. (#1381)
Close #1379, this bug is introduced from #1196.
2025-10-15 05:51:13 +00:00
Jason Lee
4ccd7d99d0
examples: Add examples folder. (#1378) 2025-10-15 02:26:13 +00:00
Jason Lee
6998708b81
Revert "chore: Update GPUI dependency." (#1376)
Reverts longbridge/gpui-component#1374

Because `gpui v0.2.1` have but, the text render not in vertical center.
2025-10-14 21:41:31 +08:00
Jason Lee
889382cba1
input: Grouping input history to avoid IME placeholder. (#1375) 2025-10-14 13:27:23 +00:00
Jason Lee
e56c7a39bf
chore: Update GPUI dependency. (#1374) 2025-10-14 12:37:15 +00:00
Jason Lee
0c0c36cb87
menu: Fix trigger action with context. (#1372)
Fix previous #1338 broken trigger action with context.
2025-10-14 19:58:11 +08:00
Floyd Wang
47978bc50e
button: Support specified anchor to dropdown button (#1367) 2025-10-14 11:19:22 +08:00
Floyd Wang
1abb6c2222
plot(line_chart): Add missing natural stroke style (#1366) 2025-10-14 09:40:10 +08:00
Martí Gimeno Ortí
5f13b49690
plot: Add stroke style per each Y series (#1364)
Enables the user to set different `stroke_style` to each Y data series,
keeping retrocompatibility with the previous API.

<img width="1300" height="411" alt="Screenshot from 2025-10-13 11-33-28"
src="https://github.com/user-attachments/assets/d665b87c-0d79-479c-9156-15a0f1c8ca10"
/>
2025-10-14 09:36:30 +08:00
Jason Lee
5b2fed0ccb
markdown: Use list for Markdown render and add scrollbar. (#1357) 2025-10-13 22:06:07 +08:00
Jason Lee
2574e7f812
story: Add open file to Markdown and Editor example. (#1363)
Close #1352
2025-10-13 11:52:16 +08:00
Jason Lee
97df4efd46
input: Fix set_value when Input is disabled. (#1362)
Close #1350
2025-10-13 11:15:32 +08:00
Jason Lee
08cf199b39
editor: Add delay to trigger hover popover. (#1361) 2025-10-13 10:40:09 +08:00
Sunli
8a63fd67ab
chore: Fix webview example (#1360) 2025-10-13 10:10:35 +08:00
Martí Gimeno Ortí
32b8d65075
plot: Add StepAfter kind to StokeStrike (#1356)
Implements new `StokeStrike::StepAfter`  for plot component

<img width="1700" height="1030" alt="step-after-plot-stoke-style"
src="https://github.com/user-attachments/assets/89252ba9-2834-4c9a-9020-7977ffea6865"
/>
2025-10-13 09:59:51 +08:00
richerfu
20ddb88e95
input: impl Selectable for TextInput that allow it as tigger for popover (#1353) 2025-10-12 21:20:38 +08:00
Jason Lee
6817c8d3cc
menu: Add AppMenuBar. (#1338)
- input: Change Input to not unselect when blur.
- popup_menu: Fix get key binding on PopupMenu with action context.

<img width="935" height="694" alt="image"
src="https://github.com/user-attachments/assets/295fa84e-f1d8-4f6f-8a77-601a45f8ad6d"
/>

## TODO

- [x] Keyboard support. 
- [x] Add submenu to example.
- [ ] ~~Icon~~ and check support. Wait
https://github.com/zed-industries/zed/pull/39876
2025-10-10 21:03:16 +08:00
Jason Lee
d364402a94
editor: Fix code actions not display. (#1347) 2025-10-10 19:28:59 +08:00
Floyd Wang
d4b0aff534
button: Fix the on_hover does not respond (#1346) 2025-10-10 10:52:05 +08:00
ihavecoke
9d01ac26bc
menu: Fix submenu item selection when multiple submenus exist (#1342)
Before:


https://github.com/user-attachments/assets/8653953e-4e9d-49e6-946a-1696ea6abee0

After:


https://github.com/user-attachments/assets/f5bfbf19-69e1-4e64-81c1-072c61e8a8f7

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-10-09 21:32:51 +08:00
Floyd Wang
7a8be9a628
button: Add Support for on_hover event (#1341) 2025-10-09 18:43:50 +08:00
Jason Lee
ca9d5b77e2 chore: Release v0.2.0 2025-10-09 15:21:10 +08:00
Jason Lee
6ca9ac46fa
chore: Bump crate version. (#1340) 2025-10-09 15:20:34 +08:00
Jason Lee
1fce2e1ac4
menu: Improve MenuItem paddings and fix submenu support. (#1339)
Fix #1332 was broken submenu selection.
2025-10-09 10:52:33 +08:00
Jason Lee
1db3e03fc3
context_menu: Fix subscription leak. (#1337) 2025-10-08 16:02:21 +08:00
Floyd Wang
66851c55e4 Bump gpui (#1336) 2025-10-08 11:20:06 +08:00
ihavecoke
d47b9c15ed
menu: Add flex property to custom element in popup menu items for better layout (#1335) 2025-10-08 11:04:21 +08:00
Floyd Wang
c3954b0455
input: Implement styled for number input (#1333) 2025-10-08 10:36:28 +08:00
Jason Lee
c579db975f
menu: Better handle hover for menu item. (#1332)
Follow #1328 to improve again.
2025-10-08 10:17:08 +08:00
Jason Lee
d0396d779e
editor: Add document_colors LSP. (#1329) 2025-10-06 18:08:12 +08:00
Jason Lee
efe7e14e88
menu: Unselect menu item when mouse move out. (#1328) 2025-10-06 09:45:45 +08:00
Jason Lee
794f4d6397
editor: Add to support move vertical for soft wrapped lines. (#1312) 2025-10-03 18:19:37 +08:00
Jason Lee
f59bac8c8b
tab_bar: Let normal/active tab has same border to avoid flash on active change. (#1327) 2025-10-03 16:30:28 +08:00
Jason Lee
a48232cefd
input: Clean to reset selection and scroll offset. (#1326)
- Focus back to input when click `clean` button.
2025-10-03 16:11:27 +08:00
Floyd Wang
9754cab4d7
button: Bind element ID after button is created (#1325)
- Fix the selected-state error in the popup menu.
2025-10-03 14:52:53 +08:00
Floyd Wang
1358b2906e
Bump gpui (#1324)
* Wireup the `Pixels` change
https://github.com/zed-industries/zed/pull/39367.
2025-10-03 14:32:29 +08:00
Floyd Wang
4d459ea160 chore: Remove debugging logs 2025-10-03 13:37:45 +08:00
Jason Lee
cfd060b66d
editor: Split Input and Editor background color. (#1323)
Keep input to use window background color, the `editor.background` only
for Editor mode.
2025-10-03 11:20:01 +08:00
Jason Lee
e84e8ebaad
button: Fix button label display has overflow hidden. (#1322) 2025-10-03 10:18:00 +08:00
Carlo Corradini
908c022efe
chore: Assets interpolate folder path via rust embed (#1318)
Use `rust-embed` feature `interpolate-folder-path` to always
(`debug`/`release`) load assets from the correct `assets` directory
2025-10-02 16:04:33 +08:00
Jason Lee
463f01bb16
theme: Update macos-clasic dark theme color. (#1320)
<img width="1073" height="1006" alt="image"
src="https://github.com/user-attachments/assets/625df905-b2f9-405f-a806-4574209d39de"
/>

<img width="908" height="893" alt="image"
src="https://github.com/user-attachments/assets/2d816d64-2e69-43dc-a707-a49e5f9842d4"
/>
2025-10-02 14:46:27 +08:00
Floyd Wang
df8bcefaaa
tag: Implement styled for custom style (#1319) 2025-10-02 14:07:07 +08:00
Xu Desheng
8c6cde3719
highlighter: Use clip_offset to ensure UTF-8 char boundaries (#1317)
## Problem

SyntaxHighlighter panics when highlighting text containing multi-byte
UTF-8 characters (Chinese, Japanese, emoji, etc).

**Error**: `thread 'main' panicked at
ropey-2.0.0-beta.1/src/rope.rs:694:59`

**Root Cause**: tree-sitter may return byte offsets that fall in the
middle of multi-byte UTF-8 characters. When `Rope::slice()` receives
such offsets, it checks `is_char_boundary()` and panics with
`NonCharBoundary` error.

## Solution

Use `RopeExt::clip_offset()` to adjust byte offsets to the nearest char
boundaries before calling `slice()`.

**Changes**:
- Line 395-398: Clip offsets in main highlighting loop
- Line 441-443: Clip offsets when extracting injection content  
- Line 478-479: Added explanatory comment for injection highlighting
- Added imports for `RopeExt` and `Bias`

**Safety**:
- `Bias::Left` for start offset ensures we don't skip the beginning of a
character
- `Bias::Right` for end offset ensures we include the full character
- The adjustment is minimal (at most 3 bytes for UTF-8)
- Uses existing project API (`RopeExt::clip_offset`)

## Testing

Tested with:
-  Chinese text: "你好世界"、"**加粗中文**"
-  Japanese text: "こんにちは"、"日本語"
-  Emoji: "😀🎉🚀"
-  Markdown syntax highlighting with CJK characters
-  Code blocks with mixed languages

All tests pass without panics. Syntax highlighting works correctly. No
performance degradation observed.

## AI Assistance

🤖 This fix was developed with AI assistance (Claude). The solution
approach (using `clip_offset`) was identified through code analysis and
testing. The AI analyzed:
- ropey source code to understand the panic condition
- Existing usage of `clip_offset` in the codebase
- Tree-sitter byte offset behavior with UTF-8

All code has been reviewed and tested by humans, and further validated
by Gemini AI.

## Checklist

- [x] Follows existing code style
- [x] One PR does one thing (UTF-8 panic fix only)
- [x] All manual tests pass
- [x] Tested with real multi-byte UTF-8 content
- [x] No breaking changes
- [x] No performance regression
2025-10-02 12:14:07 +08:00
Jason Lee
935cd93f5a chore: Fix rust logo URL in test.md. 2025-09-30 16:29:56 +08:00
Sunli
d619e00ecb
input: Only recreate the TextView used to display hover information when necessary. (#1313) 2025-09-30 16:11:32 +08:00
Jason Lee
69af1be6e5
chore: Update GPUI and fix DeferredScrollToItem API changes. (#1315) 2025-09-30 16:10:25 +08:00
Jason Lee
8b0898147f
editor: Fix Editor crash when text is empty to display placeholder. (#1314) 2025-09-30 16:07:03 +08:00