Commit Graph
9137 Commits
Author SHA1 Message Date
Marshall BowersandPiotr Osiewicz 71c1e36d1e 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
Marshall Bowers d8c6adf338 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
Kirill Bulatov afa7045847 Tone down inlay hint update logs 2023-09-22 17:04:11 +03:00
KCaverly fbd6b5b434 cargo fmt 2023-09-22 09:46:06 -04:00
KCaverly dc49dec4f0 catchup with main 2023-09-22 09:43:39 -04:00
KCaverly 68c37ca2a4 move embedding provider to ai crate 2023-09-22 09:33:59 -04:00
Kirill Bulatov d61565d227 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 d14e4d41ea Merge branch 'main' into nate/bring-ui-crate-up-to-date 2023-09-21 23:47:17 -04:00
Nate Butler f54634aeb2 Bring UI crate up to date 2023-09-21 23:46:06 -04:00
Marshall Bowers 5083ab7694 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 48e151495f introduce ai crate with completion providers 2023-09-21 22:44:56 -04:00
Marshall Bowers 66358f2900 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 5f6334696a rename ai crate to assistant crate 2023-09-21 21:54:59 -04:00
Mikayla 02a85b1252 Add local next LSP adapter 2023-09-21 18:09:02 -07:00
Nate Butler 8440ac3a54 Fix fmt complaining about order 2023-09-21 20:25:25 -04:00
Nate Butler 1e6ac8caf2 theme::* -> crate::theme::*; 2023-09-21 20:21:56 -04:00
Max Brunsfeld 7711530704 Simplify titlebar facepile click rendering / mouse handling 2023-09-21 17:12:59 -07:00
Max Brunsfeld 4ffa167256 Allow following into channel notes regardless of project 2023-09-21 17:12:59 -07:00
Marshall Bowers baa07e935e 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 c252eae32e 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
Max Brunsfeld ed8b022b51 Add initial failing test for following to channel notes in an unshared project 2023-09-21 13:14:15 -07:00
Max Brunsfeld f34c6bd1ce Start work on allowing following without a shared project 2023-09-21 13:14:15 -07:00
Max Brunsfeld c71566e7f5 Make project id optional when following - server only 2023-09-21 13:14:15 -07:00
Kyle Caverly 3c2b05be90 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
KCaverly 7b63369df2 move api authentication to embedding provider 2023-09-21 14:00:00 -04:00
KCaverly 997f362cc2 add semantic index status, for non authenticated users 2023-09-21 13:40:01 -04:00
Max Brunsfeld 19a9753663 Fix channel move cancel (#3004)
Release Notes:

- Fixes a bug where channels could no longer be rearranged with drag and
drop.
2023-09-21 09:11:09 -07:00
Mikayla 66dd0e9ec0 Switch drag end event to be fired after mouse up 2023-09-21 08:58:36 -07:00
Piotr Osiewicz dbfa1d7263 [WIP] Replace in project (#2984)
Targeting Preview of 09.27.
This is still pending several touchups/clearups:
- We should watch multibuffer for changes and rescan the excerpts. This
should also update match count.
- Closing editor while multibuffer with 100's of changed files is open
leads to us prompting for save once per each file in the multibuffer.
One could in theory save in multibuffer before closing it (thus avoiding
unnecessary prompts), but it'd be cool to be able to "Save all"/"Discard
All".

Release Notes:

- Added "Replace in project" functionality
2023-09-21 16:27:58 +02:00
Kirill Bulatov 1c53b0a1c0 Properly re-add Copilot LSP server 2023-09-21 11:02:03 +03:00
Kirill Bulatov a2ac5ae478 Fix RPC logs not being displayed for supplementary servers 2023-09-21 11:00:05 +03:00
Kirill BulatovandMax ead7155b0f Make LSP panel scrollable
co-authored-by: Max <max@zed.dev>
2023-09-21 10:59:19 +03:00
Conrad Irwin 32f8733313 Code review changes 2023-09-20 21:29:45 -06:00
Conrad Irwin 7a7ff4bb96 Fix save related tests, and refactor saves again 2023-09-20 20:44:42 -06:00
Conrad Irwin a59da3634b Fix backward search from command 2023-09-20 20:44:42 -06:00
Conrad Irwin a25fcfdfa7 Iron out some edge-cases 2023-09-20 20:44:42 -06:00
Conrad Irwin 2d9db0fed1 Flesh out v1.0 of vim : 2023-09-20 20:44:41 -06:00
Conrad Irwin 6ad1f19a21 Add NewFileInDirection 2023-09-20 20:44:26 -06:00
Conrad Irwin 88a32ae48d Merge Workspace::save_item into Pane::save_item
These methods were slightly different which caused (for example) there
to be no "Discard" option in the conflict case at the workspace level.

To make this work, a new SaveBehavior (::PromptForNewPath) was added to
support SaveAs.
2023-09-20 20:44:26 -06:00
Conrad Irwin a4f96e6452 tests: wait deterministically after simulating_keystrokes 2023-09-20 20:44:26 -06:00
Conrad Irwin e27b7d7812 Ensure the picker waits for pending updates
Particularly in development builds (and in tests), when typing in the
command palette, I tend to hit enter before the suggestions have
settled.
2023-09-20 20:44:26 -06:00
Conrad Irwin ba5d84f7e8 Fix vim tests on my machine
In a rare case of "it broke on my machine" I haven't been able to run
the vim tests locally for a few days; turns out I ran out of swap file
names...
2023-09-20 20:44:26 -06:00
Conrad Irwin ea3a1745f5 Add vim-specific interactions to command
This mostly adds the commonly requested set (:wq and friends) and
a few that I use frequently
:<line> to go to a line number
:vsp / :sp to create a split
:cn / :cp to go to diagnostics
2023-09-20 20:44:26 -06:00
Max Brunsfeld d42093e069 collab 0.22.1 2023-09-20 17:39:21 -07:00
Mikayla fe10875285 Fix panic on select all when query is empty 2023-09-20 17:10:23 -07:00
Mikayla Maki e0fe97401d Fix bugs from channel moving (#3000)
This PR fixes several bugs related to channel moving and it's
unintuitive behavior when attempting to re-order channels

Release Notes:

- N/A
2023-09-20 17:01:14 -07:00
MikaylaandMax f2f507e619 Fix bug in channel rendering
Fix drag and drop stale state bug revealed by the channel panel

co-authored-by: Max <max@zed.dev>
2023-09-20 16:40:29 -07:00
Conrad Irwin f4d4a2f41b vim fixes for find&replace (#2995)
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext (in vim mode)

Release Notes:

- allow replacement to be empty
2023-09-20 16:42:39 -06:00
MikaylaandMax 4ff44dfa3b Fix bugs in moving channels that could cause channels to be stranded or moved unexpectedly
Made channel linking not query in a loop

co-authored-by: Max <max@zed.dev>
2023-09-20 15:32:06 -07:00
Max Brunsfeld 3633f091c5 Fix opening channel notes from context menu 2023-09-20 13:45:35 -07:00