Commit Graph

13056 Commits

Author SHA1 Message Date
Julia
60b79ef2ea Prevent content mask breaks from having the same z-index
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-16 11:23:28 -05:00
Julia
4f25df6ce2 Prevent div background/content/border from interleaving at same z-index
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-16 11:22:14 -05:00
Julia
4e0c8dcea9 Revert "Use taffy to retrieve the parent for a given layout node"
This reverts commit 5904bcf1c2.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-16 10:44:24 -05:00
Thorsten Ball
f938bae0a2 Use NSScreen to fetch primary display
According to Chromium source, `NSScreen::screens` should always get us
one display.

We made this change because we ran into panics caused by the previous
`unwrap()` when `CGGetActiveDisplayList` might return an empty list.
2024-01-16 14:23:10 +01:00
Thorsten Ball
03bfe3ef80 Call CGGetActiveDisplayList once to avoid panic
Previously we called CGGetActiveDisplayList twice: once to get the
number of displays and then to get the displays.

We saw a panic due to no displays being returned here. As a first
attempt to fix the panic, we're reducing the amount of calls to
CGGetActiveDisplayList and just do one with the trade-off being that we
pre-allocate 32 pointers in a Vec.
2024-01-16 12:01:54 +01:00
Kirill Bulatov
074966427d Fix previous theme not being applied on startup 2024-01-16 11:23:34 +02:00
Kirill Bulatov
ec3cfc33d6
Adds a way to select items under multiple carets (#4067)
Deals with https://github.com/zed-industries/community/issues/2374

Release Notes:

- Added a way to select items under multiple carets with
`editor::SelectNext` and `editor::SelectPrevious` commands
2024-01-16 11:08:48 +02:00
Kirill Bulatov
25abe8f981 Fix the tests 2024-01-16 10:58:27 +02:00
Kirill Bulatov
fbb363e83a Add tests 2024-01-16 10:07:31 +02:00
Joseph T. Lyons
268d156fad Add command palette action events 2024-01-15 20:22:47 -05:00
Max Brunsfeld
deac172e39
Restore re-rendering of editors on buffer font size changes (#4064)
Now that views are cached, we need to explicitly `.notify()` text
editors when the buffer font size changes.

* [x] Notify editors when settings change, or adjusting buffer font size
* [x] Figure out why non-focused editors still do not re-render when
adjusting buffer font size
* [x] Reset buffer font size adjustment when the size is updated in the
user's settings
2024-01-15 17:13:13 -08:00
Max Brunsfeld
d84785f7e8 Put back logic for resetting buffer font adjustment on settings change. 2024-01-15 17:03:02 -08:00
Max Brunsfeld
1e755aa00f Notify global observers when removing a global 2024-01-15 17:02:20 -08:00
Max Brunsfeld
8f1633e798 Iterate from leaf to root when marking views dirty in notify 2024-01-15 16:49:06 -08:00
Conrad Irwin
f220323176
Fix fallback font (#4062)
As this is used if you mis-spell "buffer_font_family", it should be
monospace.

Also treat "Zed Mono" and "Zed Sans" as valid fonts

Follow up to #4045

Release Notes:

- Fixes font validation to allow "Zed Mono" as a valid font
2024-01-15 17:08:04 -07:00
Max Brunsfeld
8f262892a0 Notify editors on buffer font size changes 2024-01-15 14:53:24 -08:00
Max Brunsfeld
e57c32effb
Avoid playing newly published audio tracks when deafened (#4040)
Release Notes:

- Fixed a bug where the 'deafen' button would only apply to audio from
the call's current participants, but not any participants who joined
after the button was pressed.
- Fixed a bug where after being granted write access to a channel, the
microphone icon appeared non-muted, even though audio was not shared.
2024-01-15 14:08:49 -08:00
Max Brunsfeld
e90794d3ec Add and enhance tests for muting/deafening, fix exposed logic errors 2024-01-15 14:03:38 -08:00
Kirill Bulatov
55671eac40 Select next/previous word for multiple carets if possible 2024-01-15 23:42:36 +02: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
Antonio Scandurra
b565c44a9e
Avoid panicking when closing a dragged tab (#4057)
Release Notes:

- Fixed a panic that could occur when closing a tab while dragging it.
2024-01-15 22:34:33 +01:00
Conrad Irwin
f0ed80cd8e Fix fallback font
As this is used if you mis-spell "buffer_font_family", it should be
monospace.

Also treat "Zed Mono" and "Zed Sans" as valid fonts
2024-01-15 14:32:48 -07:00
Joseph T. Lyons
24db41fcdd Remove debugs 2024-01-15 16:29:58 -05:00
Joseph T. Lyons
355d1fca82 Remove button event function 2024-01-15 16:28:28 -05:00
Joseph T. Lyons
148c294c02 Removed button event 2024-01-15 16:26:56 -05:00
Joseph T. Lyons
ba9a9f4f17 Add more open events
project search
diagnostics
welcome page
2024-01-15 16:26:04 -05:00
Piotr Osiewicz
9a70a89477
Fix project panel being toggled on workspace startup. (#4059)
A sequence of events: Launch Zed -> Quit Zed -> Launch Zed would leave
you with a project panel in a a different state on each open (e.g. if it
is open on 1st one, 2nd run will have it closed). We were essentially
not tracking whether the deserialization took place.

Release Notes:

- Fixed project panel being toggled on/off on startup due to incorrect
tracking of serialization state (solves
https://github.com/zed-industries/community/issues/2406)
2024-01-15 22:23:16 +01:00
Kirill Bulatov
92add99260 Add LSP logs into the end of the editor, not after its caret
Also prevent tabs from being added in readonly editors
2024-01-15 22:12:52 +02: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
Antonio Scandurra
1b35b93e77
Avoid retrieving layout bounds inside of right click menu event handler (#4056)
By the time the event handler is invoked, all information about the
rendered layout tree is gone.

Release Notes:

- N/A
2024-01-15 19:42:47 +01:00
Antonio Scandurra
e4728b04ca
Preserve tooltips requested by cached views (#4055)
Release Notes:

- N/A
2024-01-15 19:42:39 +01:00
Antonio Scandurra
a56265e607 Avoid retrieving layout bounds inside of right click menu event handler
Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Max <max@zed.dev>
2024-01-15 19:27:18 +01:00
Antonio Scandurra
69bbcba99a Preserve tooltips requested by cached views
Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Max <max@zed.dev>
2024-01-15 19:19:27 +01:00
Thorsten Ball
b9be2147e8 Fix unaligned close button in tab bar
Co-authored-by: Marshall <marshall@zed.dev>
2024-01-15 18:16:41 +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
1da9c8b1e9
Rebuild shader header when cbindgen sources have changed (#4051)
This was causing the Metal shaders to incorrectly interpret the
primitives submitted by GPUI, which in turn caused rendering to be
completely borked.

Release Notes:

- N/A
2024-01-15 16:32:09 +01:00
Julia
ef4831b868
Prevent storybook dialog from swallowing terminal cursor when ctrl-c-ed (#4050)
Honestly thought this was a bug with our terminal port lol. Turns out
its an oversight in the `dialoguer` crate but its seems pretty easy to
work around so might as well

Release Notes:

- N/A
2024-01-15 10:25:11 -05:00
Antonio Scandurra
0ff5603dc9 Rebuild shader header when cbindgen sources have changed
Co-Authored-By: Thorsten <thorsten@zed.dev>
2024-01-15 16:23:22 +01:00
Julia
5000a53a61 Prevent storybook dialog from swallowing terminal cursor when ctrl-c-ed 2024-01-15 10:19:08 -05:00
Piotr Osiewicz
e52a2298cc
gpui: Pin to font-kit with improved OTC parsing performance. (#4047)
Details are in https://github.com/zed-industries/font-kit/pull/1; We're
not doing anything too fancy, really. Still, you should mostly see font
loading times drop significantly for font collections
Release Notes:
- Improved loading performance of large font collections (e.g. Iosevka).
Fixes https://github.com/zed-industries/community/issues/1745,
https://github.com/zed-industries/community/issues/246


https://github.com/zed-industries/zed/assets/24362066/f70edbad-ded6-4c12-9c6d-7a487f330a1b
2024-01-15 15:46:18 +01:00
Kirill Bulatov
fc294ce0b1
Disable copilot for feedback and lsp log editors (#4048)
LSP log editor caused recursive flood of messages, and feedback editor
is better with people writing their own feedback.

Release Notes:

- Fixed hanging due to excessive logs when browsing Copilot LSP logs
2024-01-15 15:59:27 +02:00
Kirill Bulatov
253c8dbe8e Disable copilot for feedback and lsp log editors
LSP log editor caused recursive flood of messages, and feedback editor is better with people writing their own feedback.
2024-01-15 15:49:23 +02:00
Thorsten Ball
80c0d09b15
Fix editor stealing click events from copy-error button (#4046)
This fixes the click event on the "copy error message" button by
changing the `editor` element to ignore mouse-down events when the
default was prevented. That's similar to how `div` does it.

Release Notes:

- Fixed a bug that prevented "copy error message" button from being
clicked.
2024-01-15 14:03:15 +01:00
Thorsten Ball
74f3366f42 Fix editor stealing click events from copy-error button
Co-authored-by: Antonio <antonio@zed.dev>
2024-01-15 13:47:09 +01:00
Antonio Scandurra
05d05b051b Pop node from dispatch tree during cx.paint_view
Co-Authored-By: Thorsten <thorsten@zed.dev>
2024-01-15 11:46:46 +01: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
4d87a67af8 Remove unused imports 2024-01-13 22:44:47 -07:00