Commit Graph
464 Commits
Author SHA1 Message Date
Marshall Bowers a80a3b8706 Add support for specifying both light and dark themes in settings.json (#7404)
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.
2024-02-05 15:39:01 -05:00
e6ebe7974d gpui: Add Global marker trait (#7095)
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>
2024-01-30 14:08:20 -05:00
Marshall Bowers 9cb5a84b8d Add support for loading user themes (#7027)
This PR adds support for loading user themes in Zed.

Themes are loaded from the `themes` directory under the Zed config:
`~/.config/zed/themes`. This directory should contain JSON files
containing a `ThemeFamilyContent`.

Here's an example of the general structure of a theme family file:

```jsonc
{
  "name": "Vitesse",
  "author": "Anthony Fu",
  "themes": [
    {
      "name": "Vitesse Dark Soft",
      "appearance": "dark",
      "style": {
        "border": "#252525",
        // ...
      }
    }
  ]
}
```

Themes placed in this directory will be loaded and available in the
theme selector.

Release Notes:

- Added support for loading user themes from `~/.config/zed/themes`.
2024-01-29 21:32:45 -05:00
Marshall Bowers e69e6f5586 Add a newtype wrapper around the global ThemeRegistry (#7025)
This PR adds a newtype wrapper around the global `ThemeRegistry`.

This allows us to limit where the `ThemeRegistry` can be accessed
directly via `cx.global` et al., without going through the dedicated
methods on the `ThemeRegistry`.

Release Notes:

- N/A
2024-01-29 18:09:37 -05:00
Marshall Bowers 7656096814 Rework access to ThemeRegistry global (#7023)
This PR reworks how we access the `ThemeRegistry` global.

Previously we were making calls directly on the context, like
`cx.global::<ThemeRegistry>`. However, one problem with this is that it
spreads out the knowledge of exactly what type is stored in the global.

In order to make it easier to adjust the type we store in the context
(e.g., wrapping the `ThemeRegistry` in an `Arc`), we now call methods on
the `ThemeRegistry` itself for accessing the global.

It would also be interesting to see how we could prevent access to the
`ThemeRegistry` without going through one of these dedicated methods 🤔

Release Notes:

- N/A
2024-01-29 17:51:34 -05:00
Marshall Bowers 9b453d2cbc Remove old themes using UserTheme constructs (#6897)
This PR removes the themes defined using the `UserTheme` types, as we're
now loading the themes via JSON.

The `theme_importer` has also been reworked to read in a VS Code theme
and output a new JSON theme.

Release Notes:

- N/A
2024-01-27 16:55:37 -05:00
Marshall Bowers 5f1dcb76fe Load JSON themes (#6893)
This PR changes the theme loading to use the JSON themes bundled with
the binary rather then the Rust theme definitions.

### Performance

I profiled this using `cargo run --release` to see what the speed
differences would be now that we're deserializing JSON:

**Before:** `ThemeRegistry::load_user_themes` took 16.656666ms
**After:** `ThemeRegistry::load_user_themes` took 18.784875ms

It's slightly slower, but not by much. There is probably some work we
could do here to bring down the theme loading time in general.

Release Notes:

- N/A
2024-01-27 16:03:04 -05:00
Marshall Bowers f5f7be1500 Add experimental.theme_overrides to settings file (#6791)
This PR adds **experimental** support for overriding theme values in the
current theme.

Be advised that both the existence of this setting and the structure of
the theme itself are subject to change.

But this is a first step towards allowing Zed users to customize or
bring their own themes.

### How it works

There is a new `experimental.theme_overrides` setting in
`settings.json`.

This accepts an object containing overrides for values in the theme. All
values are optional, and will be overlaid on top of whatever theme you
currently have set by the `theme` field.

There is JSON schema support to show which values are supported.

### Example

Here's an example of it in action:


https://github.com/zed-industries/zed/assets/1486634/173b94b1-4d88-4333-b980-8fed937e6f6d

Release Notes:

- Added `experimental.theme_overrides` to `settings.json` to allow for
customizing the current theme.
  - This setting is experimental and subject to change.
2024-01-26 13:42:58 -05:00
Kirill Bulatov 074966427d Fix previous theme not being applied on startup 2024-01-16 11:23:34 +02:00
Max Brunsfeld d84785f7e8 Put back logic for resetting buffer font adjustment on settings change. 2024-01-15 17:03:02 -08:00
Nate ButlerandAntonio Scandurra bcbfa7d036 Start documenting Theme crate
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2024-01-09 12:49:56 -05:00
Marshall Bowers 5c28c688fa theme: Removed commented-out ActiveTheme impl (#3950)
This PR removes a commented-out implementation for the `ActiveTheme`
trait on the `WindowContext`.

We don't need this implementation as we can go through the
`AppContext`'s implementation.

Release Notes:

- N/A
2024-01-08 13:51:18 -05:00
Max BrunsfeldandMikayla dfcb17fe74 Remove 2 suffix for theme
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:41:01 -08:00
Nate ButlerandMarshall Bowers 7ea9725125 Start using base theme in zed1 theme importer
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2024-01-02 14:21:20 -05:00
Max Brunsfeld 32367eba14 Set up UI to allow dragging a channel to the root 2023-10-25 15:39:02 +02:00
Piotr OsiewiczandMax 812ff9a97d Account for markdown styling in mentions offset calculation.
This also means that we can support smart punctuation.

Co-authored-by: Max <max@zed.dev>
2023-10-23 12:50:57 +02:00
Max Brunsfeld 23400a5a70 Start styling notification panel 2023-10-22 16:03:33 +02:00
Piotr Osiewicz 6844bb6510 Highlight mentions in the Saved chat messages 2023-10-20 15:30:36 +02:00
Max Brunsfeld b07f9fe3b5 Merge branch 'main' into notifications 2023-10-18 17:20:04 -07:00
Max Brunsfeld ee87ac2f9b Start work on chat mentions 2023-10-17 17:59:42 -07:00
Conrad Irwin cc390ba862 Start writing role to database (#3120)
Scaffolding for guest members in channels

Release notes:
- You can now set channels to "public" which will allow anyone to join
and become a member. In a future release guests joining public channels
will have reduced permissions.
2023-10-17 13:40:58 -06:00
Max Brunsfeld f225039d36 Display invite response buttons inline in notification panel 2023-10-17 09:12:55 -07:00
Conrad Irwin 9cc55f895c Merge branch 'main' into guests 2023-10-17 09:54:17 -06:00
KCaverly d2e769027a catchup with main 2023-10-16 09:47:07 -04:00
Conrad Irwin f6f9b5c8cb Wire through public access toggle 2023-10-13 16:59:30 -06:00
Julia 0cec0c1c1d Fixup layout 2023-10-11 13:41:58 -04:00
Julia e802c072f7 Start hacking in autocomplete docs 2023-10-06 13:26:38 -04:00
KCaverly ecfece3ac4 catchup with main 2023-10-06 16:30:31 +02:00
Mikayla f57d563578 Improve chat rendering 2023-10-05 11:58:41 -07:00
KCaverly 0666fa80ac moved status to icon with additional information in tooltip 2023-10-05 16:49:25 +03:00
KCaverly ec1b4e6f85 added initial working status in inline assistant prompt 2023-10-05 13:01:11 +03:00
Mikayla 73e78a2257 Adjust channel rendering to group related messages 2023-10-04 14:29:08 -07:00
Max Brunsfeld 95342c8c33 Merge branch 'main' into channel-changes 2023-10-03 17:52:28 -07:00
KCaverly 166ca2a227 catching up with main 2023-10-03 12:05:00 +03:00
KCaverly e9637267ef add placeholder button for retrieving additional context 2023-10-02 19:50:57 +03:00
Mikayla e0ff7ba180 Add channel note indicator and clear changed status 2023-10-01 22:32:10 -07:00
Mikayla 9ba975d6ad Channel notifications from the server works 2023-10-01 22:30:21 -07:00
Conrad IrwinandMax Brunsfeld 1cfc2f0c07 Show host in titlebar
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-09-29 16:37:00 -06:00
Max BrunsfeldandConrad 0f39b63801 Rename color_index to participant_index
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:22 -07:00
545b5e0161 Assign unique color indices to room participants, use those instead of replica_ids
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2023-09-28 11:06:09 -07:00
Max Brunsfeld b75971196f Add buttons for opening channel notes and joining call, in chat panel header 2023-09-14 18:05:44 -07:00
Max Brunsfeld dd7c687041 Style the chat panel further 2023-09-14 17:19:08 -07:00
Max Brunsfeld d97c9d8dfd Merge branch 'main' into chat-again 2023-09-12 11:26:54 -07:00
Piotr Osiewicz 4cb8647702 Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Nathan Sobo fe6f0a253b Merge remote-tracking branch 'origin/main' into chat-again 2023-09-11 12:08:01 -06:00
Max Brunsfeld 3422eb65e8 Restore channel chat model and panel view 2023-09-07 11:38:27 -07:00
Nathan Sobo 37ef28a3bf Merge branch 'main' into storybook 2023-09-07 07:56:57 -06:00
Nathan Sobo 5a778fbde6 Checkpoint 2023-09-06 14:16:15 -06:00
Nathan Sobo 2fa9c037c8 Merge remote-tracking branch 'origin' into storybook 2023-09-01 10:08:48 -06:00
Kirill Bulatov 7b5974e8e9 Add LSP logs clear button 2023-08-31 18:31:21 +03:00