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
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
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>
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.
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.
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))
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.
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>
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>
- 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>
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
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
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>
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.
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>
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.
- [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
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)).
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.
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
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.
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)
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
- 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
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
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
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
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