Commit Graph

12413 Commits

Author SHA1 Message Date
Max Brunsfeld
c81e89a4f4 Ensure that new view observers are called by WindowContext::replace_root_view 2023-12-19 17:04:42 -08: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
Julia
0390fb1449 Reintroduce LSP diagnostic/status message
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 18:38:25 -05:00
Marshall Bowers
afcf6c6852 Map textLink.activeForeground from VS Code to link_text_hover 2023-12-19 18:29:27 -05:00
Marshall Bowers
a0224b975b Use link_text_hover for go-to-definition links 2023-12-19 18:24:52 -05:00
Marshall Bowers
53b76e3e4d
Style pane drop targets (#3726)
This PR styles the pane drop targets using the `drop_target_background`
color from the theme.

We do have to adjust the alpha channel of the color so that it doesn't
obscure the contents of the buffer.

Release Notes:

- N/A
2023-12-19 18:06:21 -05:00
Marshall Bowers
547ad77243
Style tab drop targets for project entries (#3725)
This PR styles the drop targets when dragging a project entry onto a tab
or the tab bar.

I also adjusted the existing tab drop targets to use the
`drop_target_background` from the theme.

Release Notes:

- N/A
2023-12-19 17:45:42 -05:00
Max Brunsfeld
599ec5c25b
Make collab panel usable from the keyboard, add missing styling (#3724)
* allow confirming all items via the keyboard
* allow deploying the channel context menu via the keyboard
* add missing selected styling for list items
2023-12-19 14:33:56 -08:00
Max Brunsfeld
afd3bf7746 Add missing selected state and keyboard action for some collab panel items 2023-12-19 14:16:44 -08:00
Max Brunsfeld
901795bcb9 Don't reset the collab panel when it loses focus 2023-12-19 14:12:29 -08:00
Kirill Bulatov
acbb3f39f6
Better display items from different sources with different z-indices in the same place (#3723) 2023-12-20 00:01:37 +02:00
Kirill Bulatov
cf12d62fc5 Tidy up z-index handling
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 23:50:42 +02:00
Marshall Bowers
097640e7c5
Fix typo in ButtonCommon doc comment (#3722)
This PR fixes a small typo in the doc comments for `ButtonCommon`.

Was waiting to roll this up into another PR, but it never ended up
happening.

Release Notes:

- N/A
2023-12-19 16:32:57 -05:00
Kirill Bulatov
f6d31917c1 Optimize stack id in-memory layout 2023-12-19 23:31:17 +02:00
Kirill Bulatov
8f1c5375ef Fix more z-index and rendering issues
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 23:30:17 +02:00
Kirill Bulatov
825a8f0927 Initial fix of the z-index
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-12-19 23:29:08 +02:00
Marshall Bowers
a9fe108dbb
Fix typo in "Quote Selection" tooltip (#3721)
This PR fixes a typo in the "Quote Selection" tooltip.

Release Notes:

- N/A
2023-12-19 16:21:58 -05:00
Marshall Bowers
7bc9319871
Apply padding at the toolbar level (#3720)
This PR adjusts the padding in the toolbar to be applied within the
toolbar itself.

Previously the different elements within the toolbar were applying their
own padding, which led to inconsistencies.

Release Notes:

- N/A
2023-12-19 16:01:03 -05:00
Max Brunsfeld
407478d411
Add missing collab panel features (#3719)
* channel modal
* channel invites in collab panel
2023-12-19 12:16:01 -08:00
Max Brunsfeld
a9b1273e2b Clean up commented code
Co-authored-by: Nathan <nathan@zed.dev>
2023-12-19 12:06:47 -08:00
Max Brunsfeld
1c3698ae20 Implement channel modal
Co-authored-by: Nathan <nathan@zed.dev>
2023-12-19 12:02:35 -08:00
Marshall Bowers
4e07167288
Use child instead of children (#3718)
This PR refactors some code where we were using `children` when we could
have used `child` instead.

Release Notes:

- N/A
2023-12-19 13:49:52 -05:00
Max Brunsfeld
80b6922de7 wip 2023-12-19 10:20:40 -08:00
Max Brunsfeld
a4bfd0147d Render channel invites in collab panel, fix unused warnings 2023-12-19 10:20:40 -08:00
Marshall Bowers
a3bab25792
Style contact finder (#3717)
This PR styles the contact finder.

<img width="598" alt="Screenshot 2023-12-19 at 12 59 00 PM"
src="https://github.com/zed-industries/zed/assets/1486634/ca9d9345-bf27-4256-aabc-6017a0c4d217">

Release Notes:

- N/A
2023-12-19 13:16:14 -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
Nate Butler
e778e17f54
Style assistant panel (#3711)
[[PR Description]]

Styles most of the assistant panel. A few notes:

- We now cut off the title if it gets to long so the assistant tools
don't get cut off
- I wasn't able to get to the "no api key" state, so that hasn't been
style checked yet.
- A few of icons were updated in this PR

I also added a new tooltip that teaches you a bit about role cycling:

![CleanShot 2023-12-19 at 12 08
15@2x](https://github.com/zed-industries/zed/assets/1714999/89dcdcc0-9ef9-4527-94a2-6146b5f127f2)

🐜 Known issues 🐜

- There is a bug where zooming the panel makes it shift 1px (@maxdeviant
I think this has to do with panel borders)
- We are showing a timestamp for new conversations before you have sent
a message/launched an assist action. I wasn't sure how to case this out.

Before:

![CleanShot 2023-12-19 at 12 06
17@2x](https://github.com/zed-industries/zed/assets/1714999/16154add-a7f4-455a-a5c5-706847e012a2)

![CleanShot 2023-12-19 at 12 05
00@2x](https://github.com/zed-industries/zed/assets/1714999/a6d325ec-59c2-41b3-ad82-6cf88f2f70a0)

After:

![CleanShot 2023-12-19 at 12 05
37@2x](https://github.com/zed-industries/zed/assets/1714999/aaa4668e-b361-411a-8865-1989bd1c3ae1)

![CleanShot 2023-12-19 at 12 05
52@2x](https://github.com/zed-industries/zed/assets/1714999/0c6a9970-56ab-43cc-9394-fd3f6bf0ed6a)


Release Notes:

- N/A
2023-12-19 12:11:18 -05:00
Marshall Bowers
616ea131af
Style buffer search input (#3713)
This PR styles the text input for the buffer search.

Release Notes:

- N/A
2023-12-19 12:11:06 -05:00
Nate Butler
5d95e13cc8 Update assistant editor 2023-12-19 12:04:01 -05:00
Max Brunsfeld
e655d2434a Don't stop propagation on mouse move over editor gutter 2023-12-19 09:02:25 -08:00
Nate Butler
d8eea949ef Update assistant panel message header, model switcher 2023-12-19 11:58:20 -05:00
Nate Butler
a1085184a1 use to_string to return the format distance string from FormatDistance 2023-12-19 11:57:57 -05:00
Max Brunsfeld
cf037ea4a8 Merge branch 'main' into fix-panel-resize 2023-12-19 08:55:55 -08:00
Nate Butler
d8a8feb45c Add FormatDistance struct, add hide_prefix option 2023-12-19 11:41:14 -05:00
Marshall Bowers
3e6b84a726
Wire up the middle mouse button to close tabs (#3714)
This PR wires up the middle mouse button to close tabs.

Right now we're doing this using `on_mouse_down`, but we need a way in
GPUI2 to have an `on_click` for a mouse button other than the left one.

Release Notes:

- N/A
2023-12-19 11:26:55 -05:00
Nate Butler
79653d2175 Rename format distance test names 2023-12-19 11:19:18 -05:00
Nate Butler
ae313ff830 Allow format_distance to take a DateTimeType 2023-12-19 11:16:59 -05:00
Nate Butler
30b01b9bc0 Update imports, tab height const 2023-12-19 11:03:08 -05:00
Nate Butler
286f654517 Update assistant header 2023-12-19 10:57:36 -05:00
Nate Butler
57efaa92cf Style assistant header, update icons 2023-12-19 10:30:46 -05:00
Antonio Scandurra
dd84993d76 Maintain scroll position in CollabPanel after updating entries
Co-Authored-By: Julia <julia@zed.dev>
2023-12-19 16:06:00 +01:00
Nate Butler
42a02e4fb6 Remove red border 2023-12-19 10:03:59 -05:00
Nate Butler
2c402f9b5d Ensure conversation items fill the container 2023-12-19 10:03:26 -05:00
Nate Butler
49502af4d3 Update conversation item rendering 2023-12-19 09:56:29 -05: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
Antonio Scandurra
afbc61a344 Prevent default when mousing down on a button that responds to clicks
This ensures that ancestors that track focus don't accidentally steal
it on mouse down, which was preventing the editor from deploying the
code actions menu.
2023-12-19 14:27:19 +01:00
Antonio Scandurra
02e53025f3 Track caller on h_stack and v_stack 2023-12-19 14:26:30 +01:00
Antonio Scandurra
ae32706cfe Fix tests 2023-12-19 11:04:32 +01:00
Antonio Scandurra
ba0d7e35bb Set window edited 2023-12-19 10:26:06 +01:00
Kirill Bulatov
4b74f30d0a Properly restore termina current dir when deserializing the project 2023-12-19 06:44:26 +02:00
Max Brunsfeld
2979eb9da9 Allow transparent divs to be considered "top layers"
This changes the meaning of `was_top_layer` so that it is checking that
nothing opaque is on top of the given layer. The layer in question
need not be opaque.
2023-12-18 18:32:08 -08:00
Max Brunsfeld
b88370d5ad Respect a div's own z-index when adding its event listeners 2023-12-18 18:02:19 -08:00
Max Brunsfeld
ee8e1454fc Fix drag and drop logic in div's mouse handling
* Attach mouse up and mouse move listeners immediately, not just when there
  is already a drag in progress, because when starting a drag, these other
  events may fire before the next frame.
* Remove bounds checks for handling mouse move and mouse events, since a
  dragged object may be moved outside of its original container.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-12-18 16:17:56 -08:00
Max Brunsfeld
e6f3731efd Fix position of right dock handle
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-12-18 16:05:54 -08:00
Marshall Bowers
91f1be213b
Style project share notification (#3706)
This PR styles the project share notification, so we're not staring a
red rectangle.

<img width="425" alt="Screenshot 2023-12-18 at 6 06 14 PM"
src="https://github.com/zed-industries/zed/assets/1486634/7ae9a2d3-d5d9-427c-9125-3a47df5f6a2f">

Release Notes:

- N/A
2023-12-18 18:13:09 -05:00
Marshall Bowers
912f7e6c1a
Add ability to warn on missing theme values (#3705)
This PR adds the ability to warn in the `theme_importer` when a theme is
missing values.

Providing the `--warn-on-missing` flag to the `theme_importer` will
print a warning for missing theme value when printing the theme.

```sh
cargo run -p theme_importer -- --warn-on-missing
```

Release Notes:

- N/A
2023-12-18 17:18:49 -05:00
Marshall Bowers
734bbfa66f
Use status colors for contact availability indicators (#3704)
This PR updates the availability indicators in the contact list to use
the status colors from the theme.

Release Notes:

- N/A
2023-12-18 16:56:44 -05:00
Marshall Bowers
64ceb61aa3
Add pane dividers (#3703)
This PR adds dividers between panes in a split.

Release Notes:

- N/A
2023-12-18 16:32:51 -05:00
Nate Butler
6da0fa98e2
Add toolbar spacing (#3702)
[[PR Description]]

Release Notes:

- N/A
2023-12-18 16:18:53 -05:00
Nate Butler
a286ec4650 Update toolbar.rs 2023-12-18 16:10:13 -05:00
Marshall Bowers
9785481aba
Make Disclosure accept an ID (#3701)
This PR makes the `Disclosure` component accept an ID rather than using
a static ID for all disclosures.

Release Notes:

- N/A
2023-12-18 15:21:04 -05:00
Nate Butler
9cd8e99a9a Update toolbar.rs 2023-12-18 14:10:12 -05:00
Nate Butler
2ae39b70c8 Add left side padding 2023-12-18 13:55:30 -05:00
Marshall Bowers
4fdf6a867a
Wire up offline contact list (#3700)
This PR wires up the offline contact list.

Also enables toggling both the online and offline contact lists.

Release Notes:

- N/A
2023-12-18 13:54:11 -05:00
Nate Butler
c9893ce2fd Use flex_1 div instead of justify_center in toolbar 2023-12-18 13:51:04 -05:00
Nathan Sobo
d058515b81
Use a different frame arena for each window (#3696)
This fixes a panic that was caused by sharing the same frame allocator
for different windows.

Release Notes:

- N/A
2023-12-18 11:49:59 -07:00
Max Brunsfeld
0000e68310 Remove unused Arena::sized method 2023-12-18 10:41:02 -08:00
Antonio Scandurra
37efe82c5e Use a different frame arena for all elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-12-18 19:35:17 +01:00
Marshall Bowers
98f5a3d544
Center text on welcome screen (#3699)
This PR centers the text "Code at the speed of thought" on the welcome
screen.

Release Notes:

- N/A
2023-12-18 13:35:05 -05:00
Marshall Bowers
0aa690f915
Always show channel toggle when collapsed (#3698)
This PR makes the channel toggle disclosure always visible when a
channel tree is collapsed, as opposed to just being visible on hover.

This makes it possible to visually identify collapsed channel trees
without having to hover over each entry.

Release Notes:

- N/A
2023-12-18 13:27:47 -05:00
Nate Butler
f143467478
Update collab panel signed out state (#3697)
[[PR Description]]

Before: 

![CleanShot 2023-12-18 at 13 10
14@2x](https://github.com/zed-industries/zed/assets/1714999/a0e536c3-b5bf-45e2-893b-89b1ae7b4c47)

After:

![CleanShot 2023-12-18 at 13 10
36@2x](https://github.com/zed-industries/zed/assets/1714999/5d66a4a9-cc19-420d-82c7-58ec5cd264e4)

One known issue:

The "Sign in to enable collaboration" text below the button should be
centered, but it looks like label is reserving the full width. Need to
look in to that.

Release Notes:

- N/A
2023-12-18 13:22:45 -05:00
Nate Butler
9d014b0f9a Remove comment 2023-12-18 13:11:51 -05:00
Nate Butler
89b231afeb Update collab panel signed out state 2023-12-18 13:09:46 -05:00
Antonio Scandurra
cef9aa3590 Use a different frame arena for each window
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-12-18 18:58:40 +01:00
Nate Butler
eeaa1e5cf9 Add github icon 2023-12-18 12:56:57 -05:00
Nate Butler
d72cd3795a Fix implementation of full_width and icon_position in button 2023-12-18 12:56:50 -05: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
5c7de103a9
Style wrap guides (#3693)
[[PR Description]]

This PR styles wrap guides. Wrap guides weren't being added to the theme
in the theme importer, and they were also missing from One Dark.

One Dark:

![CleanShot 2023-12-18 at 11 16
48@2x](https://github.com/zed-industries/zed/assets/1714999/5578127f-8d69-4f47-af60-c44de87331e0)

Gruvbox:

![CleanShot 2023-12-18 at 11 17
38@2x](https://github.com/zed-industries/zed/assets/1714999/a2ac5db9-e5bf-4452-9f9d-49f074231587)

Bad border (known importer issue):

![CleanShot 2023-12-18 at 11 17
49@2x](https://github.com/zed-industries/zed/assets/1714999/37d11e37-38b6-4001-aef0-19fc2d925425)

No border (known importer issue):

![CleanShot 2023-12-18 at 11 18
14@2x](https://github.com/zed-industries/zed/assets/1714999/3d74bd8c-514e-4e14-94db-425a39d057ab)


Release Notes:

- N/A
2023-12-18 11:35:00 -05:00
Nate Butler
196df1c378 Start on collab panel empty state 2023-12-18 11:33:37 -05:00
Julia
4707248714
Revert accidental merge of old version of workspace2 render function (#3694)
Something happened with my local diff and
https://github.com/zed-industries/zed/pull/3691 somehow contained an old
version of workspace2's render function. Perhaps I rebased at some point
and borked it? Not sure 🤷‍♀️

Release Notes:

- N/A
2023-12-18 11:32:06 -05:00
Joseph T. Lyons
a623929340
Add backtrace hash to collab server panic api (#3692)
Release Notes:

- N/A
2023-12-18 11:21:41 -05:00
Nate Butler
da7628cc1e Style wrap guides for imported themes 2023-12-18 11:16:22 -05:00
Nate Butler
b46f5be490 Style One Dark wrap guides 2023-12-18 11:16:00 -05:00
Joseph T. Lyons
7cd6825eee Add backtrace hash to collab server panic api 2023-12-18 11:12:23 -05:00
Joseph T. Lyons
02bcc7bbeb Add release channel to zed2 collab server 2023-12-18 11:09:54 -05:00
Julia
488073deba
Unbork project search focus (#3691)
I got a little too clever for my own good with these focus handles
originally lol

Release Notes:

- N/A
2023-12-18 10:54:11 -05:00
Julia
b4042feccd Unbork project search focus 2023-12-18 10:44:34 -05:00
Kirill Bulatov
7e21e0f0eb Do not panic on non-worktree file indexing 2023-12-18 13:10:26 +02:00
Antonio Scandurra
4e544545d1
Introduce an Arena to allocate and deallocate frame-related structs more cheaply (#3689)
Picture worth a thousand words:


![before-after](https://github.com/zed-industries/zed/assets/482957/0aa92baf-f1cd-485e-a234-6d8f8b63a79a)

Note how having an area makes a substantial amount of frames between
0.5ms and 1ms faster (15-20% faster frames).

Release Notes:

- N/A
2023-12-18 11:16:07 +01:00
Antonio Scandurra
5a4e2e6b90 Use a closure to allocate structs onto the Arena
This is a trick borrowed from Bumpalo that helps LLVM understand
it should instantiate the object directly on the heap, as opposed to
doing so on the stack and then moving it.
2023-12-18 10:56:37 +01:00
Max Brunsfeld
29c6061a14
Fix following bugs (#3688)
* Follow command didn't work, because follow task was dropped
* An extra div prevented titlebar facepiles from rendering correctly
2023-12-15 16:34:08 -08:00
Max Brunsfeld
b5ae2f060b Remove div around all avatars in titlebar facepile 2023-12-15 16:26:56 -08:00
Max Brunsfeld
a4cdf365be Fix accidental drop of following task. Add back FollowNextCollaborator 2023-12-15 16:15:31 -08:00
Marshall Bowers
54eb452144
Only apply scroll correction in uniform_list when already scrolled (#3687)
This PR fixes an issue where the scroll correction added to the uniform
list in a35fdf45fc was being applied even
if the list wasn't scrolled at all.

This manifested in the project panel starting with an incorrect scroll
offset that would disappear once scrolled.

It seems like we should only need to apply this scroll correction when
the list is already scrolled.

Release Notes:

- N/A
2023-12-15 17:53:10 -05:00
Marshall Bowers
5447c6d5ee
Fix channel filter input (#3686)
This PR fixes the channel filter in the collab panel not showing up.

Release Notes:

- N/A
2023-12-15 17:03:59 -05:00
Max Brunsfeld
149a718d65 Don't scroll List on scroll wheel events outside of its bounds 2023-12-15 13:38:49 -08:00
Max Brunsfeld
a5e037befa Avoid duplicate render of a pane when it is zoomed 2023-12-15 13:26:48 -08:00
Max Brunsfeld
e3e988c150 Always render panes via pane_group::Member::render
Remove distinct code path for rendering panes in a PaneAxis, as this dropped
the logic for rendering the leader border and info box.
2023-12-15 13:26:36 -08:00
Max Brunsfeld
4eb609a954
Enable zoom (#3668)
* [x] zoom
* [x] pane tests
2023-12-15 12:58:03 -08: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
Conrad Irwin
b8cdcf4e93
fix theme selector gaps (#3682)
- Don't scroll beyond end of uniform list
- Restore position of uniform_list padding

[[PR Description]]

Release Notes:

- N/A
2023-12-15 13:27:17 -07:00
Nathan Sobo
3781626379 Merge branch 'main' into arena 2023-12-15 13:22:19 -07:00
Conrad Irwin
3c3e5ed7d8
Fix bug where vim commands were copied on each update_matches (#3680)
In zed1, the array of commands was recalculated on every update_matches,
In zed2 it's cached before we change the focus.

Release Notes:

- N/A
2023-12-15 13:20:10 -07:00
Conrad Irwin
2fe9a1df21 Restore position of uniform_list padding
It should be inside the scrollable area.
2023-12-15 13:18:51 -07:00
Max Brunsfeld
4c3ec0a8e5 Enable pane tests 2023-12-15 12:00:58 -08:00
Conrad Irwin
a35fdf45fc Don't scroll beyond end of uniform list 2023-12-15 12:54:12 -07:00
Max Brunsfeld
9a8225c855 When a dock is zoomed, don't render it in its normal place 2023-12-15 11:48:25 -08:00
Max Brunsfeld
a4c123bb11 Fix logic for activating panel when re-docking it 2023-12-15 11:47:01 -08:00
Marshall Bowers
b1a61ca21e
Fix toolbar width (#3681)
This PR fixes an issue with the toolbar width introduced in #3666.

The lack of a flex container was making the toolbar contents not take up
the full width, and thus not positions items correctly along its main
axis.

Release Notes:

- N/A
2023-12-15 14:44:29 -05:00
Max Brunsfeld
793381f455 Render zoomed item in the workspace 2023-12-15 11:19:59 -08:00
Marshall Bowers
487edcb12b
Rework collab panel rendering to use gpui::list (#3678)
This PR reworks the rendering of the collab panel to use `gpui::list`,
so that we don't render any items that are not visible on the screen.

In the process we also fixed some bugs in the channel list:

- Fixed the context menu for channels not deploying when activated via
keyboard
- Fixed drag and drop for channels
- Made it so when navigating the collab panel via keyboard the list only
scrolls enough to reveal the next item when navigating to an item that
is currently off-screen

Release Notes:

- N/A
2023-12-15 14:11:24 -05:00
Mikayla Maki
dc7f4f4786
Fix editor mouse event dispatch stealing clicks (#3679)
[[PR Description]]

Release Notes:

-
2023-12-15 11:06:31 -08:00
Marshall Bowers
5c060ceb1c Format code 2023-12-15 14:03:49 -05:00
Marshall Bowers
5417127902 Fix channel drag and drop
Also add the ability to unnest a channel by dragging it to the "Channels"
header. This is currently not working due to a collab server issue.

Co-authored-by: Max <max@zed.dev>
2023-12-15 14:01:24 -05:00
Conrad Irwin
d0dbf8e1e2 Fix bug where vim commands were copied on each update_matches
In zed1, the array of commands was recalculated on every update_matches,
In zed2 it's cached before we change the focus.
2023-12-15 11:59:06 -07:00
Marshall Bowers
a40f04b71f Only scroll enough to reveal the next channel if it isn't visible
Co-authored-by: Max <max@zed.dev>
2023-12-15 13:50:51 -05:00
Mikayla
b4135dd2f1
Fix editor mouse event dispatch 2023-12-15 10:26:41 -08:00
Marshall Bowers
47fc03ab98 Fix positioning of the inline context menu
Added a new `bounds_for_item` for `ListState`.

Co-authored-by: Max <max@zed.dev>
2023-12-15 13:24:30 -05:00
Mikayla
a2852e36ce
Fix pane resizing 2023-12-15 10:07:10 -08:00
Antonio Scandurra
0a57171066 Use a safe API for Arena 2023-12-15 19:03:37 +01: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
Marshall Bowers
b478a4c4d5 Perform scroll interactions through the ListState 2023-12-15 12:10:40 -05:00
Nate Butler
d13c1486da Update fold_indicator render 2023-12-15 12:09:06 -05:00
Marshall Bowers
6c10ff8548 Render the collab panel using a gpui::list 2023-12-15 11:56:03 -05:00
Nate Butler
6345e6d4d2 Add some right side padding in titlebar. 2023-12-15 11:25:24 -05:00
Nate Butler
d099d35948 Reduce intensity of project panel icons 2023-12-15 11:20:56 -05:00
Nate Butler
47eaf1abd8 Remove red borders, improve left side padding 2023-12-15 11:07:40 -05:00
Nate Butler
50a44dd8ba Improve tooltip with keybinding styling 2023-12-15 11:07:17 -05:00
Nate Butler
f459fc5e27 Fix import 2023-12-15 10:33:27 -05:00
Nate Butler
62ea58618c Merge branch 'main' into story-enhancements 2023-12-15 10:26:59 -05:00
Nate Butler
3d9e051b07 Update storybook2.rs 2023-12-15 10:25:07 -05:00
Antonio Scandurra
be73dd852d Move Arena to a thread-local and use it to allocate AnyElement 2023-12-15 16:18:05 +01:00
Antonio Scandurra
e1ca8e81bb Use an Arena to reuse allocations for listeners 2023-12-15 15:13:32 +01:00
Piotr Osiewicz
ff3f4f3027
search: Reintroduce whole word switch (#3672)
It seems to have been lost in the recent styling pass.

Release Notes:

- N/A
2023-12-15 12:20:54 +01:00
Piotr Osiewicz
2b3d9deabe
Dismiss Recent Projects & VCS modals on ESC (#3671)
Release Notes:

- N/A
2023-12-15 12:07:25 +01:00
Kirill Bulatov
4bfe46f53a Restore zed1 behavior for buffer search deploy 2023-12-15 12:23:03 +02:00
Kirill Bulatov
31ff7d40ed Adjust copy/paste buffer only on the copy error action trigger 2023-12-15 11:34:00 +02:00
Kirill Bulatov
a6403aad1a Remove extra nits, do not panic on clicking the buffer separator 2023-12-15 11:28:48 +02:00
Julia
de523c2d80 Give correct focus handle when project search has no matches 2023-12-14 23:49:44 -05:00
Julia
4be84f3db0 Merge branch 'main' into focus-handlers-on-draw 2023-12-14 23:08:23 -05:00
Julia
d4e09230cc Give result-less project search a focus handle 2023-12-14 22:29:33 -05:00
Conrad Irwin
7e1d61d116 Merge branch 'main' into user-menu 2023-12-14 20:18:20 -07:00
Mikayla Maki
46bd6088e8
Fix some todos, add others (#3669)
As it says on the tin

Release Notes:

-
2023-12-14 19:00:58 -08:00
Julia
ff4da878f9 Render panel in these tests 2023-12-14 21:33:11 -05:00
Julia
fbcaf96ab5 Track focus on TestItem 2023-12-14 20:58:59 -05:00
Mikayla
6973b1b592
Add several red outlines 2023-12-14 17:48:49 -08:00
Mikayla
ead5206741
Fix todos in auto-update 2023-12-14 17:00:07 -08:00
Max Brunsfeld
52b9fc303b Fix overlay rendering when dragging onto the center of a pane 2023-12-14 16:52:03 -08:00
Mikayla Maki
c27dd57a48
Make more performance improvements to GPUI 2 (#3664)
In the 3 charts below, "window draw" has 3 major subroutines. Request
layout, where we walk over the tree and have everything talk to the
layout engine initially. Compute layout, where we have the layout engine
actually do the layout, and then paint, where we use the computed bounds
to populate the scene.


![image_720](https://github.com/zed-industries/zed/assets/1789/d2225389-865f-4c8a-9452-9f611da64dcf)

Things are moving quickly so before/after comparisons are tough. In the
graph above, green bars are from a commit actually pre-dates a merge of
master which increased the complexity of layout. The red bars represent
the state of the world after this PR. Note how we improve the
performance of `paint`.

Improvements:

- Not moving `self` in `Element::paint`. This was moving from the heap
to the stack and imposing a big cost. This is the biggest win in this
PR.
- We got some minor wins by making the stacking order a bigger smallvec
of u8 instead of u32.
- A big win that doesn't show up in this chart is avoiding a double
render of the editor when autoscrolling by never pushing notification
effects or marking the window dirty when notifying during a window draw.

Release Notes:

- N/A
2023-12-14 16:45:58 -08:00
Mikayla Maki
05cb68eff1
Merge branch 'main' into perf-2 2023-12-14 16:39:10 -08:00
Max Brunsfeld
842f15c65b Fix centering of empty pane text 2023-12-14 16:35:58 -08:00
Mikayla Maki
8418f25d0a
Merge branch 'main' into perf-2 2023-12-14 16:25:40 -08:00
Max Brunsfeld
d6383ab0c6 Fix stickiness of main pane drag target
Reimplement the pane drag targets using on_drag_move
2023-12-14 16:23:15 -08:00
Mikayla Maki
0b4b81fa0c
Fix dock resizing (#3663)
This fixes some bugs in the display and tracking of dock resizes

Release Notes:

-
2023-12-14 16:20:29 -08:00
Nathan Sobo
ad8165ae79 Rename draw2 -> draw_and_update_state 2023-12-14 17:20:27 -07:00
Nathan Sobo
f4a954db4f Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 17:15:44 -07:00
Mikayla
8b4cf38379
Fix dock resize handles
co-authored-by: conrad <conrad@zed.dev>
2023-12-14 16:05:10 -08:00
Nathan Sobo
02606d1fb9 Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 16:56:36 -07:00
Marshall Bowers
bc3e6649f8
Fix warning in release mode (#3662)
This PR fixes a warning that was present in release mode, which was
preventing the nightly builds from running:

```
error: variable does not need to be mutable
   --> crates/gpui2/src/elements/div.rs:547:9
    |
547 |     let mut div = Div {
    |         ----^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `-D unused-mut` implied by `-D warnings`
```

Release Notes:

- N/A
2023-12-14 18:52:14 -05:00
Mikayla
4c63c74f92
Fix bug in drag move dispatch
co-authored-by: conrad <conrad@zed.dev>
2023-12-14 15:23:24 -08:00
Nate Butler
e4f9bddbab Remove unused imports 2023-12-14 17:56:42 -05:00
Marshall Bowers
139fe7c1f1
Use separate editor foreground color (#3661)
This PR populates the `editor_foreground` color in the various themes
and updates the editor to use this as the color for text.

The `text` field in the theme should now be used for UI elements, while
`editor_foreground` should be used for buffers.

This improves the contrast in some themes, notably Ayu Dark.

Release Notes:

- N/A
2023-12-14 17:54:44 -05:00
Nate Butler
936c78be94 WIP IconButton story 2023-12-14 17:51:08 -05:00
Max Brunsfeld
fcbd58fed4
Enable all warnings in workspace, fix all warnings (#3660) 2023-12-14 14:38:28 -08:00
Nate Butler
3cf003763e Use updated story container in Text story 2023-12-14 17:38:22 -05:00
Marshall Bowers
2b278e69f7 Use editor_foreground color in editor 2023-12-14 17:34:07 -05:00
Marshall Bowers
292fac37bb Use editor.foreground from VS Code for the editor foreground 2023-12-14 17:30:37 -05:00
Marshall Bowers
8bac4e199d Emit editor_foreground color from theme converter 2023-12-14 17:28:45 -05:00
Max Brunsfeld
6170895932 Fix bug in Workspace::activate_pane_in_direction
Co-authored-by: Conrad <conrad@zed.dev>
2023-12-14 14:27:44 -08:00
Joseph T. Lyons
4e7005b4f7 Use bitflags to hold error states 2023-12-14 17:22:13 -05:00
Max Brunsfeld
b5e9e277db
Re-enable cmd-<number> key bindings for activating panes (#3659) 2023-12-14 14:16:43 -08:00
Max Brunsfeld
23d5f3f3e8 Enable all warnings in workspace, fix all warnings
Bring back some workspace tests

Co-authored-by: Conrad <conrad@zed.dev>
2023-12-14 14:15:56 -08:00
Nathan Sobo
d13a21c238 Don't move in paint 2023-12-14 15:15:18 -07:00
Julia
bbbdb9ff3e Render panel in this test to make sure it can receive focus 2023-12-14 17:11:00 -05:00
Nate Butler
63c3edfb83 Continue styling new story components 2023-12-14 16:52:05 -05:00
Max Brunsfeld
8d994ce8c5
Enable dragging from project panel to panes (#3658)
Rework gpui2 drag API so that receivers need not specify the dragged
view type.
2023-12-14 13:32:40 -08:00
Max Brunsfeld
6b06bb4ffe Re-enable cmd-<number> key bindings for activating panes
co-authored-by: Conrad <conrad@zed.dev>
2023-12-14 13:30:11 -08:00
Mikayla
8791f7cefc Enable dragging from project panel to panes
Rework gpui2 drag API so that receivers need not specify the dragged view type.

co-authored-by: Max <max@zed.dev>
co-authored-by: Conrad <conrad@zed.dev>
2023-12-14 13:20:48 -08:00
Nathan Sobo
fb3382bcc5 Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 14:16:59 -07:00
Marshall Bowers
35838ae554
Style "Replace in project" input in project search (#3657)
This PR styles the "Replace in project" input in the project search.

Release Notes:

- N/A
2023-12-14 16:10:22 -05:00
Nathan Sobo
0dd6c50a20 Use FxHashMap for element state 2023-12-14 14:06:19 -07:00
Marshall Bowers
c166311c06 Style "Replace in project" input 2023-12-14 15:58:17 -05:00
Marshall Bowers
2484a6969a Fix toolbar flex sizing 2023-12-14 15:57:06 -05:00
Nate Butler
c041799c6a Extend Story components, allow linking to story file
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-12-14 15:55:17 -05:00
Conrad Irwin
2efd7cedbc
Ignore invisible layers for mouse events (#3651)
Fixes clicking in the top/bottom 100px of the editor


Release Notes:

- N/A
2023-12-14 12:01:45 -07:00
Marshall Bowers
ed098c834e
Style inputs in project search (#3655)
This PR styles the inputs in the project search.

<img width="772" alt="Screenshot 2023-12-14 at 1 53 28 PM"
src="https://github.com/zed-industries/zed/assets/1486634/fe2362be-79db-4551-a473-2acf7a8a1bcb">

Release Notes:

- N/A
2023-12-14 13:58:11 -05:00
Nathan Sobo
3d1dae9a06 Make z_indices bigger in StackingOrder 2023-12-14 11:37:48 -07:00
Nathan Sobo
0d30b698a4 Don't allocate interactive bounds 2023-12-14 11:28:52 -07:00
Joseph T. Lyons
8a361c93e2 Prep feedback code for testing 2023-12-14 13:22:41 -05:00
Marshall Bowers
c6e44683e6
Hide the toolbar if it has no visible items (#3654)
This PR makes the toolbar hide itself if it has no visible items.

This removes the double border beneath the tab bar when there are no
visible tools in the toolbar.

Release Notes:

- N/A
2023-12-14 13:02:27 -05:00
Conrad Irwin
4e1b4c4390 Refactor editor to be more clear about stacking 2023-12-14 10:48:15 -07:00
Conrad Irwin
d8cb0e8a2a Fix z-indexes in editor element
* Ensure that scroll events from blocks scroll the editor
* Ensure that scroll bars show behind hover things
2023-12-14 10:36:16 -07:00
Nathan Sobo
1ae25f52a1 WIP 2023-12-14 10:31:45 -07:00
Marshall Bowers
fd133df896
Improve storybook story selection (#3653)
This PR builds on top of #3652 by adding a selection prompt to the
storybook to allow you to choose from the available list of stories if
you don't provide one explicitly:

<img width="1387" alt="Screenshot 2023-12-14 at 12 00 26 PM"
src="https://github.com/zed-industries/zed/assets/1486634/640d62a3-1340-45f1-9746-69b513faff62">

This way we don't have to keep generating the `script/storybook` script
whenever stories are added/removed.

#### Usage (through `cargo`):

```sh
# Select from the available stories
cargo run -p storybook2

# Run a specific story
cargo run -p storybook2 -- components/list_item
```

#### Usage (through `script/storybook`):

```sh
# Select from the available stories
./script/storybook

# Run a specific story
./script/storybook list_item
```

Release Notes:

- N/A
2023-12-14 12:13:02 -05:00