This PR mainlines the current state of new GPUI2-based UI from the
`gpui2-ui` branch.
Included in this is a performance improvement to make use of the
`TextLayoutCache` when calling `layout` for `Text` elements.
Release Notes:
- N/A
---------
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Before (code in screenshot is from this branch,
`crates/zed/languages/rust.rs:179`):
![image](https://github.com/zed-industries/zed/assets/24362066/6b709f8c-1b80-4aaa-8ddc-8db9dbca5a5e)
Notice how the last 2 entries (that are async functions) are not
highlighted properly.
After:
![image](https://github.com/zed-industries/zed/assets/24362066/88337f43-b97f-4257-9c31-54c9023e8dbb)
This is slightly suboptimal, as it's hard to tell that this is an async
function - I guess adding an `async` prefix is not really an option, as
then we should have a prefix for non-async functions too. Still, at
least you can tell that something is a function in the first place. :)
Release Notes:
- Fixed Rust async functions not being highlighted in completions.
Fixes this panic that I've been seeing in Slack:
[example](https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1696530575535779)
```
thread 'main' panicked at 'assertion failed: opened_items.len() == project_paths_to_open.len()'
crates/workspace/src/workspace.rs:3628
<backtrace::capture::Backtrace>::create
<backtrace::capture::Backtrace>::new
Zed::init_panic_hook::{closure#0}
std::panicking::rust_panic_with_hook
std::panicking::begin_panic_handler::{{closure}}
std::sys_common::backtrace::__rust_end_short_backtrace
_rust_begin_unwind
core::panicking::panic_fmt
core::panicking::panic
<workspace::Workspace>::new_local::{closure#0}::{closure#0}
```
I believe it was caused by a window being closed immediately, while it
was still loading some paths. There was a mismatch in expectation
between the `workspace::open_items` function (which contains this
assertion), and the `Workspace::load_workspace` method. That later
method can return an empty vector if the workspace handle is dropped
while it is executing.
Release Notes:
- Fixed a crash when closing a Zed window immediately after opening it
This fixes some bugs in our following logic, due to our attempts to
prevent infinite loops when two people follow each other.
* Propagate all of leader's views to a new follower, even if those views
were originally created by that follower.
* Propagate active view changes to followers, even if the active view is
following that follower.
* Avoid redundant active view updates on the client.
Release Notes:
- Fixed bugs where it was impossible to follow someone into a view that
they previously following you into.
TODO:
- [x] Add markdown rendering to channel chat
- [x] Unify (?) rendering logic between hover popover and chat
- [x] ~~Determine how to deal with document-oriented markdown like `#`~~
Unimportant until we want to do something special with `#channel`
- [x] Tidy up spacing and styles in chat panel
Release Notes:
- Added markdown rendering to channel chat
- Improved channel chat message style
- Fixed a bug where long chat messages would not soft wrap
* Propagate all of leader's views to a new follower, even if those views
were originally created by that follower.
* Propagate active view changes to followers, even if the active view is
following that follower.
* Avoid redundant active view updates on the client.
Also, remove logic for implicitly marking chat messages as observed when
they are fetched. I think this is unnecessary, because the client always
explicitly acknowledges messages when they are shown.
Release Notes:
- Fixed a bug where chat messages were shown out of order (preview only)
This PR adds a mechanism for notifying the client when a channel note
has been edited or a message has been changed.
TODO:
- [x] Fix infinite loop when opening the chat panel
- [x] Switch to client-side ack model of observation detection
- [x] Add client-side-only change detection (e.g. for when a channel
note is open locally but not focused)
- [x] Review implementation / query performance.
- [x] Fix lack of ACK on restart for channel buffers
- [x] remove channel note opening on click
- [x] Fix channel messages sent while chat channel is in the background
not showing the channel as changed.
Release Notes:
- N/A
Release Notes:
- Clicking on a channel in the sidebar will now join the channel and
open the notes
- If you join a channel that already shared projects, you will join the
projects automatically and follow the host.
- Clicking on the current channel in the sidebar will re-open the notes.
- Chat can now be accessed from the right click menu of channels.
- (probably not worth mentioning) Various improvements to hover states
and tooltips in the collab ui; and if you click on a channel while in
another call, confirm before switching.