Commit Graph
39175 Commits
Author SHA1 Message Date
Marshall Bowers 23b94fa245 Scaffold Toolbar and Breadcrumb components (#3020)
This PR scaffolds the `Toolbar` and `Breadcrumb` components.

Right now they both just consist of hardcoded data.

<img width="846" alt="Screenshot 2023-09-22 at 4 54 00 PM"
src="https://github.com/zed-industries/zed/assets/1486634/70578df2-7216-42d2-97ef-d38b83fb4a25">

<img width="799" alt="Screenshot 2023-09-22 at 4 46 04 PM"
src="https://github.com/zed-industries/zed/assets/1486634/73ca3d8a-baf9-4ed4-b4c4-279c674672a3">

Release Notes:

- N/A
2023-09-22 16:57:33 -04:00
Antonio ScandurraandNathan Sobo cf5fd59647 Checkpoint
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-09-22 14:53:25 -06:00
Antonio ScandurraandNathan Sobo 816854d386 Checkpoint
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-09-22 14:40:39 -06:00
Marshall Bowers 2695a2a8b7 Label component states in stories (#3019)
This PR updates the UI component stories to label the various states
that they are in.

Release Notes:

- N/A
2023-09-22 15:48:32 -04:00
Antonio ScandurraandNathan Sobo f36ffe7d4c Checkpoint
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-09-22 13:30:51 -06:00
Marshall Bowers b91ba727a0 Report which requested font families are not present on the system (#3006)
This PR improves the error message when `FontCache.load_family` attempts
to load a font that is not present on the system.

I ran into this while trying to run the `storybook` for the first time.
The error message indicated that a font family was not found, but did
not provide any information as to which font family was being loaded.

### Before

```
   Compiling storybook v0.1.0 (/Users/maxdeviant/projects/zed/crates/storybook)
    Finished dev [unoptimized + debuginfo] target(s) in 8.52s
     Running `/Users/maxdeviant/projects/zed/target/debug/storybook`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not find a non-empty font family matching one of the given names', crates/theme/src/theme_settings.rs:132:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)
```

### After

```
   Compiling storybook v0.1.0 (/Users/maxdeviant/projects/zed/crates/storybook)
    Finished dev [unoptimized + debuginfo] target(s) in 7.90s
     Running `/Users/maxdeviant/projects/zed/target/debug/storybook`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not find a non-empty font family matching one of the given names: `Zed Mono`', crates/theme/src/theme_settings.rs:132:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)
```

Release Notes:

- N/A
2023-09-22 15:27:42 -04:00
Antonio ScandurraandNathan Sobo a20e2b9af5 Checkpoint
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-09-22 12:44:37 -06:00
Marshall Bowers ade4b6ef26 Remove manual mapping in FromStr implementation for StorySelector (#3018)
This PR removes the need for writing manual mappings in the `FromStr`
implementation for the `StorySelector` enum used in the storybook CLI.

We are now using the
[`EnumString`](https://docs.rs/strum/0.25.0/strum/derive.EnumString.html)
trait from `strum` to automatically derive snake_cased names for the
enums.

This will cut down on some of the manual work needed to wire up more
stories to the storybook.

Release Notes:

- N/A
2023-09-22 14:06:09 -04:00
Marshall BowersandPiotr Osiewicz 6eb1360ba6 Put Theme behind an Arc (#3017)
This PR puts the `Theme` returned from the `theme` function behind an
`Arc`.

### Motivation

While working on wiring up window focus events for the `TitleBar`
component we ran into issues where `theme` was holding an immutable
borrow to the `ViewContext` for the entirety of the `render` scope,
which prevented having mutable borrows in the same scope.

### Explanation

To avoid this, we can make `theme` return an `Arc<Theme>` to allow for
cheap clones and avoiding the issues with the borrow checker.

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-09-22 13:35:30 -04:00
Antonio Scandurra 6f2f29f022 Checkpoint 2023-09-22 10:02:11 -06:00
Marshall Bowers 9f28fb7f8c Factor story boilerplate out into separate components (#3016)
This PR factors out the bulk of the boilerplate required to setup a
story in the storybook out into separate components.

The pattern we're using here is adapted from the "[associated
component](https://maxdeviant.com/posts/2021/react-associated-components/)"
pattern in React.

Release Notes:

- N/A
2023-09-22 11:38:01 -04:00
Nathan Sobo fc6bf6a615 WIP 2023-09-22 08:34:43 -06:00
Kirill Bulatov 05e812d2a3 Tone down inlay hint update logs 2023-09-22 17:04:11 +03:00
Kyle Caverly ec50f7765b reorganize AI crates to structure future development (#3015)
Reorganized assistant/semantic_index crates and introduced AI crate to
include shared functionality.

Release Notes:

- Moved most of the Assistant functionality from ai crate to assistant
crate
- Moved interaction with embedding providers from semantic_index to ai
crate
2023-09-22 09:54:46 -04:00
KCaverly 79fe1669de cargo fmt 2023-09-22 09:46:06 -04:00
KCaverly a12bcda282 catchup with main 2023-09-22 09:43:39 -04:00
KCaverly 338899567b move embedding provider to ai crate 2023-09-22 09:33:59 -04:00
Kirill Bulatov f7235864c3 Do not resubscribe for Copilot logs events (#3014)
Last follow-up of https://github.com/zed-industries/zed/pull/3002
Fixes
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1695281196667609

Copilot sends multiple events about its LSP server readiness, not
necessarily recreating the server from scratch (e.g. due to re-sign in
action). Avoid re-adding same log subscriptions on the same LSP server,
which causes panics.

Release Notes:

- N/A
2023-09-22 13:48:13 +03:00
Kirill Bulatov 0d501fc6ba Do not resubscribe for Copilot logs events
Copilot sends multiple events about its LSP server readiness, not necessarily recreating the server from scratch (e.g. due to re-sign in action).
Avoid re-adding same log subscriptions on the same LSP server, which
causes panics.
2023-09-22 13:40:20 +03:00
Nate Butler c9c009c8fa Bring UI crate up to date (#3013)
Merges various in-progress gpui2 component branches with the new `ui`
crate.
2023-09-21 23:54:11 -04:00
Nate Butler 28e38dc74b Remove leftover state doc 2023-09-21 23:51:03 -04:00
Nate Butler 4c3bf16299 Merge branch 'main' into nate/bring-ui-crate-up-to-date 2023-09-21 23:47:17 -04:00
Nate Butler 2e3d7fe24e Bring UI crate up to date 2023-09-21 23:46:06 -04:00
Marshall Bowers af15d01e8a Add TrafficLights component (#3011)
This PR adds a `TrafficLights` component for GPUI2.

<img width="861" alt="Screenshot 2023-09-21 at 11 32 10 PM"
src="https://github.com/zed-industries/zed/assets/1486634/0fe0e847-49b3-44dc-bd4c-64f12f0051c1">

Release Notes:

- N/A
2023-09-21 23:42:18 -04:00
KCaverly 4e6cfd3982 introduce ai crate with completion providers 2023-09-21 22:44:56 -04:00
Marshall Bowers 17538ad1a4 Update storybook to support stories for individual components (#3010)
This PR updates the `storybook` with support for adding stories for
individual components.

### Motivation

Right now we just have one story in the storybook that renders an entire
`WorkspaceElement`.

While iterating on the various UI components, it will be helpful to be
able to create stories of those components just by themselves.

This is especially true for components that have a number of different
states, as we can render the components in all of the various states in
a single layout.

### Explanation

We achieve this by adding a simple CLI to the storybook.

The `storybook` binary now accepts an optional `[STORY]` parameter that
can be used to indicate which story should be loaded. If this parameter
is not provided, it will load the workspace story as it currently does.

Passing a story name will load the corresponding story, if it exists.

For example:

```
cargo run -- elements/avatar
```

<img width="723" alt="Screenshot 2023-09-21 at 10 29 52 PM"
src="https://github.com/zed-industries/zed/assets/1486634/5df489ed-8607-4024-9c19-c5f4541f97c9">

```
cargo run -- components/facepile
```

<img width="785" alt="Screenshot 2023-09-21 at 10 30 07 PM"
src="https://github.com/zed-industries/zed/assets/1486634/e04a4577-7403-405d-b23c-e765b7a06229">



Release Notes:

- N/A
2023-09-21 22:41:53 -04:00
KCaverly cbbf18051c rename ai crate to assistant crate 2023-09-21 21:54:59 -04:00
Mikayla 5ffeae5bdb Add local next LSP adapter 2023-09-21 18:09:02 -07:00
Nate Butler d8afe720ae Update ambiguous theme import (#3009)
Fixes an ambiguous reference to `theme` causing storybook not to build.
2023-09-21 20:32:41 -04:00
Nate Butler 4b8fc494cb Fix fmt complaining about order 2023-09-21 20:25:25 -04:00
Nate Butler 57d315c0fc theme::* -> crate::theme::*; 2023-09-21 20:21:56 -04:00
Max Brunsfeld bbbed668c8 Simplify titlebar facepile click rendering / mouse handling 2023-09-21 17:12:59 -07:00
Max Brunsfeld e23d0b8c80 Allow following into channel notes regardless of project 2023-09-21 17:12:59 -07:00
Marshall Bowers dc698c5662 Extract UI elements from storybook into new ui crate (#3008)
This PR extracts the various UI elements from the `storybook` crate into
a new `ui` library crate.

Release Notes:

- N/A
2023-09-21 19:25:35 -04:00
Marshall Bowers b87d356957 Reorganize ui module exports (#3007)
This PR reorganizes the exports for the `ui` module in the `storybook`
crate.

### Motivation

Currently we expose each of the various elements/components/modules in
two places:

- Through the module itself (e.g., `ui::element::Avatar`)
- Through the `ui` module's re-exports (e.g., `ui::Avatar`)

This means it's possible to import any given item from two spots, which
can lead to inconsistencies in the consumers. Additionally, it also
means we're shipping the exact module structure underneath `ui` as part
of the public API.

### Explanation

To avoid this, we can avoid exposing each of the individual modules
underneath `ui::{element, component, module}` and instead export just
the module contents themselves.

This makes the `ui` module namespace flat.

Release Notes:

- N/A
2023-09-21 17:46:37 -04:00
Marshall Bowers 5baea3cbd4 Fix some typos in tools.md 2023-09-21 17:21:40 -04:00
Marshall Bowers 406fe95801 Fix some typos in README.md 2023-09-21 16:56:04 -04:00
Max Brunsfeld e8bcd6d63e Add initial failing test for following to channel notes in an unshared project 2023-09-21 13:14:15 -07:00
Max Brunsfeld 32bbc58a34 Start work on allowing following without a shared project 2023-09-21 13:14:15 -07:00
Max Brunsfeld c8fee1d696 Make project id optional when following - server only 2023-09-21 13:14:15 -07:00
Max Brunsfeld 05b6029934 Procfile: run zed.dev via 'next dev', not 'vercel dev' 2023-09-21 13:14:15 -07:00
Nathan Sobo fc9467f61c Checkpoint 2023-09-21 14:10:53 -06:00
Nathan Sobo 4e4d057664 WIP 2023-09-21 13:46:31 -06:00
Nathan Sobo ff462d5c55 WIP 2023-09-21 13:39:54 -06:00
Kyle Caverly e05a437a29 add semantic index status, for non authenticated users (#3005)
Update project search semantic ui to accommodate for users who have not
set the OPENAI_API_KEY in their environment variables.

Release Notes:

- Expand Semantic Index status to include status for non authenticated
users
- Update Search UI to illustrate this status.
2023-09-21 14:18:58 -04:00
Nathan Sobo edf7900f2f WIP 2023-09-21 12:18:09 -06:00
KCaverly 79cac9d44c move api authentication to embedding provider 2023-09-21 14:00:00 -04:00
KCaverly 18b12dc1a3 add semantic index status, for non authenticated users 2023-09-21 13:40:01 -04:00
Max Brunsfeld 314150af08 Bump rust from 1.72.0 to 1.72.1 2023-09-21 10:17:55 -07:00
Nate Butler f23ca49fd3 Correct icon_margin_scale for fold indicator (#3003)
Fixes a design regression on Preview where the fold icon became small
due to the icon standardization PR.

Release Notes:

- [Preview] Fixed an issue with the size of the fold line icon.
2023-09-21 12:52:54 -04:00