Commit graph

897 commits

Author SHA1 Message Date
Jason Lee
f82c347e37
title_bar: Fix pl to override default TitleBar left padding. (#944) 2025-06-11 16:52:51 +08:00
Jason Lee
a7505487e1
highlighter: Fix Zig language highlight. (#942)
<img width="1143" alt="image"
src="https://github.com/user-attachments/assets/62f87eb4-1d16-4165-8504-803aadf1b0fe"
/>
2025-06-11 16:18:38 +08:00
Jason Lee
4c0e13bc8d
radio: Add id to RadioGroup to avoid clicks conflict. (#941)
## Break Changes

- The `RadioGroup` now require a `id` to init.

```diff
- RadioGroup::horizontal()
+ RadioGroup::horizontal("group-id-1")
- RadioGroup::vertical()
+ RadioGroup::vertical("group-id-2")
```
2025-06-11 15:45:24 +08:00
Jason Lee
79ff6ba9cc
highlighter: Fix injection language highlight. (#931)
Still have a bit bug for highlight:

<img width="1012" alt="image"
src="https://github.com/user-attachments/assets/7ec39c85-c20c-4231-8752-b2a7a80f5570"
/>
2025-06-11 15:26:27 +08:00
Floyd Wang
c333fd7106
notification: Add support for rendering custom content (#938)
## Break Change
You no longer need to pass a message when creating a new notification.
Instead, use the `message` method.

```diff 
- Notification::new("There was a problem with your request.");
+ Notification::new().message("There was a problem with your request.");
```

<img width="1023" alt="image"
src="https://github.com/user-attachments/assets/4b93f2bb-e130-45d6-974f-8b14efac58a4"
/>
2025-06-10 12:06:02 +08:00
stayhydated
0aceb02302
dropdown: Replace specialized impl From Vec<SharedString> to Vec<T: DropdownItem + Clone> (#935)
Needed for a proc macro i plan to publish when ready
```rs
#[derive(Clone, DropdownItemFtl, EsFluent, EnumIter, EnumString)]
#[fluent(enumerable)]
pub enum PreferedLanguage {
    English,
    French,
    Chinese,
}

#[derive(Clone, DropdownItemFtl, EsFluent, EnumIter, EnumString)]
#[fluent(enumerable)]
pub enum Country {
    UnitedStates,
    France,
    China,
}

#[derive(GpuiForm)]
pub struct User {
    #[gpui_form(component(input))]
    pub username: Option<String>,

    #[gpui_form(component(input))]
    pub email: String,

    #[gpui_form(component(number_input))]
    pub age: Option<u32>,

    #[gpui_form(component(number_input))]
    pub balance: Decimal,

    #[gpui_form(component(check_box))]
    pub subscribe_newsletter: bool,

    #[gpui_form(component(switch))]
    pub enable_notifications: bool,

    #[gpui_form(component(dropdown(searchable)))]
    pub country: Option<Country>,

    #[gpui_form(component(dropdown()))]
    pub preferred_language: PreferedLanguage,

    #[gpui_form(component(calendar))]
    pub birth_date: chrono::NaiveDate,

    #[gpui_form(component(date_picker))]
    pub appointment_date: chrono::NaiveDate,

    #[gpui_form(component(progress))]
    pub completion_percentage: f32,

    #[gpui_form(skip)]
    pub skip_me: bool,
}
```
2025-06-10 10:08:42 +08:00
Jason Lee
a6b9c96a27
title_bar: Fix TitleBar drag area. (#936)
Ref https://github.com/zed-industries/zed/pull/30828 changed new GPUI
API for better details for TitleBar drag area.
2025-06-09 23:09:07 +08:00
Jason Lee
c5201e6de9
input: Revert #929 changed replace_text_in_range result an incorrect cursor pos. (#930) 2025-06-09 19:02:09 +08:00
Jason Lee
d648874860
input: Add cmd-], cmd-[ to indent, outdent text. (#929) 2025-06-09 18:31:14 +08:00
Jason Lee
6aab9d3345
code-editor: Show hover popover for diagnostics. (#924)
<img width="719" alt="image"
src="https://github.com/user-attachments/assets/75fa9737-09e1-4baa-b7ac-304e847005c8"
/>
2025-06-09 16:16:15 +08:00
Jason Lee
c3ec1deb97
code-editor: Update CodeEditor to support external language. (#928)
Add [Navi](https://navi-lang.org) language for example to external
language for CodeEditor.

<img width="864" alt="image"
src="https://github.com/user-attachments/assets/73afa56d-31bd-4867-a9f2-0a8cf790af0f"
/>
2025-06-09 14:27:33 +08:00
Floyd Wang
44ec74f1fb
chart: Draw dashed lines using gpui PathBuilder (#927)
https://github.com/zed-industries/zed/pull/31678
2025-06-09 11:55:32 +08:00
Ylin
01197769df
list: Improve the selection method to support more scenarios (#925) 2025-06-06 19:50:49 +08:00
Jason Lee
d598e58666
tag: Add rounded to Tag and support outline for all variants. (#923)
<img width="1316" alt="image"
src="https://github.com/user-attachments/assets/e06f672d-f311-4dc2-b62a-c1f5cbce6973"
/>
2025-06-06 13:35:24 +08:00
Floyd Wang
e3e00a38b8 Update README 2025-06-06 10:39:00 +08:00
Floyd Wang
936ee27a2c
input: Fix the panic issue in end_of_line (#922) 2025-06-06 10:07:11 +08:00
Jason Lee
74de042b60
popup_menu: Do not dismiss PopupMenu when clicked on a submenu item. (#921) 2025-06-06 09:25:04 +08:00
Jason Lee
a8f5ced4e6
code-editor: Add markers for display diagnostics to CodeEditor. (#920)
Ref:
https://microsoft.github.io/monaco-editor/typedoc/functions/editor.setModelMarkers.html

![image](https://github.com/user-attachments/assets/aad6a813-54a2-43d5-9623-c57a662f7125)
![image](https://github.com/user-attachments/assets/a88b9ac9-293f-4d1e-a525-49bfa0466885)
2025-06-05 23:04:01 +08:00
Floyd Wang
9afe0063a4
plot: Fix incorrect tooltip dot left position (#919) 2025-06-05 16:25:28 +08:00
Floyd Wang
ecfa6b8451
chart: Add decimal feature (#918) 2025-06-05 16:03:20 +08:00
Duane Bester
4477cca969
highlighter: Adding tree-sitter-sequel for SQL support. (#917)
📦 Adding dependency:
[tree-sitter-sequel](https://github.com/derekstride/tree-sitter-sql)

### Previews

<img width="1398" alt="Screenshot 2025-06-04 at 9 27 08 PM"
src="https://github.com/user-attachments/assets/4aee67be-6fb3-4c57-95be-20792639851a"
/>
<img width="1398" alt="Screenshot 2025-06-04 at 9 34 02 PM"
src="https://github.com/user-attachments/assets/730e148f-2bc9-481d-8eea-8110f7884e69"
/>
2025-06-05 11:54:52 +08:00
Floyd Wang
a1bdd50735 story: Reorder story menu 2025-06-04 19:29:32 +08:00
Jason Lee
989e85211a doc: Update README to add features. 2025-06-04 19:26:41 +08:00
Floyd Wang
516c8fada4
chart: Introduce chart (#878)
Add a new component called `plot`. It provides a low-level approach to
data analysis and visualization.
Chart is a collection of ready-to-use chart components built with
`plot`.

| Light | Dark |
| - | - |
| <img width="1712" alt="SCR-20250604-qhxb"
src="https://github.com/user-attachments/assets/bf7ce76e-ab7a-42c2-92e7-17cd135de66f"
/> | <img width="1712" alt="SCR-20250604-qhxr"
src="https://github.com/user-attachments/assets/dd3e44ea-bbb5-41a2-8cce-38b316d7d800"
/> |
2025-06-04 19:22:11 +08:00
Jason Lee
7934e8af31 story: Fix double border in ResizableStory. 2025-06-04 18:11:00 +08:00
Jason Lee
c97cdd7b89
input: Fix line number width, when line number not enable. (#916) 2025-06-03 23:40:21 +08:00
Jason Lee
2b796c94e9
highlighter: Improve performance for large file. (#911)
Still need to improve.

This version can work smooth when the file lines are less than 5000
lines.

> cargo run --release on MacBook Pro, Apple M3 CPU

- Editing at 110 FPS+
- Display at 120 FPS.

<img width="977" alt="image"
src="https://github.com/user-attachments/assets/37958bcb-20d8-486b-8c50-2728d16f971b"
/>
2025-06-03 23:20:33 +08:00
Floyd Wang
dc1d516a30
button: Impl Selectable for the dropdown button (#913)
## Break Change
- Add `is_selected` to the `Selectable` trait; Returns true if the
element is selected.
2025-06-02 14:25:18 +08:00
Jason Lee
901312bc5a
chore: Switch gpui to depends on Zed official. (#912)
Now, GPUI have merged `window_handle` support for all platforms.

- https://github.com/zed-industries/zed/pull/24327
- https://github.com/zed-industries/zed/pull/24545
- https://github.com/zed-industries/zed/pull/28152

It's time to depends on Zed official main branch.
2025-06-02 10:05:45 +08:00
Jason Lee
a4aff404ce
highlighter: Use tree-sitter to highlight code. (#904)
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/4a8e7b93-a7e7-4648-b8da-c5a6e7ede4f9"
/>
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/bfc35845-719f-4c97-bf50-087feb0f6775"
/>
2025-05-29 19:54:52 +08:00
Floyd Wang
838ffe0a79
modal: Display overlay at the correct z-index (#909)
| Before | After |
| - | - |
| <img width="1712" alt="SCR-20250528-ksil"
src="https://github.com/user-attachments/assets/3725f142-0792-478a-ac7e-1a9c5604821a"
/> | <img width="1712" alt="SCR-20250528-krmi"
src="https://github.com/user-attachments/assets/b0fac5db-97b2-4ebd-83e2-94786950185c"
/> |
2025-05-28 11:57:23 +08:00
Floyd Wang
49f1ac511d
form: Add text wrapping support for label (#907) 2025-05-27 19:31:06 +08:00
Jason Lee
bad9506ebb
inspector: Fix Inspector on release build. (#906) 2025-05-27 18:51:57 +08:00
Jason Lee
372c78fac6
input: Fix enter newline position incorrect by #901 change. (#905) 2025-05-27 17:25:54 +08:00
Jason Lee
0389608f59 chore: Update GPUI and fix Edges type chagnes. 2025-05-27 09:54:13 +08:00
Jason Lee
9073818d4e
input: Fix outdent when selection first line is no indent. (#903)
## Before


https://github.com/user-attachments/assets/67f94a09-b01b-43e4-9809-2e876f53a7b7

## After


https://github.com/user-attachments/assets/0ff7fee8-cbbc-4f55-8877-96c7ad07d662
2025-05-26 22:46:26 +08:00
Jason Lee
5419600fcd
input: Fix Input may out of char boundary (#901)
```
byte index 3 is not a char boundary; it is inside '吧' (bytes 1..4) of `L吧2`:    0: <unknown>
```
2025-05-26 22:42:31 +08:00
Jason Lee
1cbbf6ef18
code-editor: Improve CodeEditor to has default themes. (#900) 2025-05-26 18:17:15 +08:00
Floyd Wang
ebe10e20c7
alert: Add support for text wrapping (#899)
<img width="935" alt="image"
src="https://github.com/user-attachments/assets/6eb10c67-5301-4414-af7f-9b4444b77fb6"
/>
2025-05-26 17:09:12 +08:00
Jason Lee
0a9de15d79
input: Change InputState::disabled to as builder method. (#898)
## Break Changes

- The `disabled` method now is for builder method, and `is_disabled` for
get state.

```diff
- pub fn disabled(mut self) -> bool
+ pub fn is_disabled(&self) -> bool
+ pub fn disabled(mut self, disabled: bool) -> Self
```
2025-05-26 17:00:17 +08:00
Jason Lee
1c11b5fb55
inspector: Add Inspector. (#897)
<img width="1434" alt="image"
src="https://github.com/user-attachments/assets/f6ec2e1d-ff1c-4798-90fe-d29bef20fa9d"
/>
2025-05-26 16:44:11 +08:00
Floyd Wang
a1ad647527
number_input: Add support for prefix and suffix (#896)
<img width="1097" alt="image"
src="https://github.com/user-attachments/assets/b4c1fc69-88ad-4ecd-b1c8-1a5a92836e82"
/>
2025-05-26 16:16:22 +08:00
Jason Lee
a95482fdd8
chore: Upgrade GPUI 2025/05/26 with inspector changes. (#895)
https://github.com/zed-industries/zed/pull/31315
2025-05-26 13:40:27 +08:00
Zimo Li
6f28df6a7d
Rename DEVELOPMENT to DEVELOPMENT.md (#894) 2025-05-26 13:35:33 +08:00
Jason Lee
c99e696cb1
code-editor: Update code highlight theme colors. (#888) 2025-05-25 10:21:37 +08:00
Jason Lee
f539817d9b
alert: Add banner mode and on_close to Alert. (#893)
## Break Changes

- The `Alert::new` method change to 2 args, first is `id`.

```diff
- fn new(message: impl Into<Text>) -> Self
+ fn new(id: impl Into<ElementId>, message: impl Into<Text>) -> Self
```

<img width="1120" alt="image"
src="https://github.com/user-attachments/assets/214df737-6129-4a53-8f3b-86e83bc8082b"
/>
2025-05-23 19:20:13 +08:00
Jason Lee
a1e2160083
menu: Fix sub-menu item height to match with other items. (#892) 2025-05-23 17:24:52 +08:00
Jason Lee
8dc9666214
input: Fix cursor and IME popup position when IME typing. (#889)
- Fix cursor position when IME typing.
- Fix selection range when canceled IME typing.
- Fix IME popup position to follow the cursor position.
- Fix IME text to render with underline style.

Close #55

<img width="1231" alt="image"
src="https://github.com/user-attachments/assets/c746703f-23de-4b3b-bd5b-210a8447eeba"
/>
2025-05-23 15:00:24 +08:00
Jason Lee
2c4a28a6da
code-editor: Add current line background. (#887)
https://github.com/user-attachments/assets/3ab6a1b5-648c-4431-91d2-7ebefee2f511
2025-05-22 23:03:53 +08:00
Jason Lee
2d6284694d
code-editor: Fix highlight offset on Windows. (#886)
Again, caused by need `split('\n')` not use `.lines()`.
2025-05-22 22:10:59 +08:00