Commit Graph

1508 Commits

Author SHA1 Message Date
Marshall Bowers
c1f1c5e75f
ui: Refine TitleBar component (#9415)
This PR continues the refinements to the `TitleBar` component.

Here are the notable changes:

- `KeyBindingDisplay` and `PlatformStyle` have been unified into a
single `PlatformStyle`.
- This provides us a consistent way for adapting UI to different
platform styles.
- `PlatformTitlebar` has been renamed to `TitleBar`.
  - The `Platform` prefix was irrelevant.
- The Windows window controls have been factored out into a separate
module and have been componentized.

<img width="1283" alt="Screenshot 2024-03-15 at 3 34 38 PM"
src="https://github.com/zed-industries/zed/assets/1486634/07da391f-828b-48bf-8849-58863f4ccce7">

> I'm missing the Segoe Fluent Icons font, so that's why the aren't
rendering properly.

Release Notes:

- N/A
2024-03-15 15:48:07 -04:00
Mikayla Maki
328aa2cc95
Cross-platform titlebar (#9405)
This PR reverts https://github.com/zed-industries/zed/pull/9392 and
fixes the regressions that led to the reversion.

Release Notes:

- N/A

---------

Co-authored-by: Ezekiel Warren <ezekiel@seaube.com>
2024-03-15 10:40:58 -07:00
Daniel Zhu
cb16003133
Fill context menu of Zed macOS dock icon with recent projects (#8952)
Fixes https://github.com/zed-industries/zed/issues/8416

Release Notes:

- Added recent projects into Zed's macOS dock icon context menu ([8416](https://github.com/zed-industries/zed/issues/8416))

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-03-15 16:22:43 +02:00
Thorsten Ball
5bf0c8ed2d
Revert "windows: better looking titlebar" and follow-up (#9392)
This reverts #9053 and #9375 because they introduced a regression on
`main` that broke the titlebars on macOS:


![image](https://github.com/zed-industries/zed/assets/1185253/d046003b-5c66-4a42-9385-623f5d58c9a4)

Two things are off:

- Left padding is missing
- Titlebar height is less than it was before, which means the
traffic-light buttons are not centered vertically

What @as-cii and I noticed while looking into this: the `cfg!(macos)`
macros that were used don't work like that. You need to check for
`cfg!(target = "macos")` etc. Means that on macOS we never used the
macOS-specific code because the condition was always false.

Overall height, we're not sure about.

Release Notes:

- N/A
2024-03-15 12:25:51 +01:00
Antonio Scandurra
5ae145145e
Fix flickering when interacting with the language server logs (#9390)
Fixes https://github.com/zed-industries/zed/issues/9340

The flickering was caused by the pane trying to restore focus on a
`FocusHandle` that wasn't being rendered anymore. This commit uses the
new `WeakFocusHandle` to avoid retaining a reference to focus handles
that don't exist anymore.

Release Notes:

- Fixed a bug that caused flickering when interacting with the language
server logs
([#9340](https://github.com/zed-industries/zed/issues/9340)).
2024-03-15 11:15:07 +01:00
Kyle Kelley
72d36d0213
Foundations for Open All the Things (#9353)
This is the beginning of setting up a flexible way to open items beyond
the text buffer -- think notebooks, images, GeoJSON, etc. The primary
requirement to allow opening an arbitrary file is `try_open` on the
`project::Item` trait. Now we can make new `Item`s for other types with
their own ways to render.

Under the hood, `register_project_item` uses this new opening scheme. It
supports a dynamic array of opener functions, that will handle specific
item types. By default, a `Buffer` should be able to be able to open any
file that another opener did not.

A key detail here is that the order of registration matters. The last
item has primacy. Here's an example:

```rust
workspace::register_project_item::<Editor>(cx);
workspace::register_project_item::<Notebook>(cx);
workspace::register_project_item::<ImageViewer>(cx);
```

When a project item (file) is attempted to be opened, it's first tried
with the `ImageViewer`, followed by the `Notebook`, then the `Editor`.

The tests are set up in a way that should make it _hopefully_ easy to
learn how to write a new opener. First to go after should probably be
image files.

Release Notes:

N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-14 18:01:40 -07:00
Ezekiel Warren
948b3827c8
windows: better looking titlebar (#9053)
~~work in progress. not ready for review. made for visibility only, but
feel free to comment :)~~

TODO:
- [x] add close/min/max buttons (to be rendered with gpui)
- [x] snap layout support
- [x] fix issues with clicking items in titlebar
- [x] cleanup/document

Release Notes:

- Added custom windows titlebar

![](https://media.discordapp.net/attachments/1208481909676576818/1216985375969378324/caption-buttons-working.gif?ex=660260f4&is=65efebf4&hm=53a17af6e2f233eba54302a5adb9efe23900f4d6f6d1d854bec887120789130c&=)

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-14 17:20:30 -07:00
Mikayla Maki
35c9216ed7
Fix window restoration bugs (#9358)
- [x] fixes https://github.com/zed-industries/zed/issues/9349
- [x] fixes https://github.com/zed-industries/zed/issues/4656
- [x] fixes https://github.com/zed-industries/zed/issues/8345

Release Notes:

- TODO
2024-03-14 14:25:12 -07:00
Marshall Bowers
14cdafb0a8
Enable clippy::eq_op (#9369)
This PR enables the
[`clippy::eq_op`](https://rust-lang.github.io/rust-clippy/master/index.html#/eq_op)
rule and fixes the outstanding violations.

Enabling this rule seems to have caught two bugs!

Release Notes:

- N/A
2024-03-14 17:05:07 -04:00
Conrad Irwin
60044a5f56
Fix panic by preventing opening local files in a remote project (#9304)
Release Notes:

- Fixed a panic caused by allowing the CLI to re-use workspaces

Co-authored-by: Marshall <marshall@zed.dev>
2024-03-14 13:51:33 -04:00
Max Brunsfeld
724c19a223
Add a setting for custom associations between languages and files (#9290)
Closes #5178

Release Notes:

- Added a `file_types` setting that can be used to associate languages
with file names and file extensions. For example, to interpret all `.c`
files as C++, and files called `MyLockFile` as TOML, add the following
to `settings.json`:

    ```json
    {
      "file_types": {
        "C++": ["c"],
        "TOML": ["MyLockFile"]
      }
    }
    ```

As with most zed settings, this can be configured on a per-directory
basis by including a local `.zed/settings.json` file in that directory.

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-03-13 10:23:30 -07:00
Antonio Scandurra
139bb3275a
Automatically reset cursor style when hit test changes (#9289)
Release Notes:

- N/A

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-03-13 17:21:25 +01:00
Igal Tabachnik
6286d86262
Set the correct dispatch action for the double-click handler for the pane tab bar (#9221)
Fixes #9003

Release Notes:

- Fixed the double-click action on the terminal tab bar opening a new
buffer instead of a new terminal
([#9003](https://github.com/zed-industries/zed/issues/9003)).
2024-03-13 17:30:10 +02:00
Thorsten Ball
ac4bbb6135
Correctly re-render mouse cursor when hovering over pane group divider (#9270)
Before this change, the hitbox felt one-sided because the cursor didn't
consistently change into the drag-handle cursor.

The reason was that we didn't trigger a redraw on hover, so we'd only
change the cursor if we detected hover AND something else caused a
redraw.

Release Notes:

- Fixed the pane resize handler not consistently triggering on mouse
hover.

Co-authored-by: Antonio <antonio@zed.dev>
2024-03-13 10:57:10 +01:00
Thorsten Ball
3c28282108
Redraw when toggling between windows (#9236)
Before this change we didn't consistently trigger focus events when
toggling between with windows `Cmd-backtick`. We only triggered them
when the OS decided to trigger a redraw.

That lead to a nasty bug that showed up in Vim mode where a cursor would
still be active in the hidden window, even though it was deactivated.

One then had to manually try to trigger a focus event in the new window
to activate the cursor.

With this change, we call `cx.refresh` when the window activation status
changed which triggers focus events consistently and fixes this bug.

With logging we can observe this:

**BEFORE**:


https://github.com/zed-industries/zed/assets/1185253/e1ad8878-129c-44ba-9d8b-c720f9dca5b6


**AFTER**:


https://github.com/zed-industries/zed/assets/1185253/733fdadb-d1ea-47fe-a2c1-7b50af299cc0


Release Notes:

- Fixed focus not being consistently changed when switching between
multiple Zed windows via `Cmd-backtick`.

---------

Co-authored-by: Manu Raj <git@manuraj.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2024-03-13 10:15:22 +01:00
Conrad Irwin
646f69583a
Allow opening non-extant files (#9256)
Fixes #7400



Release Notes:

- Improved the `zed` command to not create files until you save them in
the editor ([#7400](https://github.com/zed-industries/zed/issues/7400)).
2024-03-12 22:30:04 -06:00
Mikayla Maki
e792c1a5c5
Open new windows with a default size and position (#9204)
This PR changes GPUI to open windows with a default size and location,
and to otherwise inherit from their spawning window.

Note: The linux build now crashes on startup.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Ezekiel Warren <zaucy@users.noreply.github.com>
2024-03-12 21:19:51 -07:00
Conrad Irwin
05dfe96f0c
Add --add/--new to control CLI behaviour (#9202)
When neither is specified, if you open a directory you get a new
workspace, otherwise files are added to your existing workspace.

With --new files are always opened in a new workspace
With --add directories are always added to an existing workspace

Fixes #9076
Fixes #4861
Fixes #5370

Release Notes:

- Added `-n/--new` and `-a/--add` to the zed CLI. When neither is
specified, if you open a directory you get a new workspace, otherwise
files are added to your existing workspace. With `--new` files are
always opened in a new workspace, with `--add` directories are always
added to an existing workspace.
([#9076](https://github.com/zed-industries/zed/issues/9096),
[#4861](https://github.com/zed-industries/zed/issues/4861),
[#5370](https://github.com/zed-industries/zed/issues/5370)).
2024-03-12 14:27:58 -06:00
Thorsten Ball
8c87b349dc
Show formatting failure (#9229)
This fixes #8072 and #9061 by surfacing formatting errors in the
activity indicator.

It shows a message in the activity indicator if the last attempt
to format a buffer failed.

It only keeps track of the last attempt, so any further formatting
that succeeds will reset or update the error message.

I chose to only keep track of that, because everything else (keeping
track of formatting state per buffer, per project, per worktree) seems
complicated with little benefit, since we'd have to keep track of that
state, update it, clean it, etc.

We can still do that should we decide that we need to keep track
of the state on a per-buffer basis, but I think for now this is a
good, simple solution.

This also changes the `OpenLog` action to scroll to the end of the
buffer
and to not mark the buffer as dirty.


Release Notes:

- Added message to activity indicator if last attempt to format a buffer
failed. Message will get reset when next formatting succeeds. Clicking
on message opens log with more information.
([#8072](https://github.com/zed-industries/zed/issues/8072) and
[#9061](https://github.com/zed-industries/zed/issues/9061)).
- Changed `zed: Open Log` action to not mark the opened log file as
dirty and to always scroll to the bottom of the log.


https://github.com/zed-industries/zed/assets/1185253/951fb9ac-8b8b-483a-a46d-712e52878a4d
2024-03-12 16:30:08 +01:00
Antonio Scandurra
39a0841ea8
Center dock resize handle hitboxes (#9225)
Also, add a `deferred` function which takes an element to paint after
the current element tree.

Release Notes:

- Improved the size and position of the hitbox for resizing left, right,
and bottom panels.
([#8855](https://github.com/zed-industries/zed/issues/8855))

Co-authored-by: Julia <julia@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2024-03-12 15:42:18 +01:00
Bennet Bo Fenner
d362588055
markdown preview: highlight code blocks (#9087)
![image](https://github.com/zed-industries/zed/assets/53836821/e20acd87-9680-4e1c-818d-7ae900bf0e31)

Release Notes:

- Added syntax highlighting to code blocks in markdown preview
- Fixed scroll position in markdown preview when editing a markdown file
(#9208)
2024-03-12 12:54:12 +02:00
Antonio Scandurra
2b67bb27cf Occlude only modal and not the space around it used to center it 2024-03-11 18:13:00 +01:00
Antonio Scandurra
91a0923fc4
Fix a few regressions related to the flicker fix (#9190)
This pull request fixes
https://github.com/zed-industries/zed/issues/9187 and fixes also ix a
rendering problem that would show cursors on the same plane:


![image](https://github.com/zed-industries/zed/assets/482957/208304a4-286a-4fd9-a3d8-e2913e3a3dc7)


Release Notes:

- N/A
2024-03-11 18:07:26 +01:00
Antonio Scandurra
8eea281288
Show modals on top of zoomed pane (#9183)
Release Notes:

- N/A
2024-03-11 16:57:17 +01:00
Antonio Scandurra
4700d33728
Fix flickering (#9012)
See https://zed.dev/channel/gpui-536

Fixes https://github.com/zed-industries/zed/issues/9010
Fixes https://github.com/zed-industries/zed/issues/8883
Fixes https://github.com/zed-industries/zed/issues/8640
Fixes https://github.com/zed-industries/zed/issues/8598
Fixes https://github.com/zed-industries/zed/issues/8579
Fixes https://github.com/zed-industries/zed/issues/8363
Fixes https://github.com/zed-industries/zed/issues/8207


### Problem

After transitioning Zed to GPUI 2, we started noticing that interacting
with the mouse on many UI elements would lead to a pretty annoying
flicker. The main issue with the old approach was that hover state was
calculated based on the previous frame. That is, when computing whether
a given element was hovered in the current frame, we would use
information about the same element in the previous frame.

However, inspecting the previous frame tells us very little about what
should be hovered in the current frame, as elements in the current frame
may have changed significantly.

### Solution

This pull request's main contribution is the introduction of a new
`after_layout` phase when redrawing the window. The key idea is that
we'll give every element a chance to register a hitbox (see
`ElementContext::insert_hitbox`) before painting anything. Then, during
the `paint` phase, elements can determine whether they're the topmost
and draw their hover state accordingly.

We are also removing the ability to give an arbitrary z-index to
elements. Instead, we will follow the much simpler painter's algorithm.
That is, an element that gets painted after will be drawn on top of an
element that got painted earlier. Elements can still escape their
current "stacking context" by using the new `ElementContext::defer_draw`
method (see `Overlay` for an example). Elements drawn using this method
will still be logically considered as being children of their original
parent (for keybinding, focus and cache invalidation purposes) but their
layout and paint passes will be deferred until the currently-drawn
element is done.

With these changes we also reworked geometry batching within the
`Scene`. The new approach uses an AABB tree to determine geometry
occlusion, which allows the GPU to render non-overlapping geometry in
parallel.

### Performance

Performance is slightly better than on `main` even though this new
approach is more correct and we're maintaining an extra data structure
(the AABB tree).


![before_after](https://github.com/zed-industries/zed/assets/482957/c8120b07-1dbd-4776-834a-d040e569a71e)

Release Notes:

- Fixed a bug that was causing popovers to flicker.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
2024-03-11 10:45:57 +01:00
Conrad Irwin
866d791760
Fix joining hosted projects (#9038)
Release Notes:

- N/A
2024-03-07 19:56:41 -07:00
Conrad Irwin
284a57d4d1
Fix panic in open urls (#9032)
Co-Authored-By: Nathan <nathan@zed.dev>

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-03-07 13:52:50 -07:00
Kirpal Grewal
85e6bc94e9
Enable clippy::suspicious_to_owned (#9004)
Another small change: calling to owned on the `Cow` was cloning the
`Cow`, not its contents and so calling `clone` makes this more explicit
2024-03-07 11:30:40 -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)


![SCR-20240306-g2v](https://github.com/zed-industries/zed/assets/5518/b13bab55-9d74-4181-ae43-e338bb6f7112)

![SCR-20240306-g0x](https://github.com/zed-industries/zed/assets/5518/af9d4190-a974-4c26-8466-dce1c78c3f31)




Reference to Safari:

![SCR-20240306-ejo](https://github.com/zed-industries/zed/assets/5518/14c41898-8218-4bec-8574-8915a7186926)


## More Theme tests

![SCR-20240306-g0d](https://github.com/zed-industries/zed/assets/5518/8938671e-bc7c-4a6a-8c06-0992beb92bb1)

![SCR-20240306-g0j](https://github.com/zed-industries/zed/assets/5518/73a68663-70f5-4f83-aea0-2079236079e7)

![SCR-20240306-g0q](https://github.com/zed-industries/zed/assets/5518/0a2b4905-3dd1-4081-b538-a78728470004)



![SCR-20240306-fu9](https://github.com/zed-industries/zed/assets/5518/dd3a9e2c-ea28-46c6-a993-047dae8b2d8f)
2024-03-06 10:03:59 -05:00
Max Brunsfeld
6036830049
Throttle the sending of UpdateFollowers messages (#8918)
## Problem

We're trying to figure out why we sometimes see high latency when
collaborating, even though the collab server logs indicate that messages
are not taking long to process.

We think that high volumes of certain types of messages, including
`UpdateFollowers` may cause a lot of messages to queue up, causing
delays before collab sees certain messages.

## Fix

This PR reduces the number of `UpdateFollowers` messages that clients
send to collab when scrolling around or moving the cursor, using a
time-based throttle.

The downside of this change is that scrolling will not be as smooth when
following someone. The advantage is that it will be much easier to keep
up with the stream of updates, since they will be sent much less
frequently.

## Release Notes:

- Fixed slowness that could occur when collaborating due to excessive
messages being sent to support following.

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-06 14:58:41 +01:00
Marshall Bowers
addfcdea8d
Enable clippy::implied_bounds_in_impls (#8906)
This PR enables the
[`clippy::implied_bounds_in_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#/implied_bounds_in_impls)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-05 16:04:55 -05:00
Marshall Bowers
b6af393e6d
Enable clippy::borrow_deref_ref (#8894)
This PR enables the
[`clippy::borrow_deref_ref`](https://rust-lang.github.io/rust-clippy/master/index.html#/borrow_deref_ref)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-05 12:24:54 -05:00
Marshall Bowers
22fe03913c
Move Clippy configuration to the workspace level (#8891)
This PR moves the Clippy configuration up to the workspace level.

We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table)
to configure the Clippy ruleset in the workspace's `Cargo.toml`.

Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:

```toml
[lints]
workspace = true
```

This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
```

Release Notes:

- N/A
2024-03-05 12:01:17 -05:00
Conrad Irwin
27c5343707
hosted projects (#8627)
- **Allow joining a hosted project**

You can't yet do anything in a hosted project, but you can join it and
look how empty it is.

Release Notes:

- N/A
2024-03-04 19:17:40 -07:00
Mikayla Maki
20acc123af
Implement 'format without save' (#8806)
This solves a major usability problem in Zed, that there's no way to
temporarily disable auto formatting without toggling the whole feature
off.

fixes https://github.com/zed-industries/zed/issues/5230

Release Notes:

- Added a new `workspace::SaveWithoutFormatting`, bound to `cmd-k s`, to
save a file without invoking the auto formatter.
2024-03-03 21:47:34 -08:00
Marshall Bowers
83f6a1ea49
Enable clippy::vec_init_then_push (#8771)
This PR enables the
[`clippy::vec_init_then_push`](https://rust-lang.github.io/rust-clippy/master/index.html#/vec_init_then_push)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:53:23 -05:00
Marshall Bowers
fe04f69caf
Enable clippy::useless_conversion (#8767)
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:22:55 -05:00
Marshall Bowers
a6dbaac653
Enable clippy::needless_question_mark (#8759)
This PR enables the
[`clippy::needless_question_mark`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_question_mark)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 23:40:39 -05:00
Marshall Bowers
659974411d
Enable clippy::explicit_auto_deref (#8753)
This PR enables the
[`clippy::explicit_auto_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_auto_deref)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:30:18 -05:00
Marshall Bowers
ea68f86476
Enable clippy::option_map_unit_fn (#8751)
This PR enables the
[`clippy::option_map_unit_fn`](https://rust-lang.github.io/rust-clippy/master/index.html#/option_map_unit_fn)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:08:37 -05:00
Marshall Bowers
d19957b705
Enable clippy::redundant_locals (#8750)
This PR enables the
[`clippy::redundant_locals`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_locals)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:57:40 -05:00
Marshall Bowers
503bebaacc
Enable clippy::manual_flatten (#8739)
This PR enables the
[`clippy::manual_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#/manual_flatten)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 20:28:26 -05:00
Marshall Bowers
fc8e515fe8
Enable clippy::too_many_arguments (#8734)
This PR enables the
[`clippy::too_many_arguments`](https://rust-lang.github.io/rust-clippy/master/index.html#/too_many_arguments)
rule.

I opted to add `#[allow(clippy::too_many_arguments)]` on the individual
violations, as reworking them to take fewer arguments is a more involved
task.

Release Notes:

- N/A
2024-03-02 18:42:05 -05:00
Marshall Bowers
9735912965
Enable clippy::clone_on_copy (#8728)
This PR enables the
[`clippy::clone_on_copy`](https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_copy)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:37:48 -05:00
Marshall Bowers
5935681c5c
Enable clippy::single_char_pattern (#8727)
This PR enables the
[`clippy::single_char_pattern`](https://rust-lang.github.io/rust-clippy/master/index.html#/single_char_pattern)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:04:59 -05:00
Marshall Bowers
87efb75e53
Enable clippy::bind_instead_of_map (#8723)
This PR enables the
[`clippy::bind_instead_of_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/bind_instead_of_map)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 16:10:34 -05:00
Zephaniah Ong
6fcd57ac53
Expose more errors from rust-analyzer on invalid Cargo.toml contents (#8356)
Release Notes:

- Fixed ([#7574](https://github.com/zed-industries/zed/issues/7574)).
2024-03-02 10:07:25 +02:00
Brian Donovan
a84a3c0ebe
docs: Fix "it's" typos that should be "its" (#8690)
These all meant to use the possessive "its" rather than the contraction
of "it is".
2024-03-01 20:32:27 -05:00
Kirill Bulatov
cdf702aeff
Prompt to save files on recent project selection (#8673) 2024-03-01 18:48:06 +02:00
Conrad Irwin
b3b94e64ba
Ensure panel and pane sizes are integral (#8619)
Fixes: #8050

For some reason that we didn't investigate, if you have view caching
enabled,
and you have non-integer sized bounds, and you are right aligning
things, the
co-ordinates can differ by +/- 1px when using the cached view.

The easiest fix for now is to just not do that.

Co-Authored-By: Antonio <as-cii@zed.dev>

Release Notes:

- Fixed the pane icons flickering
([#8050](https://github.com/zed-industries/zed/issues/8050)).

Co-authored-by: Antonio <as-cii@zed.dev>
2024-02-29 09:16:42 -07:00
Conrad Irwin
778b6fb27b
Add OpenExcerptsSplit (#8574)
I would like to keep diagnostics open on one side, and process them on
the other.


Release Notes:

- Added `editor::OpenExcerptsSplit` (bound to `cmd-k enter`) to open the
selected excerpts in the adjacent pane
- vim: Added `ctrl-w d`, `ctrl-w shift-d` and `ctrl-w space` for
`editor::GoTo{,Type}Definition` and `editor::OpenExcerptsSplit`
2024-02-28 19:23:36 -07:00
Conrad Irwin
9bd5ebb74b
Revert "Introduce a new ToggleGraphicsProfiler command (#7607)" (#8567)
This reverts commit 0cebf68306.

Although this thing is very cool, it is a top source of crashes.

Example crash:
```
Segmentation fault: 11 on thread 26
  objc_retain +16
  invocation function for block in Overlay::onCommandBufferCommit(id<MTLCommandBuffer>) +60
  MTLDispatchListApply +52
```

Release Notes:

- Removed "Toggle Graphics Profiler" as it crashes too much.
2024-02-28 16:39:51 -07:00
Conrad Irwin
6a3ac94eea
Fix logic for view to send on Follow (#8549)
Before this we would erronously send no view in some cases.

Release Notes:

- N/A
2024-02-28 12:52:03 -07:00
Antonio Scandurra
7aba9eb4b7
Introduce a short-term solution for flickering (#8542)
This uses bounds checking alone to determine hover state to avoid
flicker. It's a short-term solution because the rendering is incorrect.
We think this is better than flickering though and buys us some time as
we work on a more robust solution overall.

Release Notes:

- Fixed flickering when hovering.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-28 17:57:20 +01:00
riccardofano
a42b987929
Add :tabonly and :only vim commands (#8337)
Release Notes:

- Added
[`:tabo[nly][!]`](https://neovim.io/doc/user/tabpage.html#%3Atabonly),
closes all the tabs except the active one but in the current pane only,
every other split pane remains unaffected.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
- Added [`:on[ly][!]`](https://neovim.io/doc/user/windows.html#%3Aonly),
closes all the tabs *and* panes except the active one.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
Since Zed does not have different splits per tab like in Neovim `:only`
works the same as it does in VscodeVim.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-26 22:15:50 -07:00
Conrad Irwin
c31626717f
channel projects (#8456)
Add plumbing for hosted projects. This will currently show them if they
exist
but provides no UX to create/rename/delete them.

Also changed the `ChannelId` type to not auto-cast to u64; this avoids
type
confusion if you have multiple id types.


Release Notes:

- N/A
2024-02-26 22:15:11 -07:00
Igal Tabachnik
3b2e315ead
Open a new file on double-clicking the tab bar (#8431)
Fixes #6818

This is a convenience feature that exists in other editors, allowing
quick creation a new tab by double-clicking the empty space on the tab
bar:
![2024-02-26 14 26
16](https://github.com/zed-industries/zed/assets/601206/55d99a84-2e61-494d-b06c-6e5f15071655)

Release Notes:

- Added the ability to open a new buffer when double-clicking on the tab
bar ([#6818](https://github.com/zed-industries/zed/issues/6818)).
2024-02-26 14:07:04 -05:00
Dzmitry Malyshau
a44fc24445
Clean up many small dependencies (part 3) (#8425)
Follow-up to #8353

Release Notes:
- N/A
2024-02-26 11:08:57 +02:00
Marshall Bowers
d8276b0f0d
Hoist itertools dependency to workspace level (#8417)
This PR hoists the `itertools` dependency to the workspace level.

Release Notes:

- N/A
2024-02-25 20:37:52 -05:00
Dzmitry Malyshau
35bec9803a
Clean up dependencies of call,lsp,project,settings,vim,welcome, and workspace (#8330)
Based on the product of
[cargo-machete](https://blog.benj.me/2022/04/27/cargo-machete/):

[dependencies.txt](https://github.com/zed-industries/zed/files/14392213/dependencies.txt)

Release Notes:
- N/A
2024-02-25 00:41:28 +02:00
Mikayla Maki
cab8b5a9a3
Switch LSP prompts to use a non-blocking toast (#8312)
This fixes a major degradation in usability that some users ran into.

Fixes https://github.com/zed-industries/zed/issues/8255 
Fixes https://github.com/zed-industries/zed/issues/8229

Release Notes:

- Switch from using platform prompts to toasts for LSP prompts.
([8255](https://github.com/zed-industries/zed/issues/8255),
[8229](https://github.com/zed-industries/zed/issues/8229))

<img width="583" alt="Screenshot 2024-02-23 at 2 40 05 PM"
src="https://github.com/zed-industries/zed/assets/2280405/1bfc027b-b7a8-4563-88b6-020e47869668">

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 15:18:32 -08:00
Kirill Bulatov
71557f3eb3
Adjust "recent projects" modal behavior to allow opening projects in both current and new window (#8267)
![image](https://github.com/zed-industries/zed/assets/2690773/7a0927e8-f32a-4502-8a8a-c7f8e5f325bb)

Fixes https://github.com/zed-industries/zed/issues/7419 by changing the
way "recent projects" modal confirm actions work:
* `menu::Confirm` now reuses the current window when opening a recent
project
* `menu::SecondaryConfirm` now opens a recent project in the new window 
* neither confirm tries to open the current project anymore
* modal's placeholder is adjusted to emphasize this behavior

Release Notes:

- Added a way to open recent projects in the new window
2024-02-23 13:17:31 +02:00
Marshall Bowers
0de8672044
Add SystemClock (#8239)
This PR adds a `SystemClock` trait for abstracting away the system
clock.

This allows us to swap out the real system clock with a
`FakeSystemClock` in the tests, thus allowing the fake passage of time.

We're using this in `Telemetry` to better mock the clock for testing
purposes.

Release Notes:

- N/A
2024-02-22 22:28:08 -05:00
Tung Hoang
f930969411
Allow removing workspaces from the "recent projects" modal (#7885)
<img width="492" alt="Screenshot 2024-02-19 at 10 59 01 AM"
src="https://github.com/zed-industries/zed/assets/1823955/922117f6-81c1-409d-938a-131bcec0f24c">

<img width="675" alt="Screenshot 2024-02-19 at 10 59 27 AM"
src="https://github.com/zed-industries/zed/assets/1823955/fefac68b-9a99-43bb-ac0c-724e7c622455">

Release Notes:

- Added a way to remove entries from the recent projects modal
([7426](https://github.com/zed-industries/zed/issues/7426)).
2024-02-22 01:30:02 +02:00
Kirill Bulatov
2679457b02
Rename runnables into tasks (#8119)
Release Notes:

- N/A
2024-02-21 14:56:43 +02:00
N
8a73bc4c7d
Vim: enable sending multiple keystrokes from custom keybinding (#7965)
Release Notes:

- Added `workspace::SendKeystrokes` to enable mapping from one key to a
sequence of others
([#7033](https://github.com/zed-industries/zed/issues/7033)).

Improves #7033. Big thank you to @ConradIrwin who did most of the heavy
lifting on this one.

This PR allows the user to send multiple keystrokes via custom
keybinding. For example, the following keybinding would go down four
lines and then right four characters.

```json
[
  {
    "context": "Editor && VimControl && !VimWaiting && !menu",
    "bindings": {
      "g z": [
        "workspace::SendKeystrokes",
        "j j j j l l l l"
      ],
    }
  }
]
```

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-20 15:01:45 -07:00
Conrad Irwin
b14d576349
Follower simplification (#8026)
Release Notes:

- Improved reliability of following
2024-02-20 09:41:37 -07:00
Piotr Osiewicz
f17d0b5729
Add static Runnables (#8009)
Part of #7108

This PR includes just the static runnables part. We went with **not**
having a dedicated panel for runnables.
This is just a 1st PR out of N, as we want to start exploring the
dynamic runnables front. Still, all that work is going to happen once
this gets merged.

Release Notes:

- Added initial, static Runnables support to Zed. Such runnables are defined in
`runnables.json` file (accessible via `zed: open runnables` action) and
they can be spawned with `runnables: spawn` action.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Pitor <pitor@zed.dev>
Co-authored-by: Beniamin <beniamin@zagan.be>
2024-02-19 18:41:43 +02:00
Conrad Irwin
43e8fdbe82
Fix a missing follower update on re-activate (#7918)
This could cause following to get into a bad state temporarily

Release Notes:

- Fixed a bug around following if the follow started while the workspace
was inactive.
2024-02-16 11:33:49 -07:00
Conrad Irwin
a2144faf9c
Remove environment guards (#7741)
Release Notes:

- N/A
2024-02-13 13:20:14 -07:00
Conrad Irwin
2294d99046
revert single channel click (#7738)
- Revert "collab tweaks (#7706)"
- Revert "2112 (#7640)"
- Revert "single click channel (#7596)"
- Reserve protobufs
- Don't revert migrations

Release Notes:

- N/A

**or**

- N/A
2024-02-13 12:53:49 -07:00
Conrad Irwin
21d2b5fe50
collab tweaks (#7706)
- Don't leave call when clicking on channel
- Don't prompt to leave a call you're not in

Release Notes:

- N/A
2024-02-12 16:08:35 -07:00
Paulo Roberto de Oliveira Castro
a159183f52
Add Clojure language support with tree-sitter and LSP (#6988)
Current limitations:
* Not able to navigate into JAR files 

Release Notes:

- Added Clojure language support

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-02-10 13:28:48 -08:00
Conrad Irwin
efe23ebfcd
single click channel (#7596)
- Open channel notes and chat on channel click
- WIP
- Fix compile error
- Don't join live kit until requested
- Track in_call state separately from in_room



Release Notes:

- Improved channels: you can now be in a channel without joining the
audio call automatically

**or**

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-09 14:18:27 -07:00
Antonio Scandurra
0cebf68306
Introduce a new ToggleGraphicsProfiler command (#7607)
On macOS, this will enable or disable the Metal HUD at runtime. Note
that this only works when Zed is bundled because it requires to set the
`MetalHudEnabled` key in the Info.plist.

Release Notes:

- Added a new `ToggleGraphicsProfiler` command that can be used as an
action (or via the `Help -> Toggle Graphics Profiler` menu) to
investigate graphics performance.
2024-02-09 13:29:40 +01:00
Kirill Bulatov
f734365b7b
Avoid another confirmation when submitting/discarding feedback (#7569)
Fixes https://github.com/zed-industries/zed/issues/7515

Release Notes:

- Fixed feedback modal spawning extra confirmations on cancel and submit
([7515](https://github.com/zed-industries/zed/issues/7515))
2024-02-08 16:13:54 +02:00
Marshall Bowers
374c8a4c8c
Reload theme using ThemeSettings::reload_current_theme (#7522)
This PR updates the various spots where we reload the theme to use
`ThemeSettings::reload_current_theme` instead of duplicating the code
each time.

Release Notes:

- N/A
2024-02-07 16:56:24 -05:00
Marshall Bowers
c322179bb9
Initialize the SystemAppearance using the app's global window appearance (#7508)
This PR changes our approach to initializing the `SystemAppearance` so
that we can do it earlier in the startup process.

Previously we were using the appearance from the window, meaning that we
couldn't initialize the value until we first opened the window.

Now we read the `window_appearance` from the `AppContext`. On macOS this
is backed by the
[`effectiveAppearance`](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance)
on the `NSApplication`.

We currently still watch for changes to the appearance at the window
level, as the only hook I could find in the documentation is
[`viewDidChangeEffectiveAppearance`](https://developer.apple.com/documentation/appkit/nsview/2977088-viewdidchangeeffectiveappearance),
which is at the `NSView` level.

In my testing this makes it so Zed appropriately chooses the correct
light/dark theme on startup.

Release Notes:

- N/A
2024-02-07 11:51:18 -05:00
Thorsten Ball
db39b9dadc
Add ability to bind to pane::RevealInProjectPanel (#7487)
Previously it wasn't possible to create a keybinding for this action
because it required an argument.

Now the action takes the active item of the pane and if it's a
multi-buffer the first one.

This also adds a default keybinding for Vim mode: `-` will reveal the
file in the project panel.

Fixes #7485.

Release Notes:

- Added `pane::RevealInProjectPanel` as an action in the command
palette. ([#7485](https://github.com/zed-industries/zed/issues/7485)).

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-07 12:50:22 +01:00
Piotr Osiewicz
743f9b345f
chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Conrad Irwin
d04a286634
Fix prompting the user to hang up when opening a workspace (#7408)
Before this change if you had joined a call with an empty workspace,
then we'd prompt you to hang up when you tried to open a recent project.



Release Notes:

- Fixed an erroneous prompt to "hang up" when opening a new project from
an empty workspace.
2024-02-05 15:21:18 -07:00
Conrad Irwin
0c34bd8935
fix following bugs (#7406)
- Another broken following test
- Fix following between two windows

Release Notes:

- Fixed following when the leader has multiple Zed windows open
2024-02-05 15:12:25 -07:00
Marshall Bowers
a80a3b8706
Add support for specifying both light and dark themes in settings.json (#7404)
This PR adds support for configuring both a light and dark theme in
`settings.json`.

In addition to accepting just a theme name, the `theme` field now also
accepts an object in the following form:

```jsonc
{
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  }
}
```

Both `light` and `dark` are required, and indicate which theme should be
used when the system is in light mode and dark mode, respectively.

The `mode` field is optional and indicates which theme should be used:
- `"system"` - Use the theme that corresponds to the system's
appearance.
- `"light"` - Use the theme indicated by the `light` field.
- `"dark"` - Use the theme indicated by the `dark` field.

Thank you to @Yesterday17 for taking a first stab at this in #6881!

Release Notes:

- Added support for configuring both a light and dark theme and
switching between them based on system preference.
2024-02-05 15:39:01 -05:00
Andrew Lygin
8da6e62914
Editor toolbar configuration (#7338)
Adds settings for hiding breadcrumbs and quick action bar from
the editor toolbar. If both elements are hidden, the toolbar disappears
completely.

Example:

```json
"toolbar": {
  "breadcrumbs": true,
  "quick_actions": false
}
```

- It intentionally doesn't hide breadcrumbs in other views (for
instance, in the search result window) because their usage there differ
from the main editor.
- The editor controls how breadcrumbs are displayed in the toolbar, so
implementation differs a bit for breadcrumbs and quick actions bar.

Release Notes:

- Added support for configuring the editor toolbar ([4756](https://github.com/zed-industries/zed/issues/4756))
2024-02-03 22:40:54 +02:00
Conrad Irwin
074acacdf7
Do more on channel join (#7268)
This change makes it so that if you are the first to join a channel,
your project is automatically shared.

It also makes it so that if you join a channel via a link and there are
no shared projects, you open the notes instead of an empty workspace
with nothing.

This is to try and address the discoverability of project sharing: we've
had
two reviews that have talked about channels, but not talked about
sharing
projects into them, which makes me suspect they didn't know about the
feature.

Release Notes:

- Added a setting `share_on_join` (defaulting to true). When set, and
you join an empty channel, your project is automatically shared.
2024-02-02 09:52:30 -07:00
Thorsten Ball
adc7cfb0d3
Fix moving focus to docks when navigating via keybinds (#7221)
This is a follow-up to #7141 and fixes the focus-switching to docks in
case they haven't been focused before.

We ran into issues when trying to focus a dock, that hasn't been focused
in the app's lifecycle: focus would only flip after the next re-render
(which could be triggered by moving the mouse, for example)

This changes the approach and uses the one we have for `toggle focus`
actions.

Release Notes:

- N/A

Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
2024-02-01 16:28:51 +01:00
Thorsten Ball
e65a76f0ec
Add ability to navigate to/from docks via keybindings (#7141)
This adds the ability to navigate to/from docks (Terminal, Project,
Collaboration, Assistant) via keybindings.

When using the `ActivatePaneInDirection` keybinding from the
left/bottom/right dock, we check whether the movement is towards the
center panel. If it is, we focus the last active pane.

Fixes https://github.com/zed-industries/zed/issues/6833 and it came up
in a few other tickes/discussions.

Release Notes:

- Added ability to navigate to docks and back to the editor using the
`workspace::ActivatePaneInDirection` action (by default bound to `Ctrl-w
[hjkl]` in Vim mode).
([#6833](https://github.com/zed-industries/zed/issues/6833)).

## Drawback

There's this weird behavior: if you start Zed and no files are opened,
you focus terminal, go left (project panel), then back to right to
terminal, the terminal isn't focused. Even though we focus it in the
code.

Maybe this is a bug in the current focus handling code?

## Demo


https://github.com/zed-industries/zed/assets/1185253/5d56db40-36aa-4758-a3bc-7a0de20ce5d7

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-02-01 12:18:12 +01:00
Conrad Irwin
dcca48482b
disallow opening private files (#7165)
- Disallow sharing gitignored files through collab
- Show errors when failing to open files
- Show a warning to followers when view is unshared

/cc @mikaylamaki, let's update this to use your `private_files` config
before merge.


Release Notes:

- Added the ability to prevent sharing private files over collab.

---------

Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-31 12:05:51 -08:00
Conrad Irwin
689d43047d
Don't panic when collaborating with older Zed versions (#7162)
Older Zed versions may send a buffer id of 0, which is no-longer
supported. (as of #6993)

This doesn't fix that, but it does ensure that we don't panic in the
workspace by maintaining the invariant that from_proto_state returns
Some(Task) if the variant matches.

It also converts the panic to an error should something similar happen
again in the future.


Release Notes:

- N/A
2024-01-31 11:46:03 -07:00
Marshall Bowers
e338f34097
Sort dependencies in Cargo.toml files (#7126)
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.

This should make them easier to visually scan when looking for a
dependency.

Apologies in advance for any merge conflicts 🙈 

Release Notes:

- N/A
2024-01-30 21:41:29 -05:00
Piotr Osiewicz
e6ebe7974d
gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of
global, which results in oddities at runtime.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 14:08:20 -05:00
Marshall Bowers
0cb8b0e451
Clean up Cargo.toml files (#7044)
This PR cleans up some inconsistencies in the `Cargo.toml` files that
were driving me crazy.

Release Notes:

- N/A
2024-01-29 23:47:20 -05:00
Piotr Osiewicz
0a0a866dd5
Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535)
Release Notes:
- N/A
2024-01-27 13:51:16 +01:00
Conrad Irwin
08de0d88b1 Update channel moving to match 2024-01-26 10:07:51 -07:00
Conrad Irwin
01424a62ea Allow prompts to have detail, and use for good
Make channel panel errors louder
2024-01-24 23:15:37 -07:00
Conrad Irwin
4bcd3494b7 Try to send typed errors back and forth
TEMP

TEMP

First pass of structured errors

Improved error handling for channel joining failures
2024-01-24 20:32:39 -07:00
Joseph T. Lyons
40dbe15b2a Update all links point to community 2024-01-24 15:11:17 -05:00
Conrad Irwin
2a11c22760 Ensure chat opens when guests join shared projects
This was broken because the panel was created before being added to a
dock. Invert the control order and add `starts_open()` to the Panel
trait.
2024-01-24 12:06:03 -07:00
Antonio Scandurra
4665b9afb6
Improve startup time (#4248)
Since our last measurements, startup time in Zed had regressed quite
significantly. This was due to several issues:

- We were loading IBMPlex, which we're not really using in the UI.
- Images were being parsed in the foreground, thus blocking the main
thread
- Language models (for semantic index and assistant) were being loaded
in the foreground, thus blocking the main thread
- Interaction with the keychain was blocking the main thread

In addition to these, with this pull request we will now deserialize the
items for a pane in parallel, as opposed to doing so sequentially.

All combined, when running the zed binary directly this brings startup
time from ~350ms to ~210ms on my machine.

Release Notes:

- Improved startup time.
2024-01-24 15:39:05 +01:00
Piotr Osiewicz
0d0c85a5ee Fix typo in comment 2024-01-24 14:03:12 +01:00
Piotr Osiewicz
fe2cb9f9ca fixup! pane: Another stab at focus flickers in tab bar 2024-01-24 14:01:17 +01:00
Piotr Osiewicz
0497b2f212 pane: Another stab at focus flickers in tab bar
This time around, we address the flicker seen in #3857 by querying the active item (that might've just been added),
as it knows whether it has focus even if the parent Pane does not.

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-01-24 13:57:55 +01:00
Antonio Scandurra
e4604ebedf Parallelize deserialization of pane items on startup
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2024-01-24 12:48:53 +01:00
Thorsten Ball
027f425804 Fix tab bar button's focus handling lagging behind
This fixes https://github.com/zed-industries/community/issues/2442 for
me.

Previously, the tab bar buttons would stay when the chat panel was
opened (and received focus) until something else was drawn (or caused a
render?)

With this change, the tab bar buttons are only shown if the pane was
focus.

I'm not sure about the side-effects of this, but the toolbar still seems
to work fine.
2024-01-24 11:47:59 +01:00
Piotr Osiewicz
f2ff7fa4d5
chore: Change AGPL-licensed crates to GPL (except for collab) (#4231)
- [x] Fill in GPL license text.
- [x] live_kit_client depends on live_kit_server as non-dev dependency,
even though it seems to only be used for tests. Is that an issue?

Release Notes:
- N/A
2024-01-24 00:26:58 +01:00
Piotr Osiewicz
21e6b09361
Remove license-file from Cargo.toml as it is apparently redundant (#4218)
Release Notes:

- N/A
2024-01-23 17:40:30 +01:00
Piotr Osiewicz
678bdddd7d
chore: Add crate licenses. (#4158)
- GPUI and all dependencies: Apache 2
- Everything else: AGPL

Here's a script that I've generated for it:
https://gist.github.com/osiewicz/6afdd6626e517da24a2092807e6f0b6e

Release Notes:
- N/A

---------

Co-authored-by: David <david@zed.dev>
2024-01-23 16:56:22 +01:00
Conrad Irwin
c5465d26f8
Fix panel deserialization (#4198)
In the old world, panel loading happened strictly before workspace
deserialization. Now it's inverted.

Fix this by storing on the dock the serialized state so they can restore
state as panels are loaded.

[[PR Description]]

Release Notes:

- Fixed Zed forgetting which panels were open on boot.
([#2406](https://github.com/zed-industries/community/issues/2406)).
2024-01-22 12:37:38 -07:00
Conrad Irwin
36a8bbfd43 Fix panel deserialization
In the old world, panel loading happened strictly before workspace
deserialization. Now it's inverted.

Fix this by storing on the dock the serialized state so they can restore
state as panels are loaded.
2024-01-22 12:31:28 -07:00
Julia
2c3d9805a4 Store a z-index id per-layer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2024-01-22 10:16:59 -05:00
Piotr Osiewicz
b5cb8323d4 lsp-log: Reemit Editors search events.
NextMatch/PreviousMatch did not work due to us not updating the match index in the buffer search (that relied on an event being emitted).
2024-01-22 14:02:48 +01:00
Mikayla
c05edee2b5
Port the rest of the app 2024-01-21 20:26:33 -08:00
Piotr Osiewicz
6c82380232 chore: Fix clippy::needless_borrow up to an editor 2024-01-21 15:03:24 +01:00
Piotr Osiewicz
c3102feeeb chore: use WindowContext in Workspace where it is a sufficient context type 2024-01-21 14:28:19 +01:00
Mikayla
a44aae9e91
Finish documenting the action, asset, color, and element modules in GPUI
Remove SmallVec from the public API of GPUI
2024-01-20 20:15:23 -08:00
Mikayla
33105486aa
Make platform input handler private
Automatically record the context on non-view input handlers
Simplify the async window context update() method
2024-01-20 06:56:19 -08:00
Marshall Bowers
24de848fdf
Prevent breadcrumbs from overflowing the toolbar (#4177)
This PR prevents the breadcrumbs from overflowing the toolbar when its
contents are long:

<img width="1270" alt="Screenshot 2024-01-19 at 6 15 58 PM"
src="https://github.com/zed-industries/zed/assets/1486634/ecee7a42-51ef-43d4-99a1-9c3da784dede">

Release Notes:

- Fixed an issue where long breadcrumbs would overflow the toolbar.
2024-01-19 18:23:14 -05:00
Marshall Bowers
4ce0c27e0a
Remove more commented-out code (#4150)
This PR removes some more commented-out code from various spots in the
codebase.

Release Notes:

- N/A
2024-01-18 23:17:41 -05:00
Marshall Bowers
decf320a74
Rename overflow_hidden_{x,y} to overflow_{x,y}_hidden (#4146)
This PR renames the `overflow_hidden_x` and `overflow_hidden_y` methods
to `overflow_x_hidden` and `overflow_y_hidden`, respectively.

This provides consistency with our `overflow_x_scroll` /
`overflow_y_scroll` methods, as well as better matches Tailwind's
naming.

Release Notes:

- N/A
2024-01-18 22:10:41 -05:00
Marshall Bowers
9993418f58
Prevent diagnostics from overflowing the status bar (#4145)
This PR makes it so long diagnostic messages no longer overflow the
status bar and push the right tools off-screen.

Here is an example with a long (placeholder) diagnostic message:

<img width="1136" alt="Screenshot 2024-01-18 at 9 47 07 PM"
src="https://github.com/zed-industries/zed/assets/1486634/18568527-c608-4d4a-9118-b84c6d81c13e">

Release Notes:

- Fixed long diagnostic messages overflowing the status bar.
2024-01-18 21:56:37 -05:00
Conrad Irwin
6c2da0d25b Revert "Store a z-index id per-layer (#4128)"
This reverts commit 28a2337218, reversing
changes made to e992f84735.
2024-01-18 13:28:23 -07:00
Julia
28a2337218
Store a z-index id per-layer (#4128)
Release Notes:

- N/A
2024-01-18 13:31:45 -05:00
Max Brunsfeld
bfe76316f7
Invoke pane's focus_in handler when pane is focused directly (#4129)
Fixes a bug where, when focusing a pane directly, it failed to transfer
focus to the active item.
2024-01-18 10:26:03 -08:00
Julia
bc2302f723 Store a z-index id per-layer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2024-01-18 13:24:25 -05:00
Max Brunsfeld
2e35d900e0 Invoke pane's focus_in handler when pane is focused directly 2024-01-18 10:13:03 -08:00
Conrad Irwin
2835c9a972 Don't send follower events from other panes
Co-Authored-By: Mikayla <mikayla@zed.dev>
2024-01-18 10:42:49 -07:00
Piotr Osiewicz
b6d8665fc1 pane: stop propagation of drag/click events in resizing handle
This prevents focused editor from being scrolled while a pane is getting resized.

Fixes: Mouse down to start an editor resize causes a scroll
2024-01-18 14:24:03 +01:00
Kirill Bulatov
b6786d5e41 Use a proper action when clicking navigate forward button 2024-01-18 11:37:02 +02:00
Joseph T. Lyons
b807e6fe80 Use try_global() 2024-01-18 01:33:30 -05:00
Mikayla
57400e9687
Fix typos detected by crate-ci/typos 2024-01-17 14:31:21 -08:00
Conrad Irwin
65664452f5
Allow leaving calls once project is unshared (#4081)
Release Notes:

- Fixes a bug where you could not use call controls after a project was
unshared
2024-01-17 08:34:45 -07:00
Kirill Bulatov
a601e96b6c Style collab notifications properly 2024-01-17 16:44:43 +02:00
Kirill Bulatov
39dff0e827 Stop using button for collab notifications 2024-01-17 11:06:46 +02:00
Conrad Irwin
1d5b237b64 Allow leaving calls once project is unshared 2024-01-16 21:54:13 -07:00
Conrad Irwin
6bcc97ead4
channel management fixes (#4066)
- Close modals when focus leaves
- Disallow self-management for admins

Release Notes:

- Fixes changing role of invited channel members
2024-01-16 14:53:14 -07:00
Mikayla Maki
d00067cd86
Switch project search deploy behavior to be isolated to a pane (#4072)
This adjusts the solution in
https://github.com/zed-industries/zed/pull/4014 to fix the double-focus
issue, allowing each pane's project search to work independently.

Release Notes:

- Changed the name of the `workspace::DeploySearch` action to
`pane::DeploySearch` and changed it's behavior to open a new search OR
focus an existing project search in the current pane.
(https://github.com/zed-industries/community/issues/2395)
2024-01-16 10:41:57 -08:00
Mikayla
36ff35fcca
Change name of deploy action to indicate what scope it operates at 2024-01-16 10:30:21 -08:00
Conrad Irwin
18739477f7 Clippy 2024-01-15 20:12:20 -07:00
Conrad Irwin
62232060e6 Close modals when focus leaves
This is more similar to zed1's behaviour, and allows us to work around
the difficulty in defining `on_mouse_down_out` for modals that have
overlays.
2024-01-15 19:20:35 -07:00
Joseph T. Lyons
acf85db44e
Add more open events (#4061)
Adds open events for

- Welcome page
- Project search
- Project diagnostics

Release Notes:

- N/A
2024-01-15 16:36:24 -05:00
Joseph T. Lyons
24db41fcdd Remove debugs 2024-01-15 16:29:58 -05:00
Joseph T. Lyons
ba9a9f4f17 Add more open events
project search
diagnostics
welcome page
2024-01-15 16:26:04 -05:00
Antonio Scandurra
e60117dc54 Avoid panicking when closing a dragged tab
Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>
2024-01-15 19:46:34 +01:00
Marshall Bowers
90f4c70a82
Rename h_stack and v_stack to h_flex and v_flex, respectively (#4053)
This PR renames the `h_stack` and `v_stack` to `h_flex` and `v_flex`,
respectively.

We were previously using `h_stack` and `v_stack` to match SwiftUI, but
`h_flex` and `v_flex` fit better with the web/flexbox terminology that
the rest of GPUI uses.

Additionally, we were already calling the utility functions used to
implement `h_stack` and `v_stack` by the new names.

Release Notes:

- N/A
2024-01-15 11:34:06 -05:00
Marshall Bowers
b136d21ebf
Make tab close button square (#4052)
This PR makes the close button for tabs square.

`IconButton` now accepts a `shape`, and using `IconButtonShape::Square`
will ensure the `IconButton` is square with respect to its contained
icon.

#### Before

<img width="119" alt="Screenshot 2024-01-15 at 10 32 40 AM"
src="https://github.com/zed-industries/zed/assets/1486634/dc806b9b-411f-4cd9-8c10-676d2cbd298b">

#### After

<img width="116" alt="Screenshot 2024-01-15 at 10 32 24 AM"
src="https://github.com/zed-industries/zed/assets/1486634/8b4ef43c-14b6-449f-a235-5d7affd82c4e">

Release Notes:

- Changed the tab close button to be square.
2024-01-15 10:43:03 -05:00
Antonio Scandurra
4ff514ca7e Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/gpui/src/elements/div.rs
2024-01-15 11:37:46 +01:00
Conrad Irwin
29ce109211
chat panel ++ (#4044)
- Update chat panel with current channel
- Open chat panel for guests
- Open chat when joining a channel with guests
- Some tweaks for chat panels
- Don't lose focus on default panel state
- Make chat prettier (to my eyes at least)
- Fix multiple mentions in one message
- Show a border when scrolled in chat
- Fix re-docking chat panel
- Move settings subscription to dock

[[PR Description]]

Release Notes:

- Opens chat by default when joining a public channel
- Improves chat panel UI
2024-01-14 13:54:10 -07:00
Conrad Irwin
b34c78016f Fix tests for TestPanel 2024-01-14 12:26:54 -07:00
Conrad Irwin
898645681f Move settings subscription to dock
Reduces likelihood of panels being unable to move themselves
2024-01-13 22:41:26 -07:00
Mikayla
bfb59f1598
Remove last stale code 2024-01-12 20:59:19 -08:00
Antonio Scandurra
94293b3bf9 Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/gpui/src/window.rs
2024-01-12 14:31:13 +01:00
Max Brunsfeld
258c2fdad4 Fix routing of leader updates from unshared projects
Previously, leader updates in unshared projects would be sent to
all followers regardless of project, as if they were not scoped
to any project.
2024-01-11 13:47:31 -08:00
Conrad Irwin
43183538a7
Stop following when project is unshared (#4010)
Before this change the views would continue to update in the background
of the "disconnected" dialogue, which was disconcerting.

[[PR Description]]

Release Notes:

- Fixed an edge-case where following didn't handle unshare correctly
2024-01-11 11:26:56 -07:00
Kirill Bulatov
2e36b0b72a Do not split on only external directories being drag and dropped 2024-01-11 15:09:43 +02:00
Conrad Irwin
f418bd907d Stop following when project is unshared
Before this change the views would continue to update in the background
of the "disconnected" dialogue, which was disconcerting.
2024-01-10 23:09:09 -07:00
Mikayla
a5ca58354d
Fix first few asserts 2024-01-10 18:26:01 -08:00
Antonio Scandurra
1c260e6dfd Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/copilot/src/sign_in.rs
#	crates/gpui/src/window.rs
#	crates/workspace/src/pane_group.rs
2024-01-10 22:58:52 +01:00
Conrad Irwin
5dff458014
Ensure focus_in and focus_out fire on window activation (#3993)
Also:
- Rename cx.on_blur to cx.on_focus_lost
- Fix a bug where notify calls in focus handlers were ignored
- Fix a bug where vim would get stuck in the wrong mode when switching
  windows

Release Notes:

- (preview only) vim: fix switching between multiple windows
2024-01-10 10:00:07 -07:00
Antonio Scandurra
2923b71f83 Replace WindowContext::notify with WindowContext::refresh 2024-01-10 17:27:02 +01:00
Conrad Irwin
5d3f5611e5
guest promotion (#3969)
Release Notes:

- Adds the ability to promote read-only guests to read-write
participants in calls
2024-01-09 22:21:13 -07:00
Conrad Irwin
1bf33b4b61 Ensure focus_in and focus_out fire on window activation
Also:
- Rename cx.on_blur to cx.on_focus_lost
- Fix a bug where notify calls in focus handlers were ignored
- Fix a bug where vim would get stuck in the wrong mode when switching
  windows
2024-01-09 20:55:00 -07:00
Mikayla Maki
45baad2825
Remove or fix stale todos (#3990)
The software equivalent of dusting

Release Notes:

-
2024-01-09 18:37:35 -08:00
Mikayla
e786e22121
And a few more todos 2024-01-09 16:41:17 -08:00
Mikayla
9ce7ef8949
Remove the last of the major todos 2024-01-09 16:14:54 -08:00
Conrad Irwin
276bfa0fab Merge branch 'main' into guest-promotion 2024-01-09 16:28:42 -07:00
Kirill Bulatov
8b71b1d07b Do not dismiss buffer search when any modal is present
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
2024-01-09 23:29:05 +02:00
Marshall Bowers
fa53353c57
Rename IconElement to just Icon (#3974)
This PR renames the `IconElement` component to just `Icon`.

This better matches the rest of our components, as `IconElement` was the
only one using this naming convention.

The `Icon` enum has been renamed to `IconName` to free up the name.

I was trying to come up with a way that would allow rendering an
`Icon::Zed` directly (and thus make the `IconElement` a hidden part of
the API), but I couldn't come up with a way to do this cleanly.

Release Notes:

- N/A
2024-01-09 10:11:20 -05:00
Kirill Bulatov
625c9d8980 Remove some todo!'s 2024-01-09 11:36:36 +02:00
Conrad Irwin
844d161c40 Allow adding write access to guests 2024-01-08 22:02:56 -07:00
Mikayla
51caa74349
Restore the active pane magnification feature 2024-01-08 15:48:31 -08:00
Conrad Irwin
c951b4c5fa
Fix prevention of cross-channel joins (#3949)
Co-Authored-By: Max <max@zed.dev>

[[PR Description]]

Release Notes:

- (Added|Fixed|Improved) ...
([#<public_issue_number_if_exists>](https://github.com/zed-industries/community/issues/<public_issue_number_if_exists>)).
2024-01-08 14:17:44 -07:00
Conrad Irwin
ed76315387 Fix prevention of cross-channel joins
Co-Authored-By: Max <max@zed.dev>
2024-01-08 13:47:27 -07:00
Piotr Osiewicz
e4b1c76895
Display setting documentation in settings.json (#3936)
Let this screenshot of settings.json speak for itself: 

![image](https://github.com/zed-industries/zed/assets/24362066/fca60383-1788-43f9-803b-00f083394c8a)

Release Notes:
- Added code completion & on-hover documentation to Zed's settings.json
file.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-08 19:30:18 +01:00
Antonio Scandurra
84c36066bc Start on caching views
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2024-01-08 19:07:20 +01:00
Piotr Osiewicz
97aed8a4d7
Restore ability to reset pane split size by double clicking drag handle. (#3937)
Release notes
- Fixed double clicking on pane drag handle not resetting pane's split
size.
- Fixed pane group sizes not being serialized.
2024-01-08 16:48:17 +01:00
Piotr Osiewicz
53564fb269
Bring back zed.rs tests (#3907)
At present 3 tests still fail; 2 are related to keymap issues that (I
believe) @maxbrunsfeld is working on. The other one
(`test_open_paths_action`) I'll look into. edit: done
This PR also fixes workspace unregistration, as we've put the code to do
that behind `debug_assert`
(https://github.com/zed-industries/zed/pull/3907/files#diff-041673bbd1947a35d45945636c0055429dfc8b5985faf93f8a8a960c9ad31e28L649).
Release Notes:
- N/A
2024-01-08 12:29:54 +01:00
Kirill Bulatov
419b4d029c
External file drag and drop (#3933)
Deals with https://github.com/zed-industries/community/issues/1317
Deals with https://github.com/zed-industries/community/issues/486

Reworks pane drag and drop code to support 
* dropping external files into main pane (supports splits same as tabs
and project entries drop) — this will open the file dropped
* dropping external files, tabs and project entries drop into the
terminal — this will add file abs path into the terminal

Release Notes:

- Added a way to drag and drop external files into Zed main & terminal
panes; support tabs and project entries drop into terminal pane
2024-01-07 13:37:49 +02:00
Joseph T. Lyons
5344296c9a Remove immediate flush mode
Allow flush method to be called publicly. This is a better, simpler solution, that allows for better control over flushing.
2024-01-06 20:27:30 -05:00
Kirill Bulatov
4f88a50aad On external file drop, add visible project entries for directories only 2024-01-07 03:11:28 +02:00
Kirill Bulatov
518868a12f Implement terminal pane drag and drop overrides 2024-01-07 02:21:43 +02:00
Kirill Bulatov
c4e306162c Implement external file drop in pane 2024-01-07 01:18:02 +02:00
Kirill Bulatov
8ff05c6a72 Prepare for external file drop in pane 2024-01-07 01:17:49 +02:00
Joseph T. Lyons
cdd5cb16ed WIP 2024-01-06 14:41:35 -05:00
Kirill Bulatov
669293e749 Screenshare item background is now of editor background's color 2024-01-06 02:01:12 +02:00
Conrad Irwin
204ef451d0 Merge branch 'main' into following-tests 2024-01-05 16:14:12 -07:00
Conrad Irwin
f239a8292e More following tests 2024-01-05 16:13:40 -07:00
Conrad Irwin
81d707adbc Port 1.00 following tests
Co-Authored-By: Max <max@zed.dev>
2024-01-05 15:55:33 -07:00
Piotr Osiewicz
254a52d0a1
gpui: Remove dependency on sqlez (#3871)
This removes one of the path dependencies in gpui that's only really
needed by `workspace` (which can work around lack of these
implementations by itself). In theory it should also improve build
scheduling (as gpui doesn't have to wait for main dependency of sqlez -
libsqlite3 - to finish it's 25 seconds-long build in release), though in
practice I didn't notice a substantial improvement.
Moreover `sqlez` was unused by `settings` too, so that's removed
as well.

Release Notes:

- N/A
2024-01-05 19:36:55 +01:00
Conrad Irwin
1a993ca496
Read-only access for channel guests (#3841) 2024-01-05 11:21:18 -07:00
Conrad Irwin
c066480e31
Fix dock right click labels (#3626)
Release Notes:

- N/A
2024-01-05 10:08:58 -07:00
Conrad Irwin
3c0052850c Merge branch 'main' into channel-guests 2024-01-05 10:05:59 -07:00
Conrad Irwin
df0076a4eb
Better TestWindow support (#3876)
Adding guest roles led us down a rabbit hole where we'd have liked to
rely on a
side-effect of activating a window in tests; but the test window didn't
implement that.

Looking into that, I realized our TestWindow wasn't doing a great job of
emulating the MacWindow, so this makes the two more similar.
2024-01-05 09:59:48 -07:00
Conrad Irwin
fa73cf3983 Correct dock menu names 2024-01-05 09:58:07 -07:00
Kirill Bulatov
bf11a04410 Remove extra dbg!'s 2024-01-05 17:48:07 +02:00
Kirill Bulatov
92d6a8c253
Return back git status colors for tab labels (#3906) 2024-01-05 13:52:51 +02:00
Kirill Bulatov
3070a6ef26 Return back git status colors for tab labels 2024-01-05 12:38:42 +02:00
Antonio Scandurra
3e6b4a1298
Don't shift pane content when following someone (#3905)
Release Notes:

- Fixed a bug that would shrink the pane when following someone.
2024-01-05 11:01:23 +01:00
Antonio Scandurra
cf03ea2da9 Don't shift pane content when following someone 2024-01-05 10:55:33 +01:00
Conrad Irwin
fff415e3e9 Improve deactivate simulation 2024-01-04 22:06:52 -07:00
Kirill Bulatov
4dbec66cdd Return back old project search behavior as default.
Add a `workspace::DeploySearch` action and use it as a default for "cmd-shift-f" binding.
This action opens existing search tab if it exists, or creates a new one otherwise.
`workspace::NewSearch` action is still available and always opens an existing search tab.
2024-01-04 21:17:24 +02:00