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
Sunli
591cfc8dab
text_view: Use weak references to the state in async task to avoid memory leaks. ( #1311 )
2025-09-30 15:26:59 +08:00
Sunli
880c019fb8
text_view: Reworks TextView to defer state initialization until first layout. ( #1310 )
2025-09-30 13:50:27 +08:00
Jason Lee
d5ae887cbb
editor: Fix hover definition to immediately hide when move out. ( #1309 )
2025-09-30 11:29:59 +08:00
Jason Lee
f92944546f
chore: Disable tab stop for some popover elements. ( #1306 )
2025-09-29 18:11:25 +08:00
Jason Lee
03cf48a783
input: Avoid scroll on select all. ( #1305 )
2025-09-29 17:49:59 +08:00
Jason Lee
6028de3b5a
editor: Input enter to get next indent level performance. ( #1304 )
...
Now we can handle about 1M lines.
https://github.com/user-attachments/assets/cb55cd18-6755-40cd-a5b0-3d0f865d12e1
2025-09-29 17:35:58 +08:00
Jason Lee
aca03d47c0
input: Fix Input to unselect on blur. ( #1303 )
2025-09-29 17:29:11 +08:00
Jason Lee
5e504d10bb
chore: Refactor tab key to switch focus. ( #991 )
...
Wait https://github.com/zed-industries/zed/pull/33008 ,
https://github.com/zed-industries/zed/pull/34804 to merge.
https://github.com/user-attachments/assets/3c21ebc9-44a0-4311-bb0f-5f63fe8d4bb3
- Improved `focus_ring` to render like an outline.
- Added to support press `Enter`, `Space` key to trigger Checkbox,
Button, Radio.
## Break Changes
- The `FocusableExt` has been changed to only for crate internal.
- The `FocusableCycle` has been removed, now GPUI has it own tab stop
implementation.
2025-09-29 16:48:24 +08:00
Copilot
ed05c3ebec
chore: Remove Wef code as it has been extracted to separate repository ( #1302 )
...
All WEF (Web Embedding Framework) related code has been successfully
removed from the repository as it has been extracted to
https://github.com/longbridge/wef
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-09-29 15:31:58 +08:00
Sunli
b8651515f0
chore: Remove unnecessary RefCell ( #1301 )
2025-09-29 14:39:04 +08:00
Sunli
34b570cd8f
text_view: Refactor TextView, SyntaxHighlighter to use async to parsing. ( #1299 )
...
1. Parse content in the background thread
2. Remove unnecessary clones
3. `TextViewStyle` and `LanguageRegistry` can now be used across threads
2025-09-29 14:04:24 +08:00
Sunli
3413c33d1c
chore: use async-wry ( #1300 )
2025-09-29 13:32:12 +08:00
Jason Lee
3ee8d7ffd2
input: Fix input mark text render. ( #1298 )
...
Fix #1293 change broken the input mask render (password mask,
placeholder ...)
2025-09-29 10:40:39 +08:00
Jason Lee
172015f147
input: Use shape line for soft wrap lines. ( #1293 )
...
This change aim to fix the before version `shape_text` (in Element
paint) and `wrap_line` (in TextWrapper cached soft wrap map) may have
difference wrap width.
Now move to based on TextWrapper's wrap map to paint text by use
`shape_line` method.
2025-09-28 10:31:03 +08:00
Jason Lee
4983300ddf
input: Update RopeExt to use LF style for get correct line when have \r. ( #1296 )
2025-09-28 01:04:14 +08:00
Jason Lee
328da4da21
input: Fix RopeExt replace method may not on a char boundary. ( #1295 )
2025-09-26 22:27:44 +08:00
Jason Lee
13e2b08873
editor: Improve line number width by max lines. ( #1291 )
2025-09-25 22:21:09 +08:00
Jason Lee
6b7a481fc8
editor: Improve TextWrapper performance. ( #1292 )
2025-09-25 20:02:17 +08:00
Jason Lee
9f1423324a
editor: Improve slice_line method performance. ( #1290 )
...
Now we can handle more than 200K lines (before is 150K).
2025-09-25 18:54:06 +08:00
Jason Lee
ef1d727c3d
chore: Improve RopeExt API and add more docs. ( #1289 )
2025-09-25 18:17:46 +08:00
Jason Lee
512f46aec8
text_view: Add to support custom code block style. ( #1288 )
...
And remove bg, padding for editor hover code blocks.
<img width="589" height="214" alt="image"
src="https://github.com/user-attachments/assets/55870f2f-e49e-4c2d-8899-9aa7edd17630 "
/>
2025-09-25 17:11:14 +08:00
Jason Lee
a6a14fd57b
input: Disable context menu item for disabled input. ( #1280 )
2025-09-25 16:36:57 +08:00
Jason Lee
16105da122
editor: Avoid trigger hover on selection. ( #1287 )
2025-09-25 15:50:12 +08:00
Jason Lee
8f5bff61fb
chore: Fix sum_tree API changes. ( #1286 )
...
https://github.com/zed-industries/zed/pull/38776
2025-09-25 10:41:37 +08:00
Jason Lee
5aaf8c6a66
input: Fix move cursor to scroll x to viewport. ( #1285 )
2025-09-24 21:15:13 +08:00
Jason Lee
1c3eca93b8
editor: Revert to use ropey. ( #1284 )
...
For the License reason.
- The performance is slow down, before version can handle 200K lines,
now 150K lines is good.
2025-09-24 20:52:18 +08:00
Jason Lee
ca8d595936
editor: Fix line number to use same editor background. ( #1282 )
2025-09-24 14:14:32 +08:00
Jason Lee
bd3bffaf67
editor: Fix completion width align to longest item. ( #1281 )
2025-09-24 11:43:59 +08:00
Jason Lee
bf5650b5db
input: Add context menu for cut, copy, paste. ( #1279 )
...
Close #27
<img width="756" height="674" alt="image"
src="https://github.com/user-attachments/assets/07884a7e-366b-47b8-8bd7-a88f3cae52b8 "
/>
2025-09-23 22:06:58 +08:00
Jason Lee
993ce34bd8
editor: Avoid scroll on select all. ( #1277 )
...
- Add `replace_text_in_range_silent` for some case to avoid show
completion, for example on cut, paster ...
- Improve to only call validation, mask on single line mode.
- Improve move cursor to scroll to visible to keep edge 3 lines.
https://github.com/user-attachments/assets/ca8bcca8-a55b-4c98-af7c-7639d1c34923
- Fix `RopeExt::offset_to_position` may crash.
- Add deffered_scroll_offset to improve paste to scroll to cursor.
https://github.com/user-attachments/assets/1af09a50-37f0-47c8-8185-4b78820d064a
2025-09-23 15:59:48 +08:00
Floyd Wang
4b3731bf14
divider: Remove the horizontal divider full width style ( #1278 )
2025-09-23 13:46:35 +08:00
Jason Lee
d4f51f3135
theme: Fix Ayu theme. ( #1276 )
...
<img width="1115" height="940" alt="image"
src="https://github.com/user-attachments/assets/cce54665-a9b5-446b-aaef-447ed7265c27 "
/>
2025-09-23 11:16:26 +08:00
Jason Lee
9febc52387
kbd: Fix byte slice crash. ( #1275 )
2025-09-23 09:47:32 +08:00
Jason Lee
455605d64b
menu: Fix to support keyboard to select menu items. ( #1263 )
...
- And add to support scroll to selected item.
---------
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2025-09-22 21:47:30 +08:00
Jason Lee
c80704d4d8
input: Fix invalid vertical scroll in single line mode. ( #1273 )
2025-09-22 19:47:47 +08:00
Jason Lee
62e3f8126a
inspector: Add to support auto complete. ( #1272 )
...
<img width="1273" height="1138" alt="image"
src="https://github.com/user-attachments/assets/52a474c3-b936-468e-b56d-e3f0a4e3104d "
/>
2025-09-22 18:36:46 +08:00
Jason Lee
f93e9a9475
editor: Change to pass cursor as offset for completions method. ( #1271 )
...
And to support `filter_text` as completion item highlight match.
2025-09-22 16:29:51 +08:00
Jason Lee
62748aad9b
editor: Update CompletionProvider return type. ( #1270 )
2025-09-22 14:31:21 +08:00
Jason Lee
aa0f6d6222
editor: Improve range_to_utf16 and range_from_utf16 by use Rope. ( #1268 )
...
Now, we can work on 200K lines (editing).
--------
Now, all cost are on tree-sitter parse.
<img width="1091" height="672" alt="image"
src="https://github.com/user-attachments/assets/b111bc58-1334-40b2-9920-7006ad86bb3c "
/>
2025-09-22 14:07:30 +08:00
Jason Lee
692057f799
editor: Update completions to support CompletionTextEdit. ( #1267 )
...
- Fix completion menu width to longest item.
2025-09-22 11:39:50 +08:00
Jason Lee
13fa76e00d
editor: Improve TextWrapper performance by only rebuild changed lines. ( #1266 )
...
Continue #1220
Now, we can support editing on 100K lines (release mode).
https://github.com/user-attachments/assets/2daccc85-c713-4ddf-b08d-840cb1bb2643
2025-09-20 02:35:48 +08:00
Jason Lee
7e9606369e
editor: Improve line number to use shape_line method. ( #1265 )
2025-09-19 19:23:57 +08:00
Floyd Wang
d3d2a9ee49
chore: Remove gpui test-support feature
2025-09-19 17:38:42 +08:00
Jason Lee
299e5ed5fc
input: Fix possible IME input crash. ( #1264 )
2025-09-19 17:33:18 +08:00
Floyd Wang
c385da56c1
plot(shape): Add multi-label support for Bar ( #1262 )
...
## Breaking Change
```diff
- bar.label(move |_, point| Text::new("foo", point, "#red"));
+ bar.label(move |_, point| vec![Text::new("foo", point, "#red")]);
```
Add support for multiple labels on a single bar.
2025-09-19 14:13:51 +08:00
Jason Lee
5e7a2cb37f
editor: Add DefinitionProvider. ( #1261 )
...
https://github.com/user-attachments/assets/f8234a3f-3075-48ce-ae46-8ea869b6a13d
- Hold `cmd` to hover on a word to trigger definition check.
2025-09-19 13:49:24 +08:00
Jason Lee
6a817d6a05
editor: Add to support HoverPopover. ( #1260 )
...
<img width="725" height="631" alt="image"
src="https://github.com/user-attachments/assets/0f4aba90-82cc-43c8-916b-b4a446b8abae "
/>
2025-09-18 18:18:54 +08:00
Jason Lee
51efa766ea
editor: Improve search to select first match in visible range. ( #1258 )
2025-09-18 16:07:35 +08:00
Jason Lee
a942c57627
editor: Refactor the LSP config.
2025-09-18 14:17:18 +08:00
Jason Lee
3fe9bc8de0
example: Fix lint performance in CodeEditor example. ( #1259 )
...
Move AutoCorrect lint to background.
2025-09-18 11:25:53 +08:00
Jason Lee
8a3ef51ea1
input: Add to support search and replace. ( #1252 )
...
<img width="806" height="765" alt="image"
src="https://github.com/user-attachments/assets/5e2a7144-f814-4874-b9c1-89ebf5d942ec "
/>
- Close #1212 to support search for Input.
- Fix #1235 to support scroll to cursor when go to line.
2025-09-17 19:02:00 +08:00
Jason Lee
e01b139995
input: Fix completions API to assign Rope.
2025-09-17 14:37:21 +08:00
Jason Lee
478db2785a
input: Keep more empty space at top or bottom of the Editor. ( #1256 )
...
<img width="727" height="586" alt="image"
src="https://github.com/user-attachments/assets/2eb27326-831c-40fc-b0c8-48e6ab6ac67f "
/>
- Fix to keep 3 lines on top when move vertical.
- Improve to keep 1 line edge for cursor, when editor is too small.
2025-09-17 10:45:56 +08:00
Jason Lee
35568124bf
editor: Improve CodeEditor inset and line number width. ( #1255 )
...
<img width="756" height="580" alt="image"
src="https://github.com/user-attachments/assets/5748e7b3-74de-417a-856f-5db05c66f892 "
/>
2025-09-16 21:50:09 +08:00
Jason Lee
3c39641486
group_box: Fix incorrect h_full in GroupBox. ( #1253 )
...
Also fix the notifications example.
2025-09-16 21:23:29 +08:00
Floyd Wang
5ddaa9f5aa
form: Add col_start and col_end for the fields ( #1251 )
...
* Continue https://github.com/longbridge/gpui-component/pull/1250
2025-09-16 20:30:45 +08:00
Floyd Wang
731ab958f8
form: Add support for multi-column layout ( #1250 )
...
| Vertical | Horizontal |
| - | - |
| <img width="1642" height="1106" alt="SCR-20250916-nnry"
src="https://github.com/user-attachments/assets/279eb192-c660-449e-931e-1d7ff79ac69f "
/> | <img width="1642" height="1106" alt="image"
src="https://github.com/user-attachments/assets/289a6672-d82d-4f6f-a267-592874ccbe42 "
/> |
2025-09-16 16:28:43 +08:00
Jason Lee
717c83957d
input: Use position for preferred column for vertical move. ( #1249 )
...
For better support for non-monospaced font
2025-09-16 11:52:51 +08:00
Jason Lee
aab1321b70
input: Refactor InputEvent::Change to not include the text. ( #1246 )
...
Change this to avoid Rope `to_string` performance cost. Ref #1220
The listeners of `InputEvent::Change` may not be going to use entire of
text.
## Break Change
- The `InputEvent::Change(SharedString)` removed value.
```diff
- pub enum InputEvent {
- Change(SharedString),
+ pub enum InputEvent {
+ Change,
```
2025-09-15 20:50:30 +08:00
Jason Lee
f1b6d7c5ed
editor: Add completion, code_action provider. ( #1242 )
2025-09-15 19:25:02 +08:00
Floyd Wang
b34d8b6716
label: Add HighlightsMatch to support prefix matching ( #1243 )
...
| Mode | |
| - | - |
| Full | <img width="480" alt="SCR-20250912-ptai"
src="https://github.com/user-attachments/assets/fbaaec1c-c376-42a0-a88c-18fc21a24ac3 "
/> |
| Prefix | <img width="480" alt="SCR-20250912-ptbv"
src="https://github.com/user-attachments/assets/f68ca47f-7ad2-4214-b132-bf5abbc92764 "
/> |
| | <img width="480" alt="SCR-20250912-ptef"
src="https://github.com/user-attachments/assets/1a3807cb-d2e4-4ed0-ab0b-d375deae1359 "
/> |
2025-09-12 18:35:55 +08:00
Cookie
feabb748ec
calendar: Fixed cross year name and multi month linkage click issues ( #1241 )
...
<img width="864" height="298" alt="image"
src="https://github.com/user-attachments/assets/7f0a34d7-e000-4756-b1ae-0e6511679660 "
/>
2025-09-12 10:29:07 +08:00
Jason Lee
da85754b96
input: Refactor diagnostics. ( #1240 )
...
<img width="613" height="530" alt="image"
src="https://github.com/user-attachments/assets/be86658d-706c-411c-8ba6-09b495208051 "
/>
## Break Changes
- The `Markers` has been renamed to use `Diagnostics`.
- The `input::LineNumber` has renamed to `input::Position` and changed
from 1-based to use 0-based.
- Renamed `go_to_line` to `set_cursor_position`, `line_column` to
`cursor_position`.
```diff
- pub fn line_column(&self) -> LineColumn
+ pub fn cursor_position(&self) -> Position
- pub fn go_to_line(&mut self, line: usize, column: Option<usize>, window: &mut Window, cx: &mut Context<Self>)
+ pub fn set_cursor_position(&mut self, position: impl Into<Position>, window: &mut Window, cx: &mut Context<Self>)
```
2025-09-11 16:54:40 +08:00
Jason Lee
3fa996c331
input: Fix line column by use chars offset. ( #1239 )
...
- Add autocorrect to markdown example for test `markers`.
<img width="1104" height="590" alt="image"
src="https://github.com/user-attachments/assets/03103088-e828-4039-82b0-c816d5f36141 "
/>
2025-09-10 20:56:15 +08:00
Jason Lee
2a918bf4de
input: Improve TextWrapper data structure. ( #1237 )
2025-09-10 18:52:35 +08:00
Jason Lee
db5ba1e04c
input: Fix horizontal scroll to match the longest line width. ( #1238 )
...
Close #1234
2025-09-10 18:17:15 +08:00
Jason Lee
5beaed2a9e
input: Pause blink and keep show cursor on moving or editing. ( #1236 )
...
https://github.com/user-attachments/assets/751d0b62-18f9-41c8-80a0-e11439e3b91e
2025-09-10 14:49:14 +08:00
Jason Lee
43c848893c
input: Refactor start_of_line, end_of_line by use Rope. ( #1232 )
...
- Removed `Cursor` struct, now use `usize` for selection offset.
2025-09-10 14:43:11 +08:00
Jason Lee
844574befc
input: Fix track scroll to selected end on drag move. ( #1231 )
2025-09-10 13:59:02 +08:00
Jason Lee
7998d64501
highlighter: Improve Syntax Highlighter performance. ( #1230 )
...
Now can support up to 50K lines with code highlight.
https://github.com/user-attachments/assets/3bbba2cd-ea56-4778-b471-6beea323fbaa
----
Ref Links
- https://zed.dev/blog/syntax-aware-editing
2025-09-10 00:11:53 +08:00
Floyd Wang
ab98e53a5a
plot(tooltip): Fix the dots not centered ( #1229 )
2025-09-09 18:01:01 +08:00
Floyd Wang
51caf932db
plot(tooltip): Add support for custom appearance ( #1226 )
2025-09-09 14:47:07 +08:00
Jason Lee
03c2327cdb
input: Improve Input performance by only shape visible lines. ( #1222 )
...
Close #1193
Ref issue #1220
This PR aim to shape text in visible ranges to reduce `shape_text` time
for large document case.
- Fix rendering might be delayed and cause blanks when scrolling to
follow the selection.
- Fix `RopeExt::lines` method to avoid call `line` method on skipped
iter.
2025-09-09 14:41:52 +08:00
Floyd Wang
84b2d2a6f5
plot(scale): Add least index support for linear ( #1225 )
2025-09-09 11:40:09 +08:00
Jason Lee
d71a32d0e4
input: Fix move to to skip \r on Windows. ( #1223 )
...
This PR for continue #1214 to fix move cursor to ignore` `\r` for
Windows.
2025-09-09 09:40:07 +08:00
Jason Lee
a9953a9349
input: Use zed's Rope ( #1214 )
...
Now with 10K lines plain text, in release mode on macOS. The
`large-text` example can work with:
- 120 FPS for display.
- 90 FPS for update text.
```
MTL_HUD_ENABLED=1 cargo run --example large-text --release
```
- Fixed the cursor position at end of line, also support at start of
line.
https://github.com/user-attachments/assets/1de52f6c-e138-4ed3-a600-06372a807ed8
### Check list
- [x] Modifying Text with Rope
- [x] LineColumn, GoToLine
- [x] Code Highlight
- [x] Delete word, select word
- [x] Delete line
- [x] Move left, right, up, down
2025-09-08 16:44:52 +08:00
Jason Lee
a9e6b49a15
highlighter: Fix #1204 changes cause to incorrect highlight result. ( #1218 )
...
This PR for fix some incorrect changes in #1204
## Before
<img width="854" height="864" alt="image"
src="https://github.com/user-attachments/assets/eebd07e5-3437-444d-a55d-2941228e3b08 "
/>
## After
<img width="954" height="962" alt="image"
src="https://github.com/user-attachments/assets/60761848-8d4f-4fe9-88b9-f0b0f0985d2f "
/>
<img width="1515" height="867" alt="image"
src="https://github.com/user-attachments/assets/3d4654a7-f977-4919-9c9e-f013fcdd8fde "
/>
2025-09-08 16:14:07 +08:00
Floyd Wang
78dccd4d79
plot: Apply linear scale based on the direction of given range ( #1219 )
...
## Breaking Change
- Apply linear scale based on the direction of given range.
```diff
- ScaleLinear::new(vec![1., 2., 3.], vec![0., 100.])
+ ScaleLinear::new(vec![1., 2., 3.], vec![100., 0.])
```
Currently, you can draw the linear scale from minimum to maximum or from
maximum to minimum; it depends on the direction of the range.
2025-09-08 15:56:58 +08:00
Floyd Wang
5e302866ce
inspector: Improve UI details ( #1217 )
2025-09-08 13:29:54 +08:00
Floyd Wang
00dd457441
drawer: Ensure the drawer’s height matches the application ( #1216 )
2025-09-08 10:36:13 +08:00
Jason Lee
f35398d797
input: Fix some Rope method call will crash. ( #1213 )
2025-09-05 19:09:46 +08:00
Jason Lee
cfc2449820
input: Fix column position update when text added, to support move vertical keep column. ( #1211 )
...
Refactor this logic by use Rope line, column.
2025-09-05 18:47:24 +08:00
Jason Lee
344e4407ff
input: Use Rope for InputState. ( #1208 )
...
This PR to change the Input to use
[ropey](https://github.com/cessen/ropey ) to store the text.
## Break Changes
- The `value` method of `InputState` now returns a `SharedString` type.
```diff
- pub fn value(&self) -> &SharedString
+ pub fn value(&self) -> SharedString
```
Ref links:
- https://github.com/cessen/ropey
- https://zed.dev/blog/zed-decoded-rope-sumtree
- https://github.com/helix-editor/helix/blob/master/docs/architecture.md
2025-09-05 18:20:47 +08:00
Floyd Wang
19be9b8d96
inspector: Trim the diagnostic error at the end ( #1210 )
2025-09-05 15:21:25 +08:00
Chuqiao Feng
c6f6a9bb09
inspector: Fix Rust parser of inspector. ( #1209 )
...
This PR aims to fix a bug of the Rust parser in my last PR #1205 .
2025-09-05 15:08:05 +08:00
Chuqiao Feng
8992852165
inspector: Add live editor to inspector ( #1205 )
...
Inspired by Zed, this PR implements a simple live Rust and JSON style
editor for the inspector.
The rust style editor only supports `Styled` and `StyledExt` method
calls with no arguments.
https://github.com/user-attachments/assets/df7f1746-92d7-416c-afd5-e389ac3ea9ae
---------
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2025-09-05 11:58:36 +08:00
Jason Lee
16f9380a63
highlighter: Fix some tokens were highlighted incorrectly ( #1204 )
...
Continue #1198
## Before
<img width="1322" height="1043" alt="image"
src="https://github.com/user-attachments/assets/85bedde2-cb24-4eed-be9c-64b7d5627f7c "
/>
## After
<img width="1056" height="1098" alt="image"
src="https://github.com/user-attachments/assets/2b65bd45-c24d-425e-b4ec-0e4408a3f6a4 "
/>
2025-09-05 11:21:06 +08:00
Jason Lee
ee40f65fb5
markdown: Add to support LinkReference and Footnote. ( #1201 )
2025-09-03 16:39:17 +08:00
Jason Lee
2cfb5d24a9
highlighter: Use sum_tree to store the highlight cache. ( #1198 )
2025-09-03 14:09:46 +08:00
Jason Lee
189bd6e9a3
highlighter: Fix some editing operatons might result incorrect hightlight. ( #1197 )
...
This PR just removed the partial update highlight cache code. This logic
will get incorrect offset.
To make sure highlight correct first.
Remove this will slow down performance (On editing), when is more than
5K lines, but if less than this the performance can accept.
2025-09-02 18:52:02 +08:00
Jason Lee
02b432ed17
scrollbar: Fix scrollbar width on always show mode. ( #1196 )
...
And fixes #1192 render bug.
2025-09-02 15:48:06 +08:00
Jason Lee
6569bead8b
input: Fix horizontal scrolling offset. ( #1191 )
...
Continue #1131 to fix some scroll offset details.
- Keep line number at left.
- Show scrollbar next the line_numbers right side.
- Fix scroll_size calculate issue that will always show vertical
scrollbar, even not have enough contents.
<img width="888" height="641" alt="image"
src="https://github.com/user-attachments/assets/5d388377-3f6d-4530-b837-6c719e1eb48f "
/>
2025-09-02 14:46:28 +08:00
iincity
ca548bd856
input: Add to support horizontal scrolling to multi-line text. ( #1131 )
...
- Add `soft_wrap` option to build InputState, default true.
<img width="1156" height="1166" alt="image"
src="https://github.com/user-attachments/assets/2eab2db0-b3fc-48ce-83cb-1d6715313247 "
/>
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-09-01 12:33:21 +08:00
Jason Lee
34d2a75894
theme: Add theme_name to get current active theme name. ( #1190 )
...
And fix theme menu selected item in example when theme mode changed.
2025-09-01 11:39:01 +08:00
Jason Lee
785df6a5ff
chore: Remove SvgImg element. ( #1187 )
...
## Break Change
- The `SvgImg` element has been removed.
This is a special implementation and should not be included in the GPUI
Component.
2025-08-29 17:37:11 +08:00
Floyd Wang
7fb6000189
plot(scale): Correct the least index ( #1186 )
2025-08-29 16:42:59 +08:00
Floyd Wang
1267857a8c
plot(scale): Point scale support single point ( #1185 )
...
<img width="447" height="446" alt="image"
src="https://github.com/user-attachments/assets/fff44252-ff5b-4d73-8b98-0eb4c0877563 "
/>
2025-08-29 15:05:51 +08:00
Jason Lee
709a888e15
accordion: Fix Accordion hover background. ( #1184 )
...
- Improved `accordion.hover` theme color default fallback to `accent`.
- Fix incorrect Accordion border top radius on hover.
- Removed unused `accordion.active.background` theme variable.
<img width="1106" height="799" alt="image"
src="https://github.com/user-attachments/assets/3b1d3e56-7e77-4118-ac3c-231c6571940a "
/>
2025-08-29 11:51:32 +08:00
Floyd Wang
f98ad5232b
table: Fix ESC event not propagating to modal with selection ( #1183 )
2025-08-29 10:52:30 +08:00
Jason Lee
74b3aa7e67
text_view: Add to support selection. ( #1169 )
...
### Links
Maybe we can do it in TextLayout in GPUI:
fda6eda3c2/crates/gpui/src/elements/text.rs (L309)
## Demo
https://github.com/user-attachments/assets/abbebee7-df8f-4067-86a7-15bc1a4c44cd
## Todo
- [x] Test for HTML View.
- [x] CodeBlock selection support.
- [x] Selection lines sometimes incorrect.
- [x] Listener Bounds changed to unselect.
2025-08-28 18:09:30 +08:00
Floyd Wang
4715a5a2dc
table: Fix the border render issue on stripe table ( #1179 )
...
| Before | After |
| - | - |
| <img width="426" height="134" alt="SCR-20250828-pail"
src="https://github.com/user-attachments/assets/1c5f8aa7-a55e-4a8f-a6db-1010303586d1 "
/> | <img width="424" height="125" alt="SCR-20250828-paev"
src="https://github.com/user-attachments/assets/dc9950f5-c1a8-4b06-847a-eedb0cd67f60 "
/>
2025-08-28 17:16:35 +08:00
Floyd Wang
bafc9fed12
table: Refine the row style ( #1178 )
...
Better solution for #1177 .
2025-08-28 11:11:36 +08:00
Floyd Wang
f72e858d3a
table: Render custom row background first on striped table ( #1177 )
2025-08-28 10:44:10 +08:00
Floyd Wang
2a652dcc01
chore: Bump gpui & wireup Keystroke changes ( #1176 )
2025-08-27 17:44:10 +08:00
Jason Lee
5b6f2dc26e
alert: Fix the icon position and let all size use same text size. ( #1175 )
...
<img width="1270" height="1286" alt="image"
src="https://github.com/user-attachments/assets/08c485bf-daac-4490-8fca-1dd2f0efa396 "
/>
<img width="1270" height="1286" alt="image"
src="https://github.com/user-attachments/assets/71bb1a59-0669-4102-8529-df81435fcb7d "
/>
<img width="1270" height="1286" alt="image"
src="https://github.com/user-attachments/assets/1ebd6095-4bd8-47e8-88a2-fdd470c47344 "
/>
<img width="1270" height="1286" alt="image"
src="https://github.com/user-attachments/assets/71bb1a59-0669-4102-8529-df81435fcb7d "
/>
2025-08-27 11:06:31 +08:00
Remco Smits
e1c354916a
markdown: Fix that style attribute values are extracted correctly from img element ( #1171 )
...
This PR fixes an issue with parsing the styles attribute values. The
main issue it fixes is that we tried splitting on `:` twice which we
should only do once.
Before this change see the following variable values:
decl="width: 10px"
rule=["width", "10px"] (each iteration one value)
And for each rule value we tried splitting again on `:` which is wrong
we should only do this once.
2025-08-25 09:28:26 +08:00
Jason Lee
09ab49b2d3
tab: Fix segmented and underline tab style details. ( #1168 )
2025-08-21 20:04:50 +08:00
Jason Lee
4e5aca3842
group_box: Update GroupBox style. ( #1167 )
...
- Removed padding x of the Group Title.
- Added `fill` variant and change default to use no background and
paddings style.
<img width="1120" height="1337" alt="image"
src="https://github.com/user-attachments/assets/958e902f-3481-424c-a923-62746175aabf "
/>
2025-08-21 18:17:58 +08:00
Jason Lee
554082b969
text_view: Fix inline image render. ( #1166 )
...
GPUI does not support inline image into an `InteractiveText` yet. So
here, let it render into a block line.
<img width="1201" height="902" alt="image"
src="https://github.com/user-attachments/assets/797baeae-8764-417a-a907-e0d22956bf62 "
/>
<img width="1064" height="805" alt="image"
src="https://github.com/user-attachments/assets/a5ef7000-aa71-4c1b-8a82-2a0f36649fd6 "
/>
2025-08-21 16:30:58 +08:00
Jason Lee
8ed135d41a
Revert "modal: Avoid background color with alpha." ( #1165 )
...
Reverts longbridge/gpui-component#1154
By #1162 changes, this is not needed anymore.
2025-08-21 10:53:04 +08:00
Jason Lee
c4c948b177
theme: Fix reload theme to keep last selected. ( #1164 )
2025-08-20 17:33:12 +08:00
Jason Lee
eb5fa06809
theme: Use more lighter group_box fallback color. ( #1163 )
2025-08-20 17:19:10 +08:00
Jason Lee
396c8dbe63
theme: Improve theme color fallback to use blend to avoid alpha. ( #1162 )
...
Also updated the themes colors to match this default rule.
2025-08-20 16:37:46 +08:00
Floyd Wang
9b3900b6cf
plot: Fix the full circle cannot be drawn ( #1161 )
2025-08-20 16:01:15 +08:00
Jason Lee
1bbc4b9f23
list: Fix List scroll to item by use deferred. ( #1160 )
2025-08-20 13:42:25 +08:00
Jason Lee
8ae4ffbb0c
dropdown: Fix dropdown menu width align to input width. ( #1159 )
...
This caused by the `bounds` of `canvas` prepaint callback now is not
including the border widths.
## Before
<img width="1070" height="967" alt="image"
src="https://github.com/user-attachments/assets/9ad963bb-c2b0-4b21-bbd6-8e961f779d2f "
/>
## After
<img width="1229" height="1097" alt="image"
src="https://github.com/user-attachments/assets/568f71be-932f-4126-b37a-b92aea3bf88a "
/>
2025-08-20 11:36:42 +08:00
Jason Lee
e29418e9e4
list: Fix List scroll_to_item position. ( #1158 )
2025-08-20 11:30:14 +08:00
Jason Lee
fb41e63ea8
input: Fix visible range when multi-line text have soft wrap. ( #1155 )
...
## Before
<img width="1130" height="783" alt="image"
src="https://github.com/user-attachments/assets/3e0db5f4-bb84-480f-8b38-dbe24e6c6214 "
/>
## After
https://github.com/user-attachments/assets/fdaed71e-3ab8-4258-a1eb-b731181ca31c
2025-08-19 19:21:12 +08:00
Floyd Wang
7fc1544a10
virtual_list: Do not trigger scrolling if content is smaller than container ( #1156 )
2025-08-19 19:18:38 +08:00
Jason Lee
fc764d8e96
modal: Avoid background color with alpha. ( #1154 )
2025-08-19 14:10:32 +08:00
Jason Lee
8e525c6c99
modal: Improve paddings and gap in Modal. ( #1153 )
2025-08-19 11:41:12 +08:00
Jason Lee
6ae7558c44
theme: Add ThemeRegistry to load and watch themes dir. ( #1148 )
2025-08-18 19:29:27 +08:00
Jason Lee
dcca730d65
group_box: Add GroupBox element. ( #1146 )
...
Close #1144
## Break Changes
- Renamed used theme variable `card`, `card_foreground` to `group_box`,
`group_box_foreground` for GroupBox.
<img width="1088" height="958" alt="image"
src="https://github.com/user-attachments/assets/adb1cbe6-fd6f-4d22-a434-39455f57ce09 "
/>
2025-08-18 11:36:07 +08:00
Floyd Wang
566f5b0d4d
fixup! plot: Fix the point scale cannot selecting the last point ( #1143 )
2025-08-15 17:23:42 +08:00
Floyd Wang
4c545165eb
plot: Fix the point scale cannot selecting the last point ( #1143 )
2025-08-15 17:09:41 +08:00
Floyd Wang
d559b56fb0
plot: Improve the band scale least_index ( #1141 )
2025-08-15 11:23:11 +08:00
Jason Lee
406bf8d929
chore: Fork html5minify for HTML render. ( #1140 )
...
Continue #1137
Forked html5minify to improve:
- Resolve `\n` not replaced issue, now no need Regexp to replace.
- Resolve the difference version of html5ever dependency.
2025-08-15 11:10:23 +08:00
Jason Lee
31fbec5393
story: Fix list group color in story. ( #1139 )
2025-08-15 10:28:00 +08:00
Jason Lee
eaeabdb0ef
scrollbar: Remove max_fps method. ( #1138 )
2025-08-15 10:17:07 +08:00
Jason Lee
899fbd693a
chore: Use html5minify instead of minify-html. ( #1137 )
...
Ref #1132
This change to reduce release mode binary size from 21MB to 12MB.
## HTML Render example
<img width="1712" height="1312" alt="image"
src="https://github.com/user-attachments/assets/f07c02c9-1b0e-4aa4-b81a-d2b0ac4f7260 "
/>
2025-08-15 09:52:38 +08:00
Jason Lee
9a389224f3
chore: Update GPUI and other crates. ( #1136 )
2025-08-14 19:57:53 +08:00
Jason Lee
63f61dca04
chore: Avoid built-in tree-sitter languages in default. ( #1135 )
...
With a `tree-sitter-languages` feature to enable it (Default not
enable).
Changed this for reduce the application size (From 52 MB to 22MB), Ref
#1132
Now default only includes `tree-sitter-json`, if you want more:
```toml
[dependencies]
gpui-component = { features = ["tree-sitter-languages"] }
```
---
```
cargo bloat -p hello_world --release -n 10
Finished `release` profile [optimized] target(s) in 0.27s
Analyzing target/release/hello_world
File .text Size Crate Name
0.4% 1.4% 88.5KiB simple_minify_html simple_minify_html::code_gen::attrs::ATTRS::{{closure}}
0.3% 1.0% 62.1KiB taffy taffy::compute::grid::track_sizing::resolve_intrinsic_track_sizes
0.1% 0.5% 32.6KiB gpui_component gpui_component::theme::theme_color::ThemeColor::dark
0.1% 0.5% 30.0KiB gpui_component gpui_component::theme::theme_color::ThemeColor::light
0.1% 0.5% 29.9KiB html5ever html5ever::tree_builder::TreeBuilder<Handle,Sink>::step
0.1% 0.4% 27.2KiB gpui taffy::compute::flexbox::compute_flexbox_layout
0.1% 0.4% 23.3KiB usvg usvg::text::layout::layout_text
0.1% 0.4% 22.5KiB resvg resvg::filter::apply_inner
0.1% 0.3% 21.4KiB gpui jpeg_decoder::decoder::Decoder<R>::decode_internal
0.1% 0.3% 21.2KiB image_webp image_webp::lossless::LosslessDecoder<R>::decode_image_stream
25.3% 94.3% 5.7MiB And 14091 smaller methods. Use -n N to show more.
26.8% 100.0% 6.0MiB .text section size, the file size is 22.4MiB
```
2025-08-14 18:02:27 +08:00
Jason Lee
a73273a0f1
text_view: Use simple-minify-html instead of minify-html. ( #1134 )
...
To avoid depends on lightningcss, this is a heavy crate.
Ref #1132
```
cargo bloat --release -n 200 --crates
Finished `release` profile [optimized] target(s) in 0.30s
Analyzing target/release/story
File .text Size Crate
4.6% 16.9% 3.4MiB lightningcss
```
2025-08-14 13:54:00 +08:00
Jason Lee
c86b0222ce
example: Add a HelloWorld example. ( #1133 )
...
Ref #1132 to make a minimized app
2025-08-14 11:15:55 +08:00
Floyd Wang
37de698a61
list: Fix the scroll_to_item not working ( #1129 )
2025-08-13 15:12:54 +08:00
Floyd Wang
e37369ea16
plot: Support multiple directions for the tooltip cross line ( #1128 )
2025-08-12 14:16:31 +08:00
Jason Lee
7f64f8798e
virtual_list: Avoid scroll when list contents not overflow. ( #1125 )
...
- Fix scrollbar position in popup menu.
2025-08-08 19:13:18 +08:00
Jason Lee
b1f4a4f642
tabs: Remove underline variant TabBar paddings. ( #1126 )
...
<img width="1167" height="1044" alt="image"
src="https://github.com/user-attachments/assets/0a2b34b7-5629-402b-a54a-f975aab77e78 "
/>
2025-08-08 19:06:26 +08:00
Jason Lee
85e2a72d03
slider: Add to support range to Slider. ( #1121 )
...
- Add to support Styled for Slider, and `bg`, `text_color`, `radius` can
change the slider bar and thumb.
## Break Changes
- The `reverse` method is removed from Slider, the Slider with vertical
now is always display from bottom to top.
<img width="1401" height="1176" alt="image"
src="https://github.com/user-attachments/assets/656592d6-ffac-4fd1-b569-848092c081bc "
/>
2025-08-08 16:59:23 +08:00
Jason Lee
900a4aa652
modal: Fix escape to dismiss Modal when list have selected item. ( #1124 )
2025-08-08 12:36:27 +08:00
Jason Lee
880d023834
virtual_list: Fix scroll to item not align to paddings. ( #1122 )
...
- Fixed List scroll to item at first time rendering.
2025-08-08 11:56:18 +08:00
Jason Lee
123a4a9fcd
chore: Update GPUI to fix click_count API changes. ( #1123 )
...
Closes #1116
2025-08-08 11:53:45 +08:00
Floyd Wang
0ab497ea1d
radio: Render the label based on its own size ( #1114 )
2025-08-06 15:29:07 +08:00
Jason Lee
9a040eaaac
list: Refactor List, Dropdown delegate API to support section. ( #1107 )
...
Ref UITableView API:
https://developer.apple.com/documentation/uikit/uitableviewdatasource
## Changes
- Added some section related API to `ListDelegeate` and
`DropdownDelegate` with default implement, so if you don't need section
that you can just keep the default.
- Added `sections_count` method to get the number of sections, default
is 1.
- Added `render_section_header` for special the section header by if
needed, default return None.
- Added `render_section_footer` for special the section footer by if
needed, default return None.
## Break Changes
- The `DropdownState` have change new method to use IndexPath type:
```diff
- DropdownState::new(vec![], Some(1), window, cx);
+ DropdownState::new(vec![], Some(IndexPath::new(1)), window, cx);
```
- The `ListDelegeate`, `DropdownDelegate` has changed API:
- The `ix` are change from `usize` to `IndexPath`.
```diff
- fn render_item(&self, ix: usize, window: &mut Window, cx: &mut
Context<List<Self>>) -> Option<Self::Item>
+ fn render_item(&self, ix: IndexPath, window: &mut Window, cx: &mut
Context<List<Self>>) -> Option<Self::Item>
- fn set_selected_index(&mut self, ix: Option<usize>, window: &mut
Window, cx: &mut Context<List<Self>>)
+ fn set_selected_index(&mut self, ix: Option<IndexPath>, window: &mut
Window, cx: &mut Context<List<Self>>)
```
- The `items_count` method have added `section` argument to support list
section.
```diff
- fn items_count(&self, cx: &App) -> usize
+ fn items_count(&self, section: usize, cx: &App) -> usize
```
- The `can_load_more` method has renamed to `is_eof` in `ListDelegate`
and `TableDelegate`.
```diff
- fn can_load_more(&self, cx: &App) -> bool
+ fn is_eof(&self, cx: &App) -> bool
```
- The `can_search` method has renamed to `searchable` in `ListDelegate`.
```diff
- fn can_search(&self) -> bool
+ fn searchable(&self) -> bool
```
## Showcase
<img width="1196" height="925" alt="image"
src="https://github.com/user-attachments/assets/22750abe-cc3f-427e-903b-51758bd4e027 "
/>
<img width="1214" height="934" alt="image"
src="https://github.com/user-attachments/assets/52d42546-e6e7-4448-9c0f-43cd659fb630 "
/>
---------
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2025-08-05 19:23:32 +08:00
Floyd Wang
16f4fc0456
drawer: Fix the overlay_closable not working ( #1113 )
2025-08-05 19:10:38 +08:00
ihavecoke
163b540681
tiles: Add panels method. ( #1112 )
2025-08-04 19:33:28 +08:00
Jason Lee
fe8a1e8e9f
scrollbar: Show scrollbar immediately when scroll offset changed. ( #1111 )
...
https://github.com/user-attachments/assets/823f3ac7-4335-4dae-a540-a2ccd11b8fc8
2025-08-04 17:00:20 +08:00
Floyd Wang
4b85cf6ad2
table: Fix the border overlap issue ( #1110 )
...
| Before | After |
| - | - |
| <img width="355" height="165" alt="SCR-20250801-kaof"
src="https://github.com/user-attachments/assets/ac073913-7813-43f2-a860-690a2366640b "
/> <img width="268" height="137" alt="SCR-20250801-kgqk"
src="https://github.com/user-attachments/assets/6a01df6d-fbf9-42a3-bfa3-4120a28b1401 "
/> | <img width="378" height="176" alt="SCR-20250801-kags"
src="https://github.com/user-attachments/assets/c5a3196d-4d0f-469b-b0d4-ce60b8dbe3f1 "
/> <img width="274" height="136" alt="SCR-20250801-kgik"
src="https://github.com/user-attachments/assets/649ff866-f153-40f3-97fa-7715f7480a2f "
/> |
2025-08-01 11:42:58 +08:00
Jason Lee
6c7a28c818
kbd: Fix Kdb to support display - key. ( #1109 )
2025-07-31 20:39:19 +08:00
Jason Lee
efa2c7c9ef
virtual_list: Add VirtualListScrollHandle to support scroll_to_item. ( #1108 )
...
- Also fixed Table scroll to selected column support.
https://github.com/user-attachments/assets/3b7c51a7-addf-4657-9f9f-de9047fffab8
2025-07-31 18:09:23 +08:00
Jason Lee
cb6695c774
dock: Adjust tab panel menu button position to align with content. ( #1106 )
...
## Before
<img width="1316" height="981" alt="image"
src="https://github.com/user-attachments/assets/ad2a96a0-5e82-4caa-85da-76f24d4deef1 "
/>
## After
<img width="1306" height="796" alt="image"
src="https://github.com/user-attachments/assets/abc2d5d5-d9de-4cf0-9c39-eb965ffb9c46 "
/>
2025-07-30 16:35:25 +08:00
Jason Lee
b2ce262da9
chore: Fix release unused method warning.
2025-07-30 15:44:41 +08:00
Jason Lee
e2153c9198
dock: Hide panel toolbar when dock is collapsed. ( #1105 )
2025-07-30 15:38:14 +08:00
Cyandev
b8db00dd3c
scrollbar: Reduce unnecessary frame updates ( #1104 )
...
The current scrollbar implementation calls
`Window::request_animation_frame` during the delay phase, which causes
unnecessary CPU usage. This PR updates the scrollbar to use a timer to
wait before starting the fade-out animation, allowing the CPU to remain
idle during this phase.
There is the comparison with Instruments.
**Before:**
<img width="632" height="75" alt="image"
src="https://github.com/user-attachments/assets/b407f1e5-8337-4f8f-b308-2cc16f6bf7ba "
/>
**After:**
<img width="608" height="75" alt="image"
src="https://github.com/user-attachments/assets/965787cf-1a42-413a-9a5e-ad0910c5cbee "
/>
2025-07-30 09:55:24 +08:00
Jason Lee
518004a014
input: Fix to let set_value works when Input is disabled. ( #1103 )
2025-07-29 17:55:53 +08:00
obito
7487662343
chrore: Refactor the disabled API for NumberInput, DatePicker, OtpInput, Calandar. ( #1102 )
...
- Added `disabled` method to OtpInput.
- Added `disabled` method to DatePicker.
- Added `disabled_matcher` method to CalendarState.
## Break Changes
- The `InputState` has been removed `disabled` and `set_disabled`
method, the disabled state should assign from TextInput element.
```diff
- let state = InputState::new("input1").disabled(true)
+ let state = InputState::new("input1");
+ TextInput::new(&state).disabled(true)
```
- Renamed `set_disabled` method to `set_disabled_matcher` from
`CalendarState`.
- Removed `set_disabled` method from `DatePickerState`, use
`disabled_matcher` method in `DatePicker` element.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-29 17:31:52 +08:00
Floyd Wang
c07bc4aaad
list: Add support for scrolling to item with the given strategy ( #1100 )
...
## Breaking Change
- Add `strategy` to the `scroll_to_item` method.
```diff
+ list.scroll_to_item(selected, ScrollStrategy::Center, window, cx);
- list.scroll_to_item(selected, window, cx);
```
2025-07-29 15:14:26 +08:00
Jason Lee
771fd78416
tabs: Fix tab_bar_segmented default fallback color to secondary. ( #1101 )
2025-07-29 14:42:46 +08:00
Jason Lee
f423b8ffa2
table: Fix table head size. ( #1099 )
...
Close #1098 , this issue was included from #1094
2025-07-29 10:03:25 +08:00
Jason Lee
058dd27687
tab: Fix tab text vertical center in small, xsmall size. ( #1097 )
2025-07-28 19:33:04 +08:00
Jason Lee
461ed9c173
chore: Fix Slider, Progress width in horizontal mode. ( #1096 )
...
This bug included since Taffy 0.8 update in
[#taffy](https://github.com/zed-industries/zed/pull/34939 )
2025-07-28 18:56:09 +08:00
Jason Lee
93b578294c
list: Update ListItem and DropdownListItem style. ( #1095 )
...
## Break Change
- The `Selectable` trait has been removed `element_id` method, this is
necessary.
- The `item` of `List` now must impl `Selectable` trait.
## List
> NOTE: The default ListItem is no rounded and paddings.
<img width="1144" height="762" alt="image"
src="https://github.com/user-attachments/assets/32348682-f89a-487a-af9f-5ed379a7f2d8 "
/>
## Dropdown
<img width="537" height="387" alt="image"
src="https://github.com/user-attachments/assets/3cc99d9f-3714-4d10-b467-6c91917bcbf0 "
/>
2025-07-28 18:38:39 +08:00
Floyd Wang
6d0443998c
table: Fix the incorrect rendering of the header border ( #1094 )
2025-07-28 10:32:11 +08:00
Floyd Wang
75af2b31ba
story: Fix the startup error in the dock example ( #1093 )
2025-07-28 09:43:29 +08:00
Jason Lee
37aa26d655
check, radio: Add fade in animation to Checkbox and Radio. ( #1092 )
2025-07-24 11:41:34 +00:00
Jason Lee
479ab8f0d6
switch: Apply use_keyed_state to store toggle state for animation. ( #1091 )
...
Ref https://github.com/zed-industries/zed/pull/34741
Now `Switch` can use impl RenderOnce.
2025-07-24 19:22:55 +08:00
Jason Lee
76a64eb072
theme: Fix some theme's scrollbar background color. ( #1090 )
2025-07-24 16:54:04 +08:00
Jason Lee
579c7a3cbb
virtual_list: Fix scrollable size calculate in VirtualList. ( #1087 )
...
The `virtual_list` scroll range issue because recently GPUI changed the
`ScrollHandle` API, now we only get the `max_offset`.
So #1086 have fixed this to implementation a `content_size` method to
calculate `max_offset` and `bounds` of the `ScrollHandle`.
But I found that the `Interactivity` prepaint (This is used in
VirtualList) was not to update the `bounds` of the `ScrollHandle`.
Wait https://github.com/zed-industries/zed/pull/35013 to merge.
| Before | After |
| -- | --- |
| <img width="620" alt="image"
src="https://github.com/user-attachments/assets/6ffb8f30-93b4-42ec-a837-90f80ecb2bf5 "
/> | <img width="620" alt="image"
src="https://github.com/user-attachments/assets/21466332-030c-495f-8c84-e3a2c6eeb403 "
/> |
- Split `Scrollbale` and `VirtualList` story.
## Break Changes
- The `content_size` argument has been removed from `virtual_list`
callback.
2025-07-24 08:30:42 +00:00
Jason Lee
56cf05b749
table: Fix horizontal scroll range when no fixed columns. ( #1089 )
2025-07-24 15:35:14 +08:00
Floyd Wang
634ab14306
button: Use muted foreground as disabled text color ( #1088 )
2025-07-24 14:19:10 +08:00
Cyandev
e9d8741835
scrollbar: Fix content size ( #1086 )
...
Caused by PR #1078 incorrect changes, and GPUI was changed API
https://github.com/zed-industries/zed/pull/34832
The content size of the scrollable area should be its max scroll offset
plus the container size.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-24 10:20:04 +08:00
Jason Lee
fcf447d612
theme: Fix scrollbar default color and list hover color. ( #1085 )
2025-07-23 11:50:42 +00:00
Floyd Wang
6d28cce719
notification: Fix display issues caused by the taffy upgrade ( #1084 )
2025-07-23 19:12:13 +08:00
Jason Lee
f458cb83f8
accordion: Fix accordion to size full. ( #1083 )
...
- Remove `accordion.background` color from themes.
2025-07-23 10:45:02 +00:00
Floyd Wang
a2b91a7a2b
input(state): Provide context to the validate method ( #1082 )
2025-07-23 14:30:16 +08:00
Jason Lee
271116926c
code-editor: Add go_to_line method to CodeEditor. ( #1081 )
...
- Fix to emit `enter` press key in Input single-line mode.
2025-07-23 13:33:09 +08:00
Cyandev
dfbda3999a
modal: Refine enter animation ( #1080 )
...
This PR adds a fade in animation for modals, which makes the UI looks
smoother.
https://github.com/user-attachments/assets/7671aa78-a3bd-43a6-ace7-d051d24f2523
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-23 10:29:42 +08:00
Jason Lee
7d3301d695
tab_bar: Fix some incorrect style in TabBar. ( #1078 )
...
This change to fix some incorrect style use, that will break in Taffy
0.5.2+
Ref https://github.com/zed-industries/zed/pull/34827
- Add `Tab::empty` to create a Tab without label.
- Fix form layout in Taffy new version.
- Update GPUI for scroll API changes.
2025-07-22 13:30:04 +08:00
Jason Lee
61b7e54bfa
table: Refactor the Table API for describe the columns. ( #1072 )
...
## Break Changes
- The `ColFixed` has renamed to `ColumnFixed`.
- The `ColSort` has renamed to `ColumnSort`.
### TableDelegate
- Removed `col_name`, `col_resizable`, `col_selectable`, `col_width`,
`col_sort`, `col_fixed`, `col_paddings`, `col_movable` method, now use
`col` method to return a TableCol for describe of them.
- The `cols_count` method renamed to `columns_count`.
```diff
- fn cols_count(&self, _: &App) -> usize
+ fn columns_count(&self, _: &App) -> usize
```
- The `move_col` has renamed to `move_column`.
- The `visible_cols_changed` has renamed to `visible_columns_changed`.
### TableEvent
```diff
- TableEvent::SelectCol
+ TableEvent::SelectColumn
- TableEvent::MoveCol
+ TableEvent::MoveColumn
- TableEvent::ColWidthsChanged
+ TableEvent::ColumnWidthsChanged
```
2025-07-21 11:16:35 +08:00
Floyd Wang
b7f443b73f
label: Streamline the test cases ( #1074 )
2025-07-18 17:10:36 +08:00
Floyd Wang
b553ca8dcc
label: Add support for highlighting specified text ( #1073 )
...
<img width="1712" height="1312" alt="SCR-20250718-ogsp"
src="https://github.com/user-attachments/assets/5f0043ef-77c7-4d91-ad99-4061b14497ff "
/>
<img width="1712" height="1312" alt="SCR-20250718-oguh"
src="https://github.com/user-attachments/assets/ed0bf114-37d0-458d-9321-82766fe75076 "
/>
2025-07-18 16:33:36 +08:00
Jason Lee
7f3f2a3940
button: Fix selected style for outline button. ( #1070 )
2025-07-17 14:20:19 +08:00
Jason Lee
9c782796c2
theme: Improve theme color fallbacks based on base colors. ( #1069 )
...
- Added a lot of default fallbacks for theme colors based on `base`
colors.
- Added `hue`, `saturation`, `lightness` method to change Hsla color.
- Update stories to use theme colors, not a direct color.
- Improve `Badge`, `Avatar` to use theme colors.
- Added a new theme: `Fahrenheit`.
2025-07-17 11:43:40 +08:00
Jason Lee
977ce5df29
theme: Refactor Theme config to support JSONSchama. ( #1068 )
2025-07-16 19:22:09 +08:00
Jason Lee
ed75659765
table: Update to standardization the TableDelegate API. ( #1067 )
...
## Break Changes
- Renamed some method name of the TableDelegate.
```diff
- fn can_select_col
+ fn col_selectable
- fn can_resize_col
+ fn col_resizable
- fn col_padding
+ fn col_paddings
- fn can_move_col
+ fn col_movable
```
- Removed `fn can_loop_select` remove TableDelegate, instead of to use
`loop_selection` option on `Table`.
2025-07-16 17:11:49 +08:00
Jason Lee
ea1f5331c8
input: Hide cursor and selection when window is deactivated. ( #1066 )
2025-07-16 14:01:46 +08:00
Jason Lee
eca7949583
input: Update input behaviors to do not unselect on blur or press escape. ( #1065 )
...
- Also to pub `unselect` for manually use, and fix this method will
incorrect to move right 1 char.
2025-07-16 13:29:58 +08:00
Jason Lee
0fbe32c7d7
highlighter: Fix to support custom language register. ( #1064 )
2025-07-15 19:24:25 +08:00
Jason Lee
ac026e26c9
theme: Improve theme color fallbacks and add more themes. ( #1063 )
2025-07-15 18:33:36 +08:00
Jason Lee
d139198c15
theme: Impl Default for Theme. ( #1061 )
2025-07-15 16:35:12 +08:00
Jason Lee
c9b5993472
story: Improve story case style. ( #1060 )
2025-07-15 11:56:07 +08:00
Jason Lee
cfd1551575
theme: Add more theme and fix to use default color from base color. ( #1058 )
2025-07-14 20:17:11 +08:00
Jason Lee
6508927e7f
input: Add appearance option to NumberInput, Dropdown, DatePicker to render without style. ( #1054 )
...
<img width="1100" height="935" alt="image"
src="https://github.com/user-attachments/assets/b213c778-eef0-4d63-8d07-b68da9a078b1 "
/>
2025-07-14 19:57:56 +08:00
Jason Lee
867b4ff3a6
dock: Open dock if clicked on the tab of the collapsed bottom dock. ( #1057 )
2025-07-14 18:49:31 +08:00
Jason Lee
1df450d3b0
story: Fix tiles story. ( #1056 )
2025-07-14 18:06:46 +08:00
Jason Lee
44427afacb
theme: Add to support highlight color to theme config. ( #1055 )
...
<img width="1058" height="1026" alt="image"
src="https://github.com/user-attachments/assets/300fb16b-c5e4-4eef-9690-54fcabc4fe47 "
/>
<img width="836" height="855" alt="image"
src="https://github.com/user-attachments/assets/3fdc8301-375d-4223-a2ea-8d4f411a90bd "
/>
2025-07-14 17:04:18 +08:00
Jason Lee
82b87d92ab
text_view: Fix nested Blockquote render in Markdown and HTML. ( #1053 )
...
<img width="986" height="271" alt="image"
src="https://github.com/user-attachments/assets/1de04629-2bdc-48f2-ae69-45c33482aeff "
/>
- Also fixed short language name in code block, e.g.: `rs` -> `rust`.
2025-07-14 14:30:40 +08:00
Floyd Wang
3b759cd448
plot: Use f32 instead of f64 ( #1052 )
...
## Break Change
- Convert all `f64` parameters to `f32`.
Since the GPUI geometry module uses f32 for rendering, we are also
switching to f32. This helps avoid many as operators and unnecessary
conversions.
2025-07-08 16:24:59 +08:00
Jason Lee
8bf66443b2
theme: Add theme schema to support JSON theme config. ( #1050 )
2025-07-07 19:40:00 +08:00
Jason Lee
463c3ebfea
chore: Remove unnecessary examples that have includes in gallery. ( #1049 )
2025-07-07 12:11:19 +08:00