We were mistakenly pushing an opaque layer without intersecting it with
the content mask. Also, we were pushing two opaque layers for the same
div unnecessarily.
Release Notes:
- N/A
We were mistakenly pushing an opaque layer without intersecting it
with the content mask. Also, we were pushing two opaque layers for
the same div unnecessarily.
This commit also allows turning an `ArenaBox` into an `ArenaRef` when
non-mutable access is required, which makes `ArenaRef: Clone`. This fixes
a bug that prevented the command palette from reading all the available
actions while the `command_palette::Toggle` action was being dispatched.
This prevents the `cmd-k` keystroke, which clears the terminal, from
staying around as a pending keystroke on the parent workspace.
Release Notes:
- N/A
Rather than relying on the focused element, instead explicitly pass the
focus handle for the query editor when determining the prev/next
bindings. Only compute these values once.
Release Notes:
- N/A
Once a drag starts, we won't fire click listeners or style any elements
as active.
- Don't fire click listeners or show active state once a drag is in
progress
- Don't show hover style when a drag is in progress
- Draw borders above content
- If borders are opaque, apply them to the content mask. This prevents
hovers from firing on content underneath the border, which was creating
issues where the drag handle was inside the border, so we'd flicker the
hover when the mouse moved out of the drag handle and into the 1px
border on the left dock.
- Add a `block_mouse` helper which causes transparent elements to paint
an "opaque" layer to prevent mouse events from falling through. We use
this for the drag handle as well to disable hover, click, etc on items
in the panel.
Release Notes:
- N/A
* Ensure that views' on_release callbacks are always called (even if
their window is gone), by passing them a `AppContext`, not a
`WindowContext`.
* Fix leaked handles to `CollabPanel`, `NotificationPanel`, and
`ChatPanel` caused by captures in a `ListState` render callback.
This fixes two issues we were seeing with following:
* inability to rejoin a remote project after you closed it
* following not working if a window had previously been closed
This allows the content mask to correctly apply to bounds used in event handlers,
which prevents content under opaque borders from being hovered in overflow hidden
containers.
Co-Authored-By: Antonio <antonio@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
It looks like we neglected to incorporate surfaces into the
plane-splitting code path, which assigns each graphics primitive's draw
order.
This fixes an issue where screensharing frames were not visible when the
screenshare tab was zoomed.
This could cause multiple mutable references to be acquired for the same
arena element, which is unsafe. I didn't see it cause problems in
practice, but I realized this could have been a problem and fixed it
before it bit us.
Release Notes:
- N/A
The problem was caused by a missing call to `WindowContext::notify` when
moving the mouse. Actually, we *did* notify as part of a `MouseMoveEvent`
listener registered in `Interactivity` but that code path was never
exercised because we were clearing the `pending_mouse_down`.
This commit fixes the issue by automatically redrawing the window in gpui
when there is an active drag and the mouse moves.
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.
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
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
* allow confirming all items via the keyboard
* allow deploying the channel context menu via the keyboard
* add missing selected styling for list items
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
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
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
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.
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.
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.
* 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>
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
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
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
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
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.
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
[[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
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
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
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>
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
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
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
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>
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
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
We've noticed how leaving a call with multiple windows open would still
prompt with the popup along the lines of "Do you want to leave the
current call?". In Zed1, that popup only showed up when you've had just
one window open.
The code for prompting did not change at all between zed1 and zed2, but
the way we calculate the window count did. Calling AppContext::windows
to get all window handles from WindowContext::update essentially
excluded the window we were updating (that is the window being closed)
from the returned Vec of window handles. I've decided to keep the code
as close to original as possible (as the alternative would be to change
the \# of workspaces needed for a prompt to pop up). We now query the
window handles via a deref to AsyncAppContext, which does not exclude
"our" window handle from the returned results.
Release Notes:
- N/A
Header and footer are gonna be added in a separate PR as they require
changes to Picker trait that I feel are separate from the contents of
this PR.
Release Notes:
- N/A
This PR changes project search bar's flex axis to `column`.
This fixes an issue where toggling the filters would cause the search
controls to center themselves vertically instead of staying next to the
search input.
Release Notes:
- N/A
This PR:
- Fixes several bugs with dock resizing
- Adds a new drag move API for resizes
- Adds special debug styling for elements, including auto-opening Zed at
the element's location in source
- Changes the `cx.paint_quad()` API to take a type and adds several
helpers to create this type.
- Adds `()` as the empty element, and uses it to implement a derive
macro for the `Render` trait.
Release Notes:
- N/A
This PR fixes an issue where the outer `ListItem` element was using a
static ID instead of the one provided to the component.
Now that active states are fixed, this meant that any time there were
sibling list items they would share active states if one of them was
clicked.
Release Notes:
- N/A
This PR implements the `VisibleOnHover` trait for `IconButton`s.
I noticed that in a lot of places we were wrapping an `IconButton` in an
extra `div` just so we could call `visible_on_hover` on it. By
implementing the trait on `IconButton` directly it allows us to avoid
the interstitial `div` entirely.
Release Notes:
- N/A
This PR adds a `.visible_on_hover` helper method that can be used to
make an element only visible on hover.
I noticed we were repeating this similar stanza in a bunch of different
spots:
```rs
some_element
.invisible()
.group_hover("", |style| style.visible())
```
so it seemed like a nice thing to factor out into a reusable utility.
Release Notes:
- N/A
This PR reworks the `ListItem` and `ListHeader` components to use
slot-based APIs, making them less opinionated about their contents.
Splitting this out of the collab UI styling PR so we can land it to
avoid conflicts.
Co-authored-by: Nate <nate@zed.dev>
Release Notes:
- N/A
This PR fixes an issue where the tab bar drop target was not receiving
any size.
The styling isn't 100% correct yet, as the updated background color has
a gap around it.
Release Notes:
- N/A
This PR fixes the styling of the project search tabs.
We now have spacing between the icon and the tab label, as well as use
the correct color for the icon based on whether the tab is active or
not.
Release Notes:
- N/A