Jason Lee
d40f8889b9
title_bar: Anchor user menu popover at top right corner ( #27329 )
...
Release Notes:
- Improved user menu placement
| Before | After |
| --- | --- |
| 
|

|
2025-03-25 08:20:50 -03:00
Jason Lee
985ac4e5f2
gpui: Reduce window.refresh to improve cache hit of the cached views ( #25009 )
...
Release Notes:
- Improved performance when using the scroll wheel and some other mouse
interactions.
Based on some cache details about GPUI `AnyView::cached` that I found in
the discussion of
https://github.com/zed-industries/zed/discussions/24260#discussioncomment-12135749 ,
and combined with the optimization points found in actual applications.
This change may have some scenarios that I have not considered, so I
just make a draft to put forward my ideas first for discussion.
From my analysis, `AnyView::cached` will always invalid by Div's mouse
events, because of it called `window.refresh`. I understand that (mouse
move event) this is because the interface changes related to hover and
mouse_move will be affected style, so `window.refresh` is required.
Since Div does not have the `entity_id` of View, it is impossible to
know which View should be refreshed, so the entire window can only be
refreshed.
With this change, we can reduce a lot of `render` method calls on
ScrollWheel or Mouse Event.
2025-03-18 14:52:20 -07:00
Jason Lee
b81a1ad91d
gpui: Fix text underline width ( #26827 )
...
Release Notes:
- N/A
Fix #24721 mistake to make sure underline width same as the text.
## Before

## After
<img width="912" alt="image"
src="https://github.com/user-attachments/assets/222b5dcb-c0fb-4ec1-8e23-d68247621375 "
/>
2025-03-15 09:18:11 -07:00
Jason Lee
4b153e7f7f
gpui: Fix line_through, underline position when used text center or right ( #24721 )
...
Release Notes:
- N/A
---
| Before | After |
| --- | --- |
| <img width="912" alt="image"
src="https://github.com/user-attachments/assets/0640ac85-ee5d-4707-b866-997e36608c18 "
/> | <img width="912" alt="image"
src="https://github.com/user-attachments/assets/caf84477-a7bc-4c22-a9e6-f44c3b6f86ef "
/> |
And fix the `line_through` doc link.
2025-03-15 11:44:51 +02:00
Jason Lee
c37f616c3b
gpui: Maintain img aspect ratio when max_width is set ( #25632 )
...
Release Notes:
- Fixed Markdown preview to display image with max width 100%.
## Before
<img width="1202" alt="image"
src="https://github.com/user-attachments/assets/359628df-8746-456f-a768-b3428923c937 "
/>
<img width="750" alt="SCR-20250226-napv"
src="https://github.com/user-attachments/assets/f6154516-470e-41b2-84f5-ef0612c447ad "
/>
## After
<img width="1149" alt="image"
src="https://github.com/user-attachments/assets/2279347d-9c69-4a47-bb62-ccc8e55a98f6 "
/>
<img width="520" alt="SCR-20250226-ngyz"
src="https://github.com/user-attachments/assets/03af5f14-1935-472e-822f-4c7f62630780 "
/>
2025-03-03 12:36:27 +01:00
Jason Lee and Marshall Bowers
b1b6401ce7
gpui: Don’t hide Window in docs ( #25449 )
...
Release Notes:
- N/A
This side effect is only appearing in outside project.
## Before
<img width="414" alt="image"
src="https://github.com/user-attachments/assets/73d215d2-20e4-4337-82f4-74daa88a1bae "
/>
## After
<img width="453" alt="image"
src="https://github.com/user-attachments/assets/030d34d7-c425-44f6-9cc5-0f2f6fd0a1ac "
/>
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com >
2025-02-24 18:11:46 +00:00
Jason Lee and Marshall Bowers
07ba7c8c44
gpui: Add underline style method ( #24784 )
...
Release Notes:
- N/A
Add a shorter method to apply underline style.
https://tailwindcss.com/docs/text-decoration-line#underling-text
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com >
2025-02-24 12:58:20 -05:00
Jason Lee
ead5a836a1
gpui: Add data table example ( #24373 )
...
Release Notes:
- N/A
As https://github.com/zed-industries/zed/discussions/24260 I mentioned
issue.
Make a complex data table example to test the text rendering
performance.
This example also can be an example to show how to build a large data
table.
```bash
cargo run -p gpui --example data_table
```
<img width="2004" alt="image"
src="https://github.com/user-attachments/assets/653771e5-ef08-4d76-97b9-90ea4b78be59 "
/>
----
I will try to do some test.
For example: With a threshold for the hold number of caches in
`FrameCache`, and only when the threshold is greater than a certain
number, some caches are released, or when a certain time has passed. I
am not sure if this is feasible.
This example is added to help us to test.
2025-02-07 11:54:34 -08:00
Jason Lee and Owen Law
c5913899d9
gpui: Fix text-align with nowrap mode ( #24116 )
...
Release Notes:
- N/A
------
- Continue #24090 to fix text align for when used `whitespace_nowrap`.
- Fix wrapped line length calculation.
And add example
```
cargo run -p gpui --example text_layout
```
<img width="760" alt="image"
src="https://github.com/user-attachments/assets/a087c300-0e0e-4a80-98c6-90161a9b0905 "
/>
---------
Co-authored-by: Owen Law <owenlaw222@gmail.com >
2025-02-06 18:51:00 -08:00
Jason Lee
f08b1d78ec
Revert "Revert recent anti-aliasing improvements ( #24289 )" and fix selection top right corner radius issue ( #24342 )
...
Release Notes:
- N/A
----
To fix #24289 mention issue and revert PathBuilder and MSAA.
I'm sorry about of this, in #22808 I was forgotten this bit of detail.

So, add `move_to` here, we can fix the selection top right corner radius
issue.
## After change
<img width="1383" alt="image"
src="https://github.com/user-attachments/assets/28ea103c-d652-41d6-bbe0-7fd042d81e77 "
/>
2025-02-06 11:03:23 +02:00
Jason Lee
e1af35aa15
gpui: Add closest_index_for_position method ( #23668 )
...
Closes #ISSUE
Release Notes:
- N/A
------------
I just make a little change to improve `index_for_position` to support
return closest index for position.
I need this method to measure for position cursor in multi-line mode
TextInput.
https://github.com/longbridge/gpui-component/pull/583
https://github.com/user-attachments/assets/c69d098e-d2cb-4053-b739-6c7dd666e769
Before this change, GPUI have `LineLayout::closest_index_for_x` method
for unwrapped line case.
https://github.com/zed-industries/zed/blob/d1be419fff415329b38f26aff90488700702c82a/crates/gpui/src/text_system/line_layout.rs#L58-L94
This change is equivalent to making `index_for_position` have a
corresponding method to get the closest index like `index_for_x`.
2025-01-31 00:03:56 -07:00
Jason Lee
b9e0aae49f
gpui: Enable MSAA to Path render for Anti-Aliasing ( #22812 )
...
Closes #20762
Release Notes:
- N/A
---
Enable MSAA for Anti-Aliasing to Path (`cx.paint_path`) for drawing a
better vector graphics.
```bash
cargo run -p gpui --example gradient --features macos-blade
cargo run -p gpui --example gradient
cargo run -p gpui --example painting --features macos-blade
cargo run -p gpui --example painting
```
**Before**
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/0ae7240f-4ba9-4ef5-896c-e436c1282770 "
/>
**After**
<img width="944" alt="image"
src="https://github.com/user-attachments/assets/71a07ae8-be54-452c-aacc-b8cec1f810c0 "
/>
## TODO
- [x] Support Metal and Blade.
- [x] Detect system support to set up sample count.
- [x] Fix extra lines between Path vertices wait #22808 to merge.
Ref https://github.com/kvark/blade/pull/213
Ask @kvark to review.
I am not sure if there is anything I missed. I modified it according to
the
[particle](https://github.com/kvark/blade/tree/main/examples/particle )
example of Blade project. But the difference is that after the first
MSAA render, I did not do it a second time, I tested it and found it was
not necessary.
2025-01-29 22:14:40 +02:00
Jason Lee
31fa414422
gpui: Add PathBuilder based on lyon to build Path ( #22808 )
...
Release Notes:
- N/A
---
Continue https://github.com/zed-industries/zed/pull/20499
We to draw more complex Path. Before this change, we only have
`line_to`, but it is not enough.
Add a new `PathBuilder` to use [lyon](https://github.com/nical/lyon ) to
build more complex path.
And then with PR #22812 to enable anti-aliasing, all thing will be
perfect.
## Show case
```bash
cargo run -p gpui --example painting
```
Before:
<img width="1136" alt="image"
src="https://github.com/user-attachments/assets/0c15833a-ec95-404c-a469-24cf172cfd86 "
/>
After:
<img width="1136" alt="image"
src="https://github.com/user-attachments/assets/42cfa35e-7e8f-4ef3-bb2d-b98defc62ad6 "
/>
2025-01-29 22:14:33 +02:00
Jason Lee
706f7be5e7
gpui: Add line_clamp to truncate text after a specified number of lines ( #23058 )
...
Release Notes:
- N/A
Add this feature for some case we need keep 2 or 3 lines, but truncate.
For example the blog post summary.
- Added `line_clamp` method.
Ref: https://tailwindcss.com/docs/line-clamp
## Break changes:
- Renamed `gpui::Truncate` to `gpui::TextOverflow` to match
[CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow ).
- Update `truncate` style method to match [Tailwind
CSS](https://tailwindcss.com/docs/text-overflow ) behavior:
```css
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
```
<img width="538" alt="image"
src="https://github.com/user-attachments/assets/c69c4213-eac9-4087-9daa-ce7afe18c758 "
/>
## Show case
<img width="816" alt="image"
src="https://github.com/user-attachments/assets/e0660290-8042-4954-b93c-c729d609484a "
/>

## Describe changes
The [second
commit](https://github.com/zed-industries/zed/commit/6b41c2772f9d1c5f4efe69fe83206a14407af4d4 )
for make sure text layout to match with the line clamp. Before this
change, they may wrap many lines in sometimes. And I also make
line_clamp default to 1 if we used `truncate` to ensure no wrap.
> TODO: There is still a tiny detail that is not easy to fix. This
problem only occurs in the case of certain long words. I will think
about how to improve it later. At present, this has some flaws but does
not affect the use.
2025-01-29 22:14:24 +02:00
Jason Lee
6d4ccb0eb1
Fix project_panel::NewDirectory in TextMate keymap ( #23825 )
...
Release Notes:
- Fixed incorrect action names in TextMate keymap.
2025-01-29 08:37:45 +00:00
Jason Lee
3eba831de8
Fix closest_index_for_x to get correct offset when only 1 char ( #23603 )
...
Release Notes:
- N/A
----------
This bug can easy to replay by `input` example, just enter 1 char and
click on the middle of the char, we can't move cursor to 0, it is always
be 1.
```bash
cargo run -p gpui --example input
```
## Before
https://github.com/user-attachments/assets/3239dd47-278e-4311-9757-5165d1ccd796
## After
https://github.com/user-attachments/assets/4e2c1500-0142-4e28-bf34-7ef1f4929925
2025-01-27 23:18:18 -07:00
Jason Lee
dc0075b8e6
Fix empty title in Recent Projects ( #21952 )
...
Close #13595
Release Notes:
- Fixed empty title in Recent Projects.
---
| Before | After |
| --- | --- |
| <img width="695" alt="SCR-20241213-nzxr"
src="https://github.com/user-attachments/assets/f19a0bad-d542-44cd-85c1-89386d396f27 "
/> | <img width="625" alt="image"
src="https://github.com/user-attachments/assets/0d2afef7-4cd2-43eb-9046-c169df2eb8a0 "
/> |
This is because the `LocalPathsOrder` get empty list.
```
[crates/recent_projects/src/recent_projects.rs:385:9] &location = Local(
LocalPaths(
[
"/Users/jason/Library/Application Support/Zed/prettier/node_modules",
],
),
LocalPathsOrder(
[],
),
)
[crates/recent_projects/src/recent_projects.rs:386:9] &paths = [
"~/Library/Application Support/Zed/prettier/node_modules",
]
[crates/recent_projects/src/recent_projects.rs:385:9] &location = Local(
LocalPaths(
[
"/Users/jason/github/tree-sitter-csv",
],
),
LocalPathsOrder(
[],
),
)
[crates/recent_projects/src/recent_projects.rs:386:9] &paths = [
"~/github/tree-sitter-csv",
]
[crates/recent_projects/src/recent_projects.rs:385:9] &location = Local(
LocalPaths(
[
"/Users/jason/work/autocorrect/autocorrect-website/dist",
],
),
LocalPathsOrder(
[],
),
)
```
2025-01-07 03:45:38 +00:00
Jason Lee
72057e5716
cli: Fix support for older macOS versions ( #22515 )
...
Close #22419
Release Notes:
- Fixed `zed` cli crash by `ScreenCaptureKit` library not loaded error
on macOS lower versions.
<img width="843" alt="image"
src="https://github.com/user-attachments/assets/9e0b615e-933f-4808-bf20-3e37e9e8bc6d "
/>
---
The main reason is the `cli` depends on `release_channel`, and it
depends on `gpui`.
```
$ cargo tree -p cli
├── release_channel v0.1.0 (/Users/jason/github/zed/crates/release_channel)
│ └── gpui v0.1.0 (/Users/jason/github/zed/crates/gpui)
│ ├── anyhow v1.0.95
│ ├── async-task v4.7.1
│ ├── block v0.1.6
│ ├── cocoa v0.26.0
```
2025-01-04 00:42:37 +00:00
Jason Lee
5f4f3a9c87
chore: Remove duplicate lines in crates/zed/build.rs ( #22500 )
...
Release Notes:
- N/A
This may a mistake by merge in PR #21550
https://github.com/zed-industries/zed/blob/344284e01331667c018e6ade5d791a20598a3a5c/crates/zed/build.rs#L8-L14
2024-12-30 11:52:40 +00:00
Jason Lee
de89f8cf83
gpui: Add linear gradient support to fill background ( #20812 )
...
Release Notes:
- gpui: Add linear gradient support to fill background
Run example:
```
cargo run -p gpui --example gradient
cargo run -p gpui --example gradient --features macos-blade
```
## Demo
In GPUI (sRGB):
<img width="761" alt="image"
src="https://github.com/user-attachments/assets/568c02e8-3065-43c2-b5c2-5618d553dd6e ">
In GPUI (Oklab):
<img width="761" alt="image"
src="https://github.com/user-attachments/assets/b008b0de-2705-4f99-831d-998ce48eed42 ">
In CSS (sRGB):
https://codepen.io/huacnlee/pen/rNXgxBY
<img width="505" alt="image"
src="https://github.com/user-attachments/assets/239f4b65-24b3-4797-9491-a13eea420158 ">
In CSS (Oklab):
https://codepen.io/huacnlee/pen/wBwBKOp
<img width="658" alt="image"
src="https://github.com/user-attachments/assets/56fdd55f-d219-45de-922f-7227f535b210 ">
---
Currently only support 2 color stops with linear-gradient. I think this
is we first introduce the gradient feature in GPUI, and the
linear-gradient is most popular for use. So we can just add this first
and then to add more other supports.
2024-12-11 21:52:52 +02:00
Jason Lee
44164dbbb8
gpui: Update Bounds, Point, and Axis to be serializable ( #21783 )
...
Makes `Bounds`, `Point`, and `Axis` be serializable, for dumping to JSON without conversion.
Release Notes:
- N/A
2024-12-10 00:43:55 -07:00
Jason Lee and Marshall Bowers
afb253b406
ui: Ensure Label with single_line set does not wrap ( #21444 )
...
Release Notes:
- N/A
---
Split from #21438 , this change for make sure the `single_line` mode
Label will not be wrap.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-12-03 13:03:53 -05:00
Jason Lee and Danilo Leal
a8c7e61021
Fix AI Context menu text wrapping causing overlap ( #21438 )
...
Closes https://github.com/zed-industries/zed/issues/20678
| Before | After |
| --- | --- |
| <img width="672" alt="SCR-20241203-jreb"
src="https://github.com/user-attachments/assets/411ba2a6-712f-4ab7-a320-12ac9a35c1e1 ">
| <img width="771" alt="SCR-20241203-jwhe"
src="https://github.com/user-attachments/assets/022c8ee9-4089-4c09-aa4b-12a0f5528822 ">
|
Release Notes:
- Fixed AI Context menu text wrapping causing overlap.
Also cc #21409 @WeetHet @osiewicz to use `Label`, this PR has been fixed
`Label` to ensure `whitespace_nowrap` when use `single_line`.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com >
2024-12-03 01:45:15 -03:00
Jason Lee
e9e260776b
gpui: Fix default colors blue, red, green to match in CSS default colors ( #20851 )
...
Release Notes:
- N/A
---
This change to let the default colors to 100% match with CSS default
colors.
And update the methods to as `const`.
Here is an example:
<img width="338" alt="image"
src="https://github.com/user-attachments/assets/dd17b46a-3ad4-4122-8dca-e800644c75b0 ">
https://codepen.io/huacnlee/pen/ZEgNXJZ
But the before version for example blue: `h: 0.6 * 360 = 216`, but we
expected `240`, `240 / 360 = 0.666666666`, so the before version are
lose the precision. (Here is a test tool: https://hslpicker.com/#0000FF )
## After Update
```bash
cargo run -p gpui --example hello_world
```
<img width="612" alt="image"
src="https://github.com/user-attachments/assets/97d479d8-9c71-4be3-95e0-09af45fe47e2 ">
2024-11-28 10:08:07 +02:00
Jason Lee and Floyd Wang
932c7e23c8
gpui: Fix SVG color render, when color have alpha ( #20537 )
...
Release Notes:
- N/A
## Demo
- [Source
SVG](https://github.com/user-attachments/assets/1c681e01-baba-4613-a3e7-ea5cb3015406 )
click here open in browser.
| Before | After |
| --- | --- |
| <img width="1212" alt="image"
src="https://github.com/user-attachments/assets/ba323b13-538b-4a34-bb64-9dcf490aface ">
| <img width="1212" alt="image"
src="https://github.com/user-attachments/assets/4635926a-843e-426d-89a1-4e9b4f4cc37e ">
|
---------
Co-authored-by: Floyd Wang <gassnake999@gmail.com >
2024-11-16 16:53:57 +02:00
Jason Lee
792c1e4710
gpui: Add paint_path example ( #20499 )
...
Release Notes:
- N/A
---
```
cargo run -p gpui --example painting
```
I added this demo to verify the detailed support of Path drawing in
GPUI.
Because of, when we actually used GPUI to draw a 2D line chart, we found
that the straight line Path#line_to did not support `anti-aliasing`, and
the drawn line looked very bad.
As shown in the demo image, if we zoom in on the image, we can clearly
see that all the lines are jagged.
I read and tried to make some appropriate adjustments to the functions
in Path, but since I have no experience in the graphics field, I still
cannot achieve anti-aliasing support so far.
I don't know if I used it wrong somewhere. I checked `curve_to` and
found that the curves drawn have anti-aliasing effects, as shown in the
arc part of the figure below.
<img width="1136" alt="image"
src="https://github.com/user-attachments/assets/4dfb7603-e746-43e9-b737-cff56b56329f ">
2024-11-16 13:36:13 +02:00
Jason Lee
20eeb78251
chore: Update BranchListDelegate to use WeakView<Workspace> ( #20157 )
2024-11-04 12:17:11 +02:00
Jason Lee and Mikayla Maki
72be8c5d14
gpui: Fix hide, activate method on Windows to hide/show application ( #18164 )
...
Release Notes:
- N/A
Continue #18161 to fix `cx.hide`, `cx.activate` method on Windows to
hide/show application.
## After
https://github.com/user-attachments/assets/fe0070f9-7844-4c2a-b859-3e22ee4b8d22
---------
Co-authored-by: Mikayla Maki <mikayla@zed.dev >
2024-09-30 23:20:24 -07:00
Jason Lee
39be9e5949
gpui: Fix show: false support on Windows to create an invisible window ( #18161 )
...
Release Notes:
- N/A
-
The `show` of WindowOptions is valid on macOS but not on Windows, this
changes to fix it to support create an invisible window.
```bash
cargo run -p gpui --example window
```
## Before
https://github.com/user-attachments/assets/4157bdaa-39a7-44df-bbdc-30b00e9c61e9
## After
https://github.com/user-attachments/assets/d48fa524-0caa-4f87-932d-01d7a468c488
https://github.com/user-attachments/assets/dd052f15-c8db-4a2a-a6af-a7c0ffecca84
2024-09-30 18:25:02 -07:00
Jason Lee
938a0679c0
gpui: Fix img element to auto size when only have width or height ( #17994 )
...
Release Notes:
- N/A
---
We may only want to set the height of an image to limit the size and
make the width adaptive.
In HTML, we will only set width or height, and the other side will adapt
and maintain the original image ratio.
I changed this because I had a logo image that only to be limited in
height, and then I found that setting the height of the `img` alone
would not display correctly.
I also tried to set `ObjectFit` in this Demo, but it seems that none of
them can achieve the same effect as "After".
## Before
<img width="809" alt="before 2024-09-18 164029"
src="https://github.com/user-attachments/assets/7ba559ed-e53b-43e6-a072-93c8ba5b14ee ">
## After
<img width="749" alt="after 2024-09-18 172003"
src="https://github.com/user-attachments/assets/51ee2eba-76b3-400a-abbf-de0e9c4021e2 ">
2024-09-30 16:39:19 -07:00
Jason Lee and Marshall Bowers
345efa4e36
gpui: Fix img element to render correct SVG color ( #15488 )
...
Release Notes:
- N/A
It should convert RGBA to BGRA.
> I added an example color svg, that was I make based on [Lucide grip
icon](https://lucide.dev/icons/grip ).
## Before
<img width="692" alt="image"
src="https://github.com/user-attachments/assets/5eb03606-76ce-4049-b3ad-8d1084a4fa55 ">
## After
<img width="695" alt="image"
src="https://github.com/user-attachments/assets/650dd411-2095-4e92-b3fd-8e91c6954aa3 ">
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-09-17 13:50:36 -04:00
Jason Lee
ee96d69e37
gpui: Fix CJK line wrap for GPUI text render ( #17737 )
...
Release Notes:
- N/A
This changes is going to let GPUI render correct text wrapping for CJK
characters. We was done this in PR #11296 for Editor, but this is also
need support for other text renders.
| Before | After |
| --- | --- |
| <img width="488" alt="SCR-20240912-jtvo"
src="https://github.com/user-attachments/assets/d061669c-62ab-4a7e-a724-2df84815d1ed ">
| <img width="438" alt="image"
src="https://github.com/user-attachments/assets/ec27fd80-69db-48b6-8ade-694cd65d1843 ">
|
2024-09-12 15:55:03 -04:00
Jason Lee
47aec5e64d
Improve popup menu to leave some margin with window edges ( #17159 )
...
Release Notes:
- Improved popup menu to leave some margin with window edges.
## Updates in GPUI
- gpui: Add `snap_to_window_with_margin` method to `anchored` to support
leave margin to window edges.
## Before
<img width="609" alt="before-snap-to-window 2024-08-30 222506"
src="https://github.com/user-attachments/assets/62bb6791-7c89-4558-9484-5c7b31f5e91e ">
## After
<img width="698" alt="snap-to-window1 2024-08-30 222506"
src="https://github.com/user-attachments/assets/51634e79-2a95-42fe-8362-a3c7003648eb ">
<img width="622" alt="snap-to-window 2024-08-30 222506"
src="https://github.com/user-attachments/assets/43a865d6-d238-4fdc-ae9d-8160b9ba7953 ">
2024-09-07 03:05:57 +02:00
Jason Lee
a092ff0c4f
gpui: Add opacity to support transparency of the entire element ( #17132 )
...
Release Notes:
- N/A
---
Add this for let GPUI element to support fade in-out animation.
## Platform test
- [x] macOS
- [x] blade `cargo run -p gpui --example opacity --features macos-blade`
## Usage
```rs
div()
.opacity(0.5)
.bg(gpui::black())
.text_color(gpui::black())
.child("Hello world")
```
This will apply the `opacity` it self and all children to use `opacity`
value to render colors.
## Example
```
cargo run -p gpui --example opacity
cargo run -p gpui --example opacity --features macos-blade
```
<img width="612" alt="image"
src="https://github.com/user-attachments/assets/f1da87ed-31f5-4b55-a023-39e8ee1ba349 ">
2024-09-04 12:53:45 +02:00
Jason Lee
2730d08ff0
docs: Fix shell setting doc ( #17208 )
...
Release Notes:
- N/A
https://github.com/zed-industries/zed/blob/03fd5c90d8901f91e03578ac46a169ef8d997f70/crates/project/src/project.rs#L5210
https://github.com/zed-industries/zed/blob/03fd5c90d8901f91e03578ac46a169ef8d997f70/crates/task/src/lib.rs#L266
2024-09-03 13:19:42 -04:00
Jason Lee
0835d456dc
gpui: Fix text ellipsis appearing even the flex element has space ( #17149 )
...
Release Notes:
- N/A
There was a calculation bug before. When we added `text_ellipsis` to the
flex element, it would always show ellipsis no matter how long it was.
Actually we can't use `flex` and `text_ellipsis` at same time, the CSS
also not support this. But this bug will let user confuse.
### Before
<img width="731" alt="image"
src="https://github.com/user-attachments/assets/b7d60017-6785-45f5-8b40-dd5efa154a1e ">
### After
<img width="521" alt="image"
src="https://github.com/user-attachments/assets/a3117793-284e-48d4-8c15-059fe61abe60 ">
2024-08-30 09:01:46 -04:00
Jason Lee and Marshall Bowers
938d93a64c
gpui: Add truncate and text_ellipsis to TextStyle ( #14850 )
...
Release Notes:
- N/A
Ref issue #4996
## Demo
```
cargo run -p gpui --example text_wrapper
```
https://github.com/user-attachments/assets/a7fcebf7-f287-4517-960d-76b12722a2d7
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-08-23 14:02:51 -04:00
Jason Lee and Marshall Bowers
1982a5aed1
gpui: Improve img element to support load from Assets ( #15482 )
...
Release Notes:
- N/A
Currently, the `img` element provided by GPUI only supports FilePath or
URL, but in actual applications we need to let `img` load an image
embedded in Assets.
The `svg` element can currently support this, but `img` cannot.
For example:
We have such an Assets directory:
```
assets
|- icons
|- images
|--- foo.png
```
```rs
// If give a path, considered an Asset
img("images/foo.png");
// If give a URI, considered a Remote image
img("https://foo.bar/images/foo.png ");
// If give a PathBuf, considered a Local file
img(PathBuf::from("path/to/foo.png"));
```
## Example test
```
cargo run -p gpui --example image
```
<img width="827" alt="image"
src="https://github.com/user-attachments/assets/e45dcf7f-4626-4fb0-aca9-9b6e1045a952 ">
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-07-30 10:55:48 -04:00
Jason Lee
0c8b17d252
Hide blinking cursor when window is deactivated ( #15408 )
...
## Before
https://github.com/user-attachments/assets/affb8407-a20e-4258-a8f7-b271da5d7b77
## After
https://github.com/user-attachments/assets/654fe7b9-330a-40c8-8885-72e69fa85b0a
Release Notes:
- Hide blinking cursor when window is deactivated ([4710](https://github.com/zed-industries/zed/issues/4710 ))
2024-07-30 10:49:15 +03:00
Jason Lee
0a02691778
Fix tooltips sometimes continuously displaying when the button is selected ( #14832 )
...
Release Notes:
- Fixed sometime tooltip will continuously display when the button is
selected.
---
@mrnugget The #13857 This change has led into a bug, the selected item
before tooltip will continuous display if there are no other tooltips.
https://github.com/user-attachments/assets/06b4a9a4-dede-4c18-b020-e20b6090341f
2024-07-19 12:49:08 -06:00
Jason Lee
fb541accb2
gpui: Update Menu name to use SharedString type to support more types ( #14791 )
...
Release Notes:
- N/A
2024-07-19 08:51:31 -04:00
Jason Lee
f1281c14dd
Revert Windows normal window title style to WS_EX_APPWINDOW ( #14132 )
...
Release Notes:
- N/A
@ConradIrwin we must revert this little change.
https://github.com/zed-industries/zed/pull/14063#issuecomment-2221867379
2024-07-10 20:49:55 -06:00
Jason Lee
5bc3846d59
Fix #14106 Windows title bar broken ( #14122 )
...
Release Notes:
- N/A
----
Fix #14106
Sorry, the previous change in #14063 I have made a mistake. I shouldn't
have changed the previous logic.
```diff
- if !state_ptr.hide_title_bar {
+ if state_ptr.hide_title_bar {
```
## Test
https://github.com/zed-industries/zed/assets/5518/e03fbcac-be6b-4a9d-8937-d3b5e236b564
And the popup window limit is still works.
2024-07-10 18:55:51 -06:00
Jason Lee
15662f105e
gpui: Fix TextStyle default font_family crash on Windows, use Segoe UI for Windows ( #14040 )
...
Release Notes:
- Fixed default font_family crash on Windows, use `Segoe UI`.
## Crash error message
```
thread 'main' panicked at crates\gpui\src\text_system.rs:150:9:
failed to resolve font 'Helvetica' or any of the fallbacks:
Zed Plex Mono, Helvetica, Cantarell, Ubuntu, Noto Sans, DejaVu Sans
```
2024-07-10 13:40:42 -06:00
Jason Lee
1887a6db53
gpui: Fix popup kind window support on Windows ( #14063 )
...
Release Notes:
- N/A
----
Continue #14044 for Windows
## The problem
The `cx.open_window` method has provided us a `window_kind` option to
allows creating a Popup kind. This behavior can work on macOS, the popup
kind window have no-border, no-shadow, no-resize, and followed the
`is_movable` if present true it can't move.
This PR to fix those supports on Windows.
The border and shadow still exist, I have tried to use WS_POPUP
window_style, but it will crash:
> This is looks like complex, it is out of my known.
```
Blocking waiting for file lock on build directory
Compiling gpui v0.1.0 (F:\work\zed\crates\gpui)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.96s
Running `target\debug\examples\window_positioning.exe`
thread 'main' panicked at F:\Users\jason\.cargo\git\checkouts\blade-b2bcd1de1cf7ab6a\21a56f7\blade-graphics\src\vulkan\init.rs:864:18:
called `Result::unwrap()` on an `Err` value: ERROR_OUT_OF_DEVICE_MEMORY
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\examples\window_positioning.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
```
So I just make a simple change, to use `WS_EX_TOOLWINDOW` this can
disable resize, and connect `is_movable` to `handle_hit_test_msg` to
disable move, and also no Status Bar icon.
## Before
https://github.com/zed-industries/zed/assets/5518/76740a71-e0ba-401f-958d-f4afdeb417c6
## After
https://github.com/zed-industries/zed/assets/5518/dca49f13-914c-425a-b8b6-b9fc15f8d208
2024-07-10 13:39:54 -06:00
Jason Lee
b693cbfcb7
Fix line wrap for CJK characters ( #11296 )
...
Release Notes:
- Fixed line wrap for CJK characters.
## Demo
https://github.com/zed-industries/zed/assets/5518/c6695bb4-b170-4ce0-9a84-c36b051de438

Fix issues: #4623 #11202
### Render case
```
## fr
Bien démarrer avec la documentation GitHub Découvrez comment commencer à créer, à livrer et à gérer des logiciels avec GitHub. Explorez nos produits, inscrivez-vous pour obtenir un compte et connectez-vous à la plus grande communauté de développement du monde.
## zh
GitHub 入门文档 了解如何开始构建、运输和维护具有 GitHub 的软件。 了解我们的产品,注册一个帐户,与世界上最大的发展社区建立联系。
## es
Documentación sobre la introducción a GitHub Aprende cómo comenzar a crear, enviar y mantener software con GitHub. Explora nuestros productos, regístrate para una cuenta y conéctate con la comunidad de desarrollo más grande del mundo.
## kr
GitHub 설명서 시작 GitHub를 사용하여 소프트웨어 빌드, 납품 및 유지 관리를 시작하는 방법을 알아봅니다. 제품을 탐색하고, 계정에 등록하고, 세계 최대의 개발 커뮤니티와 연결합니다.
## ja
GitHub の概要に関するドキュメント GitHub を使用してソフトウェアの構築、出荷、および保守を始める方法を学びます。 当社の製品を探索し、アカウントにサインアップして、世界最大の開発コミュニティと繋がりましょう。
## pt
Documentação de introdução ao GitHub Aprenda a começar a criar, enviar e manter um software com a GitHub. Explore nossos produtos, inscreva-se em uma conta e conecte-se com a maior comunidade de desenvolvimento do mundo.
## ru
Начало работы с документацией по GitHub Узнайте, как начать создание, доставку и обслуживание программного обеспечения с помощью GitHub. Изучите наши продукты, зарегистрируйте учетную запись и присоединитесь к крупнейшему в мире сообществу разработчиков.
```
2024-07-10 13:10:19 -06:00
Jason Lee
d4ddc4c62c
gpui: Fix cx.bounds, cx.open_window position on macOS ( #14044 )
...
Release Notes:
- gpui: Fixed `cx.bounds` method to get correct `y` position on macOS.
- gpui: Fixed `cx.open_window` position when macOS Dock is existed.
- Fixed call notification and reopen window position.
## Before

https://github.com/zed-industries/zed/assets/5518/ab925779-4253-4b27-9084-01023888087f
## After
<img width="533" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/142e9aaa-ae82-4a72-9acf-04097c545bf0 ">
https://github.com/zed-industries/zed/assets/5518/8793824a-8b74-4913-8204-7b39649aeeed
---
The case is I have made a Popover by use child window, the coordinate of
the window is always can't placement a right position.
So, I make this example to test the `cx.bounds` and set bounds to
window.
---
By this test, is the `cx.bounds` have a bug?
For example the **Top Left** window, we give it origin (150,150), but it
`cx.bounds()` returns (150,262)
> On the window label, middle line is the `bounds` that we set to the
window, last line is `cx.bounds()` result.
Display 1:
<img width="1512" alt="CleanShot 2024-07-10 at 14 52 26@2x"
src="https://github.com/zed-industries/zed/assets/5518/3adf9e79-f237-431a-a72b-02face7b2361 ">
---
Or is there something I missed. Is it correct to use `cx.bounds` method
to get the bounds of the current window?
At the same time, I also found that when there are multiple screens, the
information obtained by cx.bounds is very different on different
screens, and it seems that the origin is not relative to the screen.
Display 2:
<img width="2560" alt="SCR-20240710-nkmq"
src="https://github.com/zed-industries/zed/assets/5518/d87d4151-0562-4bf8-b3b3-5da3b4d09d82 ">
2024-07-10 09:52:33 -06:00
Jason Lee
ae414e21f0
gpui: Fix hide titlebar on Windows, with titlebar: None option ( #13975 )
...
Release Notes:
- N/A
Ref the macOS Window:
When the `titlebar` is none, the titlebar should be hidden.
https://github.com/zed-industries/zed/blob/adaa4831766cde63b408909cf65cdeb1641e5888/crates/gpui/src/platform/mac/window.rs#L516-L528
```
cargo run -p gpui --example window_positioning
```
## Before

## After
<img width="466" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/176ce4ea-14e9-44c8-8f2d-01e20ff3e543 ">
2024-07-09 12:04:55 -07:00
Jason Lee
6cedfa0ce7
example: Fix Input example mistake ( #13574 )
...

Release Notes:
- N/A
2024-06-27 11:28:44 +03:00
Jason Lee
d501a877a0
windows: Improve file_finder to support match with unix style path ( #12357 )
...
Release Notes:
- Improved file_finder to support match with Unix style path.
Sometimes we may get the Unix style path string, for example the result
of `git status`:
```bash
$ git status
On branch improve-file-finder-match-unix-paths
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: crates/file_finder/src/file_finder.rs
```
For example, from GitHub page:
<img width="760" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/c6fe8d8a-839e-4eef-a162-43b1dde09593 ">
If we copy that path to file_finder, it will not match any files on
Windows.
## Before
<img width="699" alt="屏幕截图 2024-05-28 001037"
src="https://github.com/zed-industries/zed/assets/5518/2d2d729e-7d27-421b-9a38-cfe4e53cc033 ">
## After
Use Unix style path:
<img width="689" alt="屏幕截图 2024-05-28 001150"
src="https://github.com/zed-industries/zed/assets/5518/e82dc8d6-bd6c-4b78-bd91-5b5210da73c4 ">
Use Windows style path:
<img width="629" alt="屏幕截图 2024-05-28 001302"
src="https://github.com/zed-industries/zed/assets/5518/4892019e-b2f4-41aa-bbf7-2f5f8af7aafa ">
2024-06-20 11:33:49 -07:00
Jason Lee and Thorsten Ball
ae55d35f19
windows: Fix project prepare_ssh_shell to support setting PATH on Windows ( #12370 )
...
Release Notes:
- N/A
Update to use `std::env::join_paths` to prepare `PATH` env.
Ref
https://github.com/zed-industries/zed/pull/12087#issuecomment-2122852384
@mrnugget
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com >
2024-06-03 11:57:50 +02:00
Jason Lee and Piotr Osiewicz
3c6c850390
task: Add re-run task button to terminal title ( #12379 )
...
Release Notes:
- Added re-run task button to terminal title.
Close #12277
## Demo
https://github.com/zed-industries/zed/assets/5518/4cd05fa5-4255-412b-8583-68e22f86561e
---------
Co-authored-by: Piotr Osiewicz <piotr@zed.dev >
2024-05-29 11:40:43 +02:00
Jason Lee
8c8c1769c7
docs: Fix quote in default.json ( #11900 )
...
Release Notes:
- N/A
2024-05-16 12:46:08 +02:00
Jason Lee
6df1bc85aa
Fix runnable, code_actions button can not trigger when editor not focused ( #11729 )
...
## Before
https://github.com/zed-industries/zed/assets/5518/546450fc-ad2c-45d0-8bdb-7b15cfebe235
## After
https://github.com/zed-industries/zed/assets/5518/efc4f863-9db1-4846-83ae-c99ae4dcb3ed
Release Notes:
- Fixed code actions/runnable buttons not triggering when editor is not focused.
2024-05-13 11:02:15 +02:00
Jason Lee and Marshall Bowers
5e06ce4df3
Add zip extract support for Windows ( #11156 )
...
Release Notes:
- [x] Fixed install Node.js runtime and NPM lsp installation on Windows.
- [x] Update Node runtime command to execute on Windows with no window
popup.
Ref #9619 , #9424
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-05-09 09:23:21 -04:00
Jason Lee and Marshall Bowers
beee79a9e7
toml: Fix language server installation on Windows ( #11251 )
...
Release Notes:
- N/A
---
Follow #11156 , to make sure extensions install on window.
https://github.com/tamasfe/taplo/releases/tag/0.8.1
The Taplo have `gz` for windows, so we can just use `gz`.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-05-03 11:11:46 -04:00
Jason Lee
7065da2b98
Fix project-panel double click file support on Windows ( #10917 )
...
Release Notes:
- Fixed project panel double click to force open file on Windows.
Ref issue: #10898
@bennetbo
I saw you was also used `event.down.click_count` in Markdown Preview.
https://github.com/zed-industries/zed/commit/7dccbd8e3b61c48ae174807a4023332b7c1df06a#diff-c8d1735cb347ea08d03198df112343ec50a74de8d50414a6f3be6c6d674c6d19R161
And this also used in other place:
<img width="870" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/b844e700-b95f-4cd2-987f-9e4305ebdd7c ">
## Test demo after updated
Looks like it is no side effect

2024-04-25 10:01:24 -07:00
Jason Lee
0861ceaac2
Add yield keyword highlight for Rust ( #10104 )
...
Release Notes:
- Added `yield` keyword highlight for Rust
Ref:
- https://github.com/rust-lang/rust-analyzer/pull/7209
-
https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/syntax_highlighting/highlight.rs#L177
-
https://doc.rust-lang.org/reference/keywords.html?highlight=yield#reserved-keywords
In VS Code:

docs.rs:
https://docs.rs/async-stream/latest/async_stream/macro.try_stream.html

## Before
<img width="644" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/da349187-57e6-4cea-b3e3-f628ce6a99e8 ">
## After update in Zed

2024-04-04 17:56:33 +02:00
Jason Lee
8eeecdafec
Add crate keyword to Rust ( #10110 )
...
Release Notes:
- Fixed `crate` keyword not being highlighted in Rust files.
Ref: #10104
And I make a sort for them.
2024-04-03 17:27:22 +02:00
Jason Lee
0ce5cdc48f
Only allow opening one Extensions view ( #9569 )
...
Release Notes:
- Changed the extensions view to only allow one open instance at a time.
## Before
<img width="494" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/9329e685-1946-4384-bec3-f7eadf18a0cc ">
2024-03-20 14:49:36 -04:00
Jason Lee and Marshall Bowers
269d2513ca
Add support for applying theme after extension is installed ( #9529 )
...
Release Notes:
- Added support for opening the theme selector with installed themes
after installing an extension containing themes.
([#9228 ](https://github.com/zed-industries/zed/issues/9228 )).
<img width="1315" alt="Screenshot 2024-03-20 at 11 00 35 AM"
src="https://github.com/zed-industries/zed/assets/1486634/593389b3-eade-4bce-ae17-25c02a074f21 ">
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-03-20 11:13:58 -04:00
Jason Lee
5abcc1c3c5
Let LineColumn on StatusBar as clickable to open GoToLineColumn ( #9002 )
...
Release Notes:
- Added to let LineColumn on StatusBar as clickable to open
GoToLineColumn.
- Added placeholder to GoToLineColumn input, and show help message on
input changed.
## Screenshot

2024-03-08 14:11:17 -07:00
Jason Lee
bc7fb9f253
Show tooltip with item paths for recent project picker items ( #8987 )
...
Before

After

Release Notes:
- Fixed empty tooltip for recent projects picker items
2024-03-07 17:35:48 +02:00
Jason Lee
2f15676b7c
Update App Menus to add ... for some modal action menu, and group menu items by type. ( #8951 )
...
Release Notes:
- Improved App Menu, add `...` for modal action menu, and group menu
items by type.
In macOS and Windows, the `...` suffix of menu item, is means that will
open a dialog.
2024-03-06 12:10:09 -05:00
Jason Lee
4a60326c1c
Remove workspace border, avoid the main window having double borders ( #8922 )
...
Release Notes:
- Fixed main window border, avoid double borders.
## Diff (Left is Before, Right is After)


Reference to Safari:

## More Theme tests




2024-03-06 10:03:59 -05:00
Jason Lee
567fee4219
Update Project search to Project Search. ( #8943 )
...
Release notes:
- N/A
2024-03-06 15:23:55 +01:00
Jason Lee
0b34b1de7b
Fix first/last item margin on scroll ( #8880 )
...

Before:
https://github.com/zed-industries/zed/assets/5518/f7a4563a-504a-4a41-bfd4-21e9439cd02b
After:
https://github.com/zed-industries/zed/assets/5518/0ba41527-46fd-404f-8207-1b8c5cf37434
Release Notes:
- Fixed first and last item margin when scroll view has padding
2024-03-05 15:54:48 +02:00
Jason Lee
fae5e83d93
Fix all Picker Item cursor to use Pointer. ( #8877 )
...
Before:
https://github.com/zed-industries/zed/assets/5518/84874858-7847-4fa4-b7a3-41ecc65a2f7d
After:
https://github.com/zed-industries/zed/assets/5518/d395ea96-aa26-4de1-8bfc-73cc43ee75cf
Release Notes:
- Made picker items to use `Pointer` cursor style
2024-03-05 11:32:57 +02:00
Jason Lee
6a268e959f
Improve VCS Menu header top margin. ( #8879 )
...
## Before


## After


Release Notes:
- Improve VCS Menu header top margin, and use `TextMuted` color for
matched count label.
2024-03-05 10:19:52 +01:00
Jason Lee
538298378a
Return "open in new window" as default in recent projects ( #8798 )
...
https://github.com/zed-industries/zed/assets/5518/8bbd13a7-9144-48b0-9bc8-6651725476f8
Closes https://github.com/zed-industries/zed/issues/8651
Reworks `recent_projects::OpenRecent` action with collab projects in mind:
* keep the "open in new window" behavior for corresponding menu and command entries
* use new, "reuse current window" behavior in the recent projects picker up in the toolbar
This way, old Zed behavior is not customizable, kept as original in all main use cases — so that projects shared via remote entities: a channel and a call, are never accidentally closed, breaking the sharing.
Release Notes:
- Return "open in new window" as default in recent projects
2024-03-04 11:42:30 +02:00
Jason Lee
47bcb305af
Use Pointer cursor style on Recent Projects, VCS Menu. ( #8595 )
...
Release Notes:
- Improved to use `Pointer` style cursor on VCS and Recent Projects
menu.
https://github.com/zed-industries/zed/assets/5518/4f638c6a-00b8-4fa8-b469-4d3109827bc2
2024-02-29 12:27:56 +01:00
Jason Lee and Marshall Bowers
225dd0f9a0
Improve extensions UI detail ( #8578 )
...
Release Notes:
- Improved "Extensions" UI details to tidy layout, add border, add
placeholder to search input.
## Before

## After



---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-02-28 22:34:40 -05:00
Jason Lee
aff858bd00
Added a cmd-backspace keybinding to delete files in the project panel. ( #8163 )
...
Fixes #7228
Release Notes:
- Added a `cmd-backspace` keybinding to delete files in the project panel ([7228](https://github.com/zed-industries/zed/issues/7228 ))
2024-02-22 12:59:01 +02:00
Jason Lee and Marshall Bowers
e7fcddff69
Parse version from GitHub tag name instead of release name ( #7423 )
...
If we not change this, some release will parse error.
https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28
```json
{
"name": {
"type": [
"string",
"null"
]
}
}
```
<img width="1188" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/bd53dbc4-ae2c-4f19-afd7-58e70b4f87d8 ">
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com >
2024-02-08 15:28:51 -05:00