Commit Graph

1285 Commits

Author SHA1 Message Date
Suyog Tandel
db6e375cb8 fix: window resize cursor shown incorrectly when maximized on Linux 2026-02-19 18:05:47 +05:30
Floyd Wang
0f0ab35233 Bump v0.5.1 2026-02-05 18:58:01 +08:00
Floyd Wang
f77d953ab4 Bump v0.5.1-preview0 2026-02-05 18:51:09 +08:00
Floyd Wang
c67821ef39 chore: Locking core-text version 2026-02-05 18:50:40 +08:00
Jason Lee
76424dd0ae Bump v0.5.0 2025-12-08 10:54:12 +08:00
Duane Bester
3c23ee9be4 editor: Add InlineCompletion LSP support (#1736)
Closes [1729](https://github.com/longbridge/gpui-component/issues/1729)

## Description

Adds support for inline completions, which allows the editor to support
agentic "tab to complete" solutions. This works, (tested macOS), but not
sure of any gotchas or different approaches.

## Screenshot


https://github.com/user-attachments/assets/8e437f1e-9792-4417-b070-0a1dd8de6024

## How to Test

User implements the `inline_completion` method in CompletionsProvider.

Not implementing should have no effect. 

## Checklist

- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-12-08 10:53:36 +08:00
John
3ecd9c7606 input: Fix text not in vertical center when masked text is empty. (#1753)
Closes #1724

## Screenshot

### Before                      
<img width="824" height="656" alt="CleanShot20251206132455"
src="https://github.com/user-attachments/assets/dc917dc2-1c48-4a7a-bc24-29f09f656d95"
/>

### After 
<img width="826" height="654" alt="CleanShot20251206132600"
src="https://github.com/user-attachments/assets/3a62e7fd-1f85-4165-84bf-7a9b25f5ef3d"
/>

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-08 10:53:23 +08:00
amiyzku
9b3b2802cc chart: Add candlestick chart (#1749)
## Description

Add `CandlestickChart` component for visualizing financial OHLC data
with candlestick patterns.

- Introduced a new CandlestickChart for displaying OHLC (Open, High,
Low, Close) values.
- Updated ChartStory to include stock price data and render multiple
candlestick chart variations.
- Enhanced theme with bullish and bearish colors for candlestick
representation.
- Updated documentation to include CandlestickChart examples and usage.

This addition enhances the charting library by providing a crucial tool
for visualizing stock market trends.

## Screenshot

<img width="1335" height="423" alt="image"
src="https://github.com/user-attachments/assets/5df7078e-a469-4262-b645-6434d08b7ccf"
/>

## How to Test

```bash
cargo run -p gpui-component-story
```

## Checklist

- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)
2025-12-08 10:53:16 +08:00
Floyd Wang
bc1092a6e1 context_menu: Prevent mouse events when menu popped out (#1750)
## Before

https://github.com/user-attachments/assets/6cb5a767-d888-43f1-b5cc-1f3c5748389d

## After

https://github.com/user-attachments/assets/0846d0e2-2311-47d1-8d5b-2e7bbc347fe3
2025-12-05 09:09:37 +00:00
Jason Lee
56fb93bca8 table: Add render_header method to support custom table header. (#1746)
Closes #1733

## Example

```rs
impl TableDelegate for MyTable {
    fn render_header(&mut self, _: &mut Window, _: &mut Context<TableState<Self>>) -> Stateful<Div> {
        div().id("header").h_10()
    }
}
```
2025-12-05 15:17:13 +08:00
Andreas Johansson
8fcf5f337d input: Fix resetting highlighting for single line code editor (#1742)
## Description

When using `set_value` with a `code_editor("lang").multi_line(false)`
the highlighting and lsp will not be reset.

## Video

### Before

https://github.com/user-attachments/assets/5fef5b6e-478e-4233-a911-e087f889040a

### After

https://github.com/user-attachments/assets/3ea99060-8dba-4604-9d3f-c151b3aadcf2

## How to Test

`cargo run --release -- input`, enter some text in "Single line code
editor", click "Reset"

## Checklist

- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)
2025-12-05 09:53:07 +08:00
Ylin
3b2746e0ba setting: Supplement subscription InputEvent for number_input (#1740) 2025-12-04 14:47:11 +08:00
Floyd Wang
13eceab1ac webview: Public the raw wry webview handle (#1739) 2025-12-04 03:53:28 +00:00
Ylin
514aea00be setting: Use precise subscripts for use_keyed_state (#1735) 2025-12-03 21:51:57 +08:00
Floyd Wang
a50b1e9341 dock: Fix tab panel first tab left border overlap issue (#1734)
| Before | After |
| - | - |
| <img width="811" height="424" alt="SCR-20251203-pzqr"
src="https://github.com/user-attachments/assets/9e0ad869-bb4b-451c-ad9a-1ca74204bb6d"
/> | <img width="811" height="424" alt="SCR-20251203-pzgw"
src="https://github.com/user-attachments/assets/ac6af899-d967-4d97-8818-b615ecd44b6b"
/> |
2025-12-03 18:32:48 +08:00
Duane Bester
31bab9dcc3 text_view: Adding optional code block actions to the TextView (#1725)
## Description

This PR Adds the ability for users of the library to provide code block
actions for code blocks rendered in markdown (or anything that uses the
TextViewStyle).

I tried to match the existing Fns:
```rs
pub fn heading_font_size<F>(mut self, f: F) -> Self
where
    F: Fn(u8, Pixels) -> Pixels + Send + Sync + 'static,
{
    self.heading_font_size = Some(Arc::new(f));
    self
}
```

New code in text_view:
```rs
pub fn code_block_actions<F, E>(mut self, f: F) -> Self
where
    F: Fn(SharedString, Option<SharedString>, &mut Window, &mut App) -> E
        + Send
        + Sync
        + 'static,
    E: IntoElement,
{
    self.code_block_actions = Some(Arc::new(move |code, lang, window, cx| {
        f(code, lang, window, cx).into_any_element()
    }));
    self
}
```

Example on adding a simple copy button:

```rs
TextView::markdown("preview", content, window, cx)
    .code_block_actions(|code, _lang, _window, _cx| {
        Clipboard::new("copy").value(code)
    })
```


## Screenshot

| Before                       | After                       |
| ---------------------------- | --------------------------- |
| <img width="630" height="527" alt="Screenshot 2025-12-01 at 8 37
50 PM"
src="https://github.com/user-attachments/assets/7ac3b8d9-da85-42f8-9d36-cc74848890ea"
/> | <img width="627" height="535" alt="Screenshot 2025-12-01 at 8 38
22 PM"
src="https://github.com/user-attachments/assets/cae67b43-bba8-4834-a060-4bd63d34aefd"
/> |


## How to Test

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce.

## Checklist

- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-12-03 10:21:47 +00:00
Jason Lee
b70a0633ab dock: Simplify DockItem API. (#1732)
## Break Change

- The `DockItem::tabs` has removed `active_ix` argument, use
`.active_index()` method instead.

```diff
- DockItem::tabs(vec![panel], Some(1), &weak_self, window, cx)
+ DockItem::tabs(vec![panel], &weak_self, window, cx).active_index(1)
```
2025-12-03 17:53:37 +08:00
Floyd Wang
e2f022cb59 divider: Add support for dashed divider (#1730)
## Description

1. Add support for dashed divider.
2. Add divider story.

## Screenshot

<img width="1139" height="859" alt="SCR-20251203-nueg"
src="https://github.com/user-attachments/assets/3f2dafd9-f808-4315-bf58-c0380798eb66"
/>
2025-12-03 16:22:36 +08:00
Floyd Wang
e43662190a Bump v0.5.0-preview2 2025-12-02 17:12:49 +08:00
Jason Lee
8abaa82233 list: Fix list item may overflow. (#1726)
Closes #1692
2025-12-02 13:33:47 +08:00
Jason Lee
64aa975c77 title_bar: Remove window control bg color in normal mode. (#1720)
Fix #1710 introduced bug.
2025-12-01 13:56:15 +00:00
Jason Lee
43e1029b9f dock: Improve Panel trait changed title to return impl IntoElement. (#1719) 2025-12-01 18:13:23 +08:00
Jason Lee
d92e3a3222 dock: Fix title method missed thing in PR #1716 (#1718)
Continue #1716
2025-12-01 18:03:29 +08:00
Jason Lee
4ded78ed30 dock: Refactor Panel trait to has &mut self and &mut Context<Self>. (#1716)
Continue #1712, #1713

## Description

Also change the `Panel` trait to has `&mut self` and `&mut
Context<Self>`.

## Break Changes

The methods `title`, `title_prefix`, `set_zoomed`, `set_active`,
`dropdown_menu`, `toolbar_buttons`, `on_added_to`, `on_removed` has
changed `&self` to `&mut self`, and `cx: &App` to `cx: &mut
Context<Self>`.

```diff
- fn title(&self, window: &Window, cx: &App) -> AnyElement
+ fn title(&mut self, window: &Window, cx: &mut Context<Self>) -> AnyElement
```
2025-12-01 17:57:18 +08:00
Jason Lee
c0f801dd8c list: Refactor ListDelegate to easy access delegate. (#1713)
Continue #1712

## Break Changes

- The argument type of `render_item`, `render_section_header`,
`render_section_footer`, `render_empty`, `render_initial`,
`render_loading` in `ListDelegate` has been changed to has `&mut self`
and `&mut Context<ListState<Self>>`.

```diff
- fn render_item(&self, ix: IndexPath, window: &mut Window, cx: &mut App) -> Option<Self::Item>
+ fn render_item(&mut self, ix: IndexPath, window: &mut Window, cx: &mut Context<ListState<Self>>) -> Option<Self::Item>
```
2025-12-01 17:42:44 +08:00