Commit graph

447 commits

Author SHA1 Message Date
Nathan Sobo
5f8417249c
Return impl IntoElement in Render and RenderOnce traits (#3839)
- Returning `IntoElement` because it's more universal than `Element` and
allows us to easily return components.
- Using `impl IntoElement` in `RenderOnce` for consistency, which
requires `Component` to allocate an `AnyElement`. We use a bump
allocated arena anyway for these, and my benchmark doesn't show an
impact.


![frame-time-histogram](https://github.com/zed-industries/zed/assets/1789/d3889cca-9ebc-4d72-aa68-34a5be3bad3c)

In this histogram, frames-0 is this PR, frames-1 is main.

Release Notes:

- N/A
2024-01-03 10:37:26 -07:00
Marshall Bowers
092eb37a71 Tweak styling for inline documentation labels
Co-Authored-By: Julia <julia@zed.dev>
2024-01-03 11:44:17 -05:00
Marshall Bowers
231fd1c5c0 Clip completion labels when they would otherwise overflow their container
Co-Authored-By: Julia <julia@zed.dev>
2024-01-03 11:41:15 -05:00
Marshall Bowers
f4f9aab8a9 Remove text_ui
So we don't regress from #3852.
2024-01-03 10:56:51 -05:00
Piotr Osiewicz
406edd279a Merge branch 'main' into refine-render-traits 2024-01-03 12:27:42 +01:00
Julia
1810824bc4 Merge branch 'main' into completion-menu-detail-layout 2024-01-02 22:46:13 -05:00
Max Brunsfeld
75acb4918c Use buffer font size for diagnostic headers
Co-authored-by: Nathan <nathan@zed.dev>
2024-01-02 17:14:32 -08:00
Max Brunsfeld
4b006ccd5b Use buffer font size for editor overlays and blocks
Co-authored-by: Nathan <nathan@zed.dev>
2024-01-02 15:55:56 -08:00
Marshall Bowers
ce5855da2f Render completion menu items using ListItems 2024-01-02 17:03:02 -05:00
Marshall Bowers
93a818d018
Add additional status colors and style diagnostic popovers (#3846)
This PR adds additional background and border colors for each of the
status colors to the theme.

These colors are then used to style the diagnostic popovers:

<img width="407" alt="Screenshot 2024-01-02 at 4 25 50 PM"
src="https://github.com/zed-industries/zed/assets/1486634/fbc64ea7-3dcd-43b7-8520-91f16304bfba">

<img width="396" alt="Screenshot 2024-01-02 at 4 26 05 PM"
src="https://github.com/zed-industries/zed/assets/1486634/6e4a44bf-4aac-4595-afff-7fbf8b2b9e1f">

Release Notes:

- N/A
2024-01-02 16:37:55 -05:00
Julia
ae71d1ad5d Layout completion single-line documentation to the right of item 2024-01-02 15:56:35 -05:00
Nathan Sobo
1b5c8b2b4a Return impl IntoElement from Render::render trait 2024-01-02 10:09:05 -07:00
Nathan Sobo
47071605a1 Merge remote-tracking branch 'origin/main' into new-view-new-model-rename 2024-01-01 17:42:12 -07:00
Nathan Sobo
db1cf8f6e1 Rename build_view to new_view and build_model to new_model
The word "new" is shorter and blends in with `new` constructors that are common
in Rust. Been meaning to do this for a while.
2024-01-01 17:42:01 -07:00
Nathan Sobo
bcf0e3fb05 Merge branch 'pre-merge' into clean-up-doc-elements 2024-01-01 12:21:33 -07:00
Nathan Sobo
51d1d92d66 Attempt to return impl Element from render. 3 errors. 2024-01-01 14:23:02 +01:00
Nathan Sobo
83923fd6d5 Clean up Element API and start on docs 2023-12-31 08:33:40 -07:00
Piotr Osiewicz
904358263c
Remove #[allow(unused)] annotations in zed2 crates (#3798)
Release Notes:

- N/A
2023-12-25 12:23:44 +01:00
Marshall Bowers
698460ea89
Style inlay hints (#3806)
This PR styles the inlay hints after the changes to the themes.

Release Notes:

- N/A
2023-12-22 23:06:30 -05:00
Kirill Bulatov
e1d8e2001b
Properly color file labels in project panel (#3794)
Also fixes an error with mouse listeners placement in
https://github.com/zed-industries/zed/pull/3792

Release Notes:

- N/A
2023-12-23 02:01:55 +02:00
Marshall Bowers
3213a860a6
Use extra small label for tab descriptions (#3797)
This PR adjusts the size of the tab descriptions to use the extra small
label size.

This makes it easier to distinguish between the filename and the
description:

<img width="320" alt="Screenshot 2023-12-22 at 6 49 11 PM"
src="https://github.com/zed-industries/zed/assets/1486634/451d4cd0-666c-43c2-b5df-6d9cf91dacda">

It's also more in line with how things look in Zed1.

Release Notes:

- N/A
2023-12-22 18:56:17 -05:00
Kirill Bulatov
c6f3f439c4 Fix mouse listeners' z-index for editor 2023-12-23 01:55:40 +02:00
Marshall Bowers
1ebfafc03d
Map additional text colors from Zed1 themes (#3796)
This PR maps additional text colors from the Zed1 themes to the Zed2
themes.

Release Notes:

- N/A
2023-12-22 18:45:58 -05:00
Kirill Bulatov
764a2755e2 Fix multibuffer scroll by reordering z-index of its elements
1. Blocks (with their headers) and mouse listeners should be drawn together otherwise either starts to loose mouse events.

2. Scrollbar should be above all to match zed1 look and avoid buffer headers popping slightly to the right of the scrollbar.
2023-12-22 22:56:35 +02:00
Antonio Scandurra
62aea418de
Fix panic in completions menu (#3778)
We were shifting all the positions while keeping the original string,
which caused problems later when combining highlighted ranges with
matched indices.

Release Notes:

- N/A
2023-12-22 12:27:52 +01:00
Antonio Scandurra
a551647ec1 Fix panic in completions menu
We were shifting all the positions while keeping the original
string, which caused problems later when combining highlighted
ranges with matched indices.
2023-12-22 12:12:39 +01:00
Kirill Bulatov
4d5ff77abe Fix the tests 2023-12-22 12:14:53 +02:00
Kirill Bulatov
d36ec81725 Move multibuffer "go to file" button into the buffer header
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-22 12:02:44 +02:00
Kirill Bulatov
fce31b7ddf Remove the warnings from element.rs 2023-12-22 12:02:44 +02:00
Marshall Bowers
3d1e52297e
Scale down status bar items (#3766)
This PR scales down the sizes of items in the status bar.

This brings us more in line with Zed1.

Release Notes:

- N/A
2023-12-21 17:42:54 -05:00
Nathan Sobo
4680aad885
Correctly compute placeholder text for buffer search query editor (#3749)
Rather than relying on the focused element, instead explicitly pass the
focus handle for the query editor when determining the prev/next
bindings. Only compute these values once.

Release Notes:

- N/A
2023-12-20 20:48:31 -07:00
Nathan Sobo
d499cccebb Only compute placeholder text once 2023-12-20 14:47:56 -07:00
Nathan Sobo
9acb5825e6 Compute the query editor placeholder text with a focus handle
So we're not beholden to the current focus.
2023-12-20 13:00:52 -07:00
Kirill Bulatov
75074c3297 Apply more fixes to the visual part 2023-12-20 18:23:08 +02:00
Antonio Scandurra
5781cf6604 Use InteractiveBounds everywhere we change the cursor style 2023-12-20 13:59:52 +01:00
Max Brunsfeld
71d17e268d
Fix layout of diagnostic blocks (#3729)
Previously, all of the lines in a multi-line error message were painted
on top of each other. I also simplified the logic for highlighting
backtick-enclosed ranges in a diagnostic message.
2023-12-19 15:49:56 -08:00
Max Brunsfeld
3fccc648d6 Fix layout of diagnostic blocks 2023-12-19 15:41:00 -08:00
Marshall Bowers
a0224b975b Use link_text_hover for go-to-definition links 2023-12-19 18:24:52 -05:00
Julia
ef39382c84
Allow editor mouse drag selection outside interactive bounds (#3716)
Release Notes:

- N/A
2023-12-19 13:07:31 -05:00
Julia
961f989388
Match zed1 scrollbar drag behavior (#3715)
Still not ideal, but we need to ship and this is more than reasonable

Release Notes:

- N/A
2023-12-19 13:00:26 -05:00
Julia
e08fc0bbc0 Allow editor mouse drag selection outside interactive bounds
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 13:00:21 -05:00
Julia
51396344a3 Match zed1 scrollbar drag behavior
Still not ideal, but we need to ship and this is more than reasonable

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 12:50:06 -05:00
Max Brunsfeld
e655d2434a Don't stop propagation on mouse move over editor gutter 2023-12-19 09:02:25 -08:00
Antonio Scandurra
b30fd3f574 Fix janky editor scrollbar dragging
We can receive multiple events before computing the next frame, and
in that case we want to compute a drag delta between the position for the
previous mouse event and the current one.
2023-12-19 15:32:42 +01:00
Marshall Bowers
5900b815e1
Remove unimplemented toggling for project search entries (#3695)
This PR removes the unimplemented toggling of search results in the
project search.

This is new functionality that didn't exist in Zed1, and it's likely
that we won't be adding it before launch, so removing it for now.

Release Notes:

-  N/A
2023-12-18 12:53:08 -05:00
Nate Butler
7af0edf5b6
Editor UI Cleanup (#3676)
[[PR Description]]

TODO: 
- [x] Style fold marker
- [x] Editor - Code action icon too large, should use muted color,
should have tooltip
- [ ] Style inline assistant
    - Prompt text gets cut off veritcally
- [x] Line height on inline assist editor isn't tall enough
- Nate: This is my fault due to the line height (relative: 1) we are
setting on non-buffer editors. I'll look into this.
- [ ] Style diagnostic hover (right now it's an opaque box on some
themes)
    - Nate: This needs status tints, we are working on it
- [ ] Hovering over a symbol shows a dialogue that appears underneath
the scroll-bar

Release Notes:

- N/A
2023-12-15 15:49:55 -05:00
Nate Butler
e71f2b49e8 Style fold control 2023-12-15 15:41:53 -05:00
Mikayla
b4135dd2f1
Fix editor mouse event dispatch 2023-12-15 10:26:41 -08:00
Nate Butler
4cb0f60779 Update size of code action indicator and show when active 2023-12-15 12:29:33 -05:00
Nate Butler
83525bf142 Revert change to single line editor height 2023-12-15 12:22:33 -05:00