Follow-up of https://github.com/zed-industries/zed/pull/24857
Based on the feedback,
* made non-persisting font size change as a default in Zed keymaps
JetBrains IDEs seem to persist font size changes by default, hence left
to do so in Zed keymaps too
* fixed a bug with holding a binding to change the font size caused
flickering
Release Notes:
- N/A
Closes https://github.com/zed-industries/zed/issues/23505
Now `zed::IncreaseBufferFontSize` (and all the same UI- and
Buffer-related settings) action is parameterized with `{ "persist": true
}` (default).
Using `"persist": false` brings back resizing behavior prior to
https://github.com/zed-industries/zed/pull/23265
Release Notes:
- Added a way to toggle font size without settings adjustments
This PR updates the file icon mappings such that:
- C# (`.cs`) files map to the `csharp` key
- Cue (`.cue`) files map to the `cue` key
- GitLab YAML (`gitlab-ci.yml`) files map to the `gitlab` key
- Luau (`.luau`) files map to the `luau` key
- Solidity (`.sol`) files map to the `solidity` key
Release Notes:
- Icon themes: Added the ability to change the file icon for C# (`.cs`)
files.
- Icon themes: Added the ability to change the file icon for Cue
(`.cue`) files.
- Icon themes: Added the ability to change the file icon for GitLab YAML
(`gitlab-ci.yml`) files.
- Icon themes: Added the ability to change the file icon for Luau
(`.luau`) files.
- Icon themes: Added the ability to change the file icon for Solidity
(`.sol`) files.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This PR adds support for configuring both a light and dark icon theme in
`settings.json`.
In addition to accepting just an icon theme name, the `icon_theme` field
now also accepts an object in the following form:
```jsonc
{
"icon_theme": {
"mode": "system",
"light": "Zed (Default)",
"dark": "Zed (Default)"
}
}
```
Both `light` and `dark` are required, and indicate which icon theme
should be used when the system is in light mode and dark mode,
respectively.
The `mode` field is optional and indicates which icon theme should be
used:
- `"system"` - Use the icon theme that corresponds to the system's
appearance.
- `"light"` - Use the icon theme indicated by the `light` field.
- `"dark"` - Use the icon theme indicated by the `dark` field.
Closes https://github.com/zed-industries/zed/issues/24695.
Release Notes:
- Added support for configuring both a light and dark icon theme and
switching between them based on system preference.
This PR updates the file icon mappings such that Markdown (`.md`,
`.markdown`) files map to the `markdown` key.
Release Notes:
- Icon themes: Added the ability to change the file icon for Markdown
(`.md`, `.markdown`) files.
This PR updates the file icon mappings such that Svelte (`.svelte`)
files map to the `svelte` key.
Release Notes:
- Icon themes: Added the ability to change the file icon for Svelte
(`.svelte`) files.
Closes#24353
This PR implements icon theme reload to ensure file icons are properly
updated whenever an icon theme extension is upgraded or uninstalled.
Currently, on both upgrade and uninstall of an icon theme extension the
file icons from the previously installed version will stay visibile and
will not be updated as shown in the linked issue. With this change, file
icons will properly be updated on extension upgrade or reinstall.
The code is primarily a copy for reloading the current color theme
adapted to work for icon themes. Happy for any feedback!
Release Notes:
- Fixed file icons not being properly updated upon icon theme upgrade or
uninstall.
This PR updates the file icon mappings for JSON (`.json`) file map to
the`json` key. Also, updates `.json` icon from `storage` to `code`.
This allows for the JSON file icons to be replaced in icon themes.
Release Notes:
- Icon themes: Added the ability to change the file icon for JSON
(`.json`) files.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This PR updates the file icon mappings such that HTML (`.html` and
`.htm`) files map to the `html` key.
This allows for the HTML file icons to be replaced in icon themes.
Release Notes:
- Icon themes: Added the ability to change the file icon for HTML
(`.html`, `.htm`) files.
Certain themes define the `created` and `deleted` status colors, but not
`created_background` and `deleted_background`. Previously, Zed would use
`created` and `deleted` colors, and apply a hard-coded opacity change,
but *not* use `created_background` and `deleted_background`, but that
behavior was inadvertently changed in
https://github.com/zed-industries/zed/pull/22994.
This PR restores the old behavior as a fallback. If a theme defines a
status color, but not the corresponding background color, we'll use a
75% transparent version of the foreground color as a fallback.
Release Notes:
- Fixed an issue in certain themes where diffs would render with the
wrong red and green colors for deletions and insertions.
This PR adds support for icon themes.
Closes https://github.com/zed-industries/zed/issues/8843.
Here is Zed with Material Icons:
<img width="1136" alt="Screenshot 2025-01-30 at 7 02 06 PM"
src="https://github.com/user-attachments/assets/57d8a0e0-ff38-44d9-8628-af58a60a7c9a"
/>
### Extensions
Extensions can provide icon themes as well as the icons used in those
themes.
Icon themes are defined as JSON files in the `icon_themes` directory,
and icons included in the `icons` directory will be packaged up with the
extension.
All icon paths within an icon theme are interpreted relative to the root
of the extension.
See the [Material Icon
Theme](https://github.com/zed-extensions/material-icon-theme) extension
for an example.
Release Notes:
- Added support for icon themes.
- Extensions can now provide icon themes.
- Use the `icon theme selector: toggle` action to switch between
installed icon themes.
This PR fixes an issue where we weren't properly resolving directory and
chevron icons from icon themes the way we were for file icons.
We need to interpret the icon paths as relative to the extension
directory.
Release Notes:
- N/A
There's still a bit more work to do on this, but this PR is compiling
(with warnings) after eliminating the key types. When the tasks below
are complete, this will be the new narrative for GPUI:
- `Entity<T>` - This replaces `View<T>`/`Model<T>`. It represents a unit
of state, and if `T` implements `Render`, then `Entity<T>` implements
`Element`.
- `&mut App` This replaces `AppContext` and represents the app.
- `&mut Context<T>` This replaces `ModelContext` and derefs to `App`. It
is provided by the framework when updating an entity.
- `&mut Window` Broken out of `&mut WindowContext` which no longer
exists. Every method that once took `&mut WindowContext` now takes `&mut
Window, &mut App` and every method that took `&mut ViewContext<T>` now
takes `&mut Window, &mut Context<T>`
Not pictured here are the two other failed attempts. It's been quite a
month!
Tasks:
- [x] Remove `View`, `ViewContext`, `WindowContext` and thread through
`Window`
- [x] [@cole-miller @mikayla-maki] Redraw window when entities change
- [x] [@cole-miller @mikayla-maki] Get examples and Zed running
- [x] [@cole-miller @mikayla-maki] Fix Zed rendering
- [x] [@mikayla-maki] Fix todo! macros and comments
- [x] Fix a bug where the editor would not be redrawn because of view
caching
- [x] remove publicness window.notify() and replace with
`AppContext::notify`
- [x] remove `observe_new_window_models`, replace with
`observe_new_models` with an optional window
- [x] Fix a bug where the project panel would not be redrawn because of
the wrong refresh() call being used
- [x] Fix the tests
- [x] Fix warnings by eliminating `Window` params or using `_`
- [x] Fix conflicts
- [x] Simplify generic code where possible
- [x] Rename types
- [ ] Update docs
### issues post merge
- [x] Issues switching between normal and insert mode
- [x] Assistant re-rendering failure
- [x] Vim test failures
- [x] Mac build issue
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
Co-authored-by: max <max@zed.dev>
Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Mikayla Maki <mikaylamaki@Mikaylas-MacBook-Pro.local>
Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
Co-authored-by: joão <joao@zed.dev>
Follow up to https://github.com/zed-industries/zed/pull/22658
This PR ensures the background and border color of a project panel entry
is exactly the same with one exception: if the item is focused, active,
and not with mouse down. The point is to not be able to see the border
at all given they're there to act sort of akin to CSS's `outline` (which
doesn't add up to the box model).
Please let me know if there is any edge case I either messed up here or
didn't account for.
https://github.com/user-attachments/assets/29c74f6a-b027-4d19-a7de-b9614f0d7859
Release Notes:
- N/A
This enables having a dedicated color for the line number hover state.
That's relevant because line numbers can now be clicked to jump to
cursor location in multibuffers.
Release Notes:
- N/A
---------
Co-authored-by: João Marcos <marcospb19@hotmail.com>
This PR adds the supporting infrastructure to support loading icon
themes defined by extensions.
Here's an example icon theme:
```json
{
"name": "My Icon Theme",
"author": "Me <me@example.com>",
"themes": [
{
"name": "My Icon Theme",
"appearance": "dark",
"file_icons": {
"gleam": { "path": "./icons/file_type_gleam.svg" },
"toml": { "path": "./icons/file_type_toml.svg" }
}
}
]
}
```
The icon paths are resolved relative to the root of the extension
directory.
Release Notes:
- N/A
This PR updates the various `FileIcons` methods to fall back to the
default icon theme if the active icon theme does not have the desired
icon.
Release Notes:
- N/A
This PR pulls the directory and chevron icons out of the
`IconTheme::file_icons` collection and promotes them to named fields.
This makes things less stringly-typed when looking up these icons.
Release Notes:
- N/A
This PR adds the initial concept of an `IconTheme` and refactors
`FileIcons` to use it to resolve the icons.
The `IconTheme` will ultimately be used to allow users to select a
different set of icons to use. Currently, however, this is just laying
the foundation for that work.
The association between file types and icons is now handled by the icon
theme when we resolve file icons. This mapping has been moved out of
`file_types.json` and into `icon_theme.rs`.
Release Notes:
- N/A
- [x] Rewrite worktree git handling
- [x] Fix tests
- [x] Fix `test_propagate_statuses_for_repos_under_project`
- [x] Replace `WorkDirectoryEntry` with `WorkDirectory` in
`RepositoryEntry`
- [x] Add a worktree event for capturing git status changes
- [x] Confirm that the local repositories are correctly updating the new
WorkDirectory field
- [x] Implement the git statuses query as a join when pulling entries
out of worktree
- [x] Use this new join to implement the project panel and outline
panel.
- [x] Synchronize git statuses over the wire for collab and remote dev
(use the existing `worktree_repository_statuses` table, adjust as
needed)
- [x] Only send changed statuses to collab
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.com>
Co-authored-by: Nathan <nathan@zed.dev>
This PR adds a `darken` function that allows to reduce the lightness of
a color by a certain factor. This popped up as I wanted to add hover
styles to tinted-colors buttons.
Release Notes:
- N/A
This PR reverts #20076 to turn the `ThemeRegistry` back into a regular
struct again.
It doesn't actually help us by having it behind a trait.
Release Notes:
- N/A
This PR converts the `ThemeRegistry` type into a trait instead of a
concrete implementation.
This allows for the extension store to depend on an abstraction rather
than the concrete theme registry implementation.
We currently have two `ThemeRegistry` implementations:
- `RealThemeRegistry` — this was previously the `ThemeRegistry` and
contains the real implementation of the registry.
- `VoidThemeRegistry` — a null object that doesn't have any behavior.
Release Notes:
- N/A
This PR adds a theme preview tab to help get an at a glance overview of
the styles in a theme.

You can open it using `debug: open theme preview`.
The next major theme preview PR will move this into it's own crate, as
it will grow substantially as we add content.
Next for theme preview:
- Update layout to two columns, with controls on the right for selecting
theme, layer/elevation-index, etc.
- Cover more UI elements in preview
- Display theme colors in a more helpful way
- Add syntax & markdown previews
Release Notes:
- Added a way to preview the current theme's styles with the `debug:
open theme preview` command.
This PR changes the way we load user themes into the ThemeRegistry.
Rather than directly pass a theme family's themes to
`insert_user_themes`, instead we use the new `refine_theme_family ` and
`ThemeFamily::refine_theme`.
This PR should have net zero change to themes today, but sets up
enabling theme variables. We need to do it this way so each theme has
access to it's family when it is refined.
Release Notes:
- N/A
See #12673https://github.com/user-attachments/assets/94079afc-a851-4206-9c9b-4fad3542334e
TODO:
- [x] Make active indent guides work for autofolded directories
- [x] Figure out which theme colors to use
- [x] Fix horizontal scrolling
- [x] Make indent guides easier to click
- [x] Fix selected background flashing when hovering over entry/indent
guide
- [x] Docs
Release Notes:
- Added indent guides to the project panel
Supersedes https://github.com/zed-industries/zed/pull/19166
TODO:
- [x] Update basic zed paths
- [x] update create_state_directory
- [x] Use this with `NodeRuntime`
- [x] Add server settings
- [x] Add an 'open server settings command'
- [x] Make sure it all works
Release Notes:
- Updated the actions `zed::OpenLocalSettings` and `zed::OpenLocalTasks`
to `zed::OpenProjectSettings` and `zed::OpenProjectTasks`.
---------
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
This PR does some spring cleaning on the `theme` crate:
- Removed two unused stories and the story dep
- Removed the `one` theme family (from the `theme` crate, not the app),
this is now `zed_default_themes`.
- This will hopefully remove some confusion caused by this theme we
started in rust but didn't end up using
- Removed `theme::prelude` (it just re-exported scale colors, which we
don't use outside `theme`)
- Removed completely unused `zed_pro` themes (we started on these during
the gpui2 port and didn't finish them.)
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR enables required documentation for the `theme` crate starts on
documenting it.
The end goal is to have all meaningful documentation in the crate filled
out – However I'm not sure that just adding `#![deny(missing_docs)]` to
the whole crate is the right approach.
I don't know that having 200+ "The color of the _ color" field docs is
useful however–In the short term I've excluded some of the modules that
contain structs with a ton of fields (`colors, `status`, etc.) until we
decide what the right solution here is.
Next steps are to clean up the crate, removing unused modules or those
with low usage in favor of other approaches.
Changes in this PR:
- Enable the `deny(missing_docs)` lint for the `theme` crate
- Start documenting a subset of the crate.
- Enable `#![allow(missing_docs)]` for some modules.
Release Notes:
- N/A
Closes#18531
This PR limits the range of values that can be set for `FontWeight`.
Since any value less than 1.0 or greater than 999.9 causes Zed to crash
on Windows, I’ve restricted `FontWeight` to this range.
I could apply this constraint only on Windows, but considering the
documentation at https://zed.dev/docs/configuring-zed#buffer-font-weight
indicates that `FontWeight` should be between 100 and 900, I thought it
might be a good idea to apply this restriction in the settings.
Release Notes:
- Changed `ui_font_weight` and `buffer_font_weight` settings to require
values to be between `100` and `950` (inclusive).
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>