Commit graph

445 commits

Author SHA1 Message Date
Danilo Leal
2e7a89c5e3
edit predictions: Improve copywriting (#24689) 2025-02-11 21:43:48 -03:00
Max Brunsfeld
148547ecd1
Rework edit prediction preview mode (#24700)
Don't animate the cursor when previewing jumps.
Instead, display the jump popover with a line that resembles a cursor,
indicating the jump destination. If the jump destination is outside of
the view port, there is an extra step in which `tab` scrolls the
viewport to reveal the jump destination.

Release Notes:

- N/A

---------

Co-authored-by: danilo-leal <daniloleal09@gmail.com>
Co-authored-by: agu-z <hi@aguz.me>
2025-02-11 23:14:12 +00:00
Nate Butler
2d71733490
ui: Update Label component (#24653)
- Standardize style methods
- Convert label story to a component preview
- update component preview styles  

Release Notes:

- N/A
2025-02-11 20:16:59 +00:00
Agus Zubiaga
22e2b8e832
edit predictions: Preview jumps by animating cursor to target (#24604)
https://github.com/user-attachments/assets/977d08fb-a2b1-4826-9d95-8f35c6cb9f13




Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Smit <smit@zed.dev>
Co-authored-by: Max <max@zed.dev>
2025-02-11 11:19:51 -03:00
zfx
7f4957cf20
Remove non-existent icon IndicatorX (#24636)
There is no file indicator_x.svg in the assets directory.

09:49:05 [ERROR] could not find asset at path "icons/indicator_x.svg"

![image](https://github.com/user-attachments/assets/e9cc5ae3-4eb3-4e1e-b012-43ac7297c0a7)

Release Notes:

- N/A
2025-02-11 11:32:38 +00:00
Danilo Leal
c89ad65782
edit predictions: Show user if current project is open source (#24587)
Release Notes:

- N/A

---------

Co-authored-by: João Marcos <marcospb19@hotmail.com>
2025-02-10 22:28:56 -03:00
Max Brunsfeld
929c5e76b4
Fix some visual bugs w/ edit predictions (#24591)
* correct the size of key binding icons
* avoid spurious modifier in 'jump to edit' popover when already
previewing
* fix height of the edit preview popover

Release Notes:

- N/A

Co-authored-by: agu-z <hi@aguz.me>
2025-02-10 23:49:08 +00:00
Finn Evers
0fd2203665
context_menu: Use when instead of if-block (#24566)
See
https://github.com/zed-industries/zed/pull/24562#issuecomment-2648343416
. Should have just added that to my original comment btw - sorry!

CC @danilo-leal 

Release Notes:

- N/A
2025-02-10 16:47:09 -03:00
Nate Butler
de8d4d00ce
git_ui: Update git panel commit editor, start on quick commit
- Fixes commit editor issues & updates style
- Starts on quick commit (not hooked up to anything)
- Updates some panel styles
- Adds SwitchWithLabel
- 
Release Notes:

- N/A
2025-02-10 15:52:09 +00:00
Danilo Leal
d292b7c96d
context menu: Use invisible() to hide the check icon (#24562)
Follow up to: https://github.com/zed-industries/zed/pull/24549

Release Notes:

- N/A
2025-02-10 12:16:33 -03:00
Piotr Osiewicz
ca4378cbaa
ui: Use cursor: pointer for Toggles (#24563)
Closes #ISSUE

Release Notes:

- N/A
2025-02-10 15:10:35 +00:00
Danilo Leal
d15a61a1aa
context menu: Adjust toggleable entry label alignment (#24549)
Previously, we were passing an `IconSize` that had a default size. Given
the check icon is small by default, when the entry is not toggled, that
caused a slight misalignment between the toggled and not-toggled items.
I'm passing now the same icon element but inside an opacity 0 div. Open
to other suggestions if this feels clunky.

| Before | After |
|--------|--------|
| <img width="946" alt="Screenshot 2025-02-10 at 7 58 28 AM"
src="https://github.com/user-attachments/assets/4d2b3f12-72c5-4c8d-acaf-c16230250560"
/> | <img width="943" alt="Screenshot 2025-02-10 at 7 58 37 AM"
src="https://github.com/user-attachments/assets/2df64752-7273-4bdc-9f6b-5153ed52c889"
/> |

Release Notes:

- N/A
2025-02-10 08:19:58 -03:00
Kirill Bulatov
6f7f0f30e2
Fix hover tooltips appearing after related element is pressed (#24540)
Closes https://github.com/zed-industries/zed/issues/23894

Reworks all trigger declarations from
`.trigger(element.tooltip(tooltip))` into
`.trigger_with_tooltip(element, tooltip)` , with new API disallowing
simultaneous trigger and tooltip display.

All existing `.trigger(` calls were replaced, except 2 not applicable
(in dock.rs and pane.rs), 15 left as ones without tooltips, and 2
unchanged places in `inline_completion_button.rs`, where


0f7bb2e9fd/crates/inline_completion_button/src/inline_completion_button.rs (L311-L319)

`with_animation` does not allow us to simply use the same approach.

Release Notes:

- Fixed hover tooltips appearing after related element is pressed

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-10 00:16:12 +00:00
Nate Butler
8f1ff189cc
component: Add component and component_preview crates to power UI components (#24456)
This PR formalizes design components with the Component and
ComponentPreview traits.

You can open the preview UI with `workspace: open component preview`.

Component previews no longer need to return `Self` allowing for more
complex previews, and previews of components like `ui::Tooltip` that
supplement other components rather than are rendered by default.

`cargo-machete` incorrectly identifies `linkme` as an unused dep on
crates that have components deriving `IntoComponent`, so you may need to
add this to that crate's `Cargo.toml`:

```toml
# cargo-machete doesn't understand that linkme is used in the component macro
[package.metadata.cargo-machete]
ignored = ["linkme"]
```

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-09 13:25:03 -05:00
Agus Zubiaga
56cfc60875
ui: Add buffer_font method to labels (#24479)
Now you don't need to wrap the `Label` in a `div` anymore 

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
2025-02-09 15:23:39 -03:00
Marshall Bowers
072d2b061a
ui: Remove ToolStrip component (#24529)
This PR removes the `ToolStrip` component.

Pulling this change out of
https://github.com/zed-industries/zed/pull/24456.

Release Notes:

- N/A
2025-02-09 16:07:40 +00:00
Mikayla Maki
ca4e8043d4
Add branch to git panel (#24485)
This PR adds the branch selector to the git panel and fixes a few bugs
in the repository selector.

Release Notes:

- N/A

---------

Co-authored-by: ConradIrwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
2025-02-08 03:27:58 +00:00
Danilo Leal
c4bcff1e87
edit predictions: Add binding to the prediction toggle (#24468)
This PR primary goal is to add a keybinding to the (ephemeral)
prediction toggle. In doing that, we also standardized the keybinding to
open the status bar menu with it.

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
2025-02-07 18:01:39 -03:00
Agus Zubiaga
fd7fa87939
edit predictions: Restore red dot in status buttons when pending ToS (#24408)
In one of the recent changes to the edit predictions status bar menu, we
lost the red dot that is displayed when the user has Zed as the provider
but hasn't accepted terms of service. Note: All the checks were still in
place, just the visual indicator was missing.

![CleanShot 2025-02-06 at 20 22
21@2x](https://github.com/user-attachments/assets/da8f25dd-5ed2-4bf9-8453-10b80f00bf63)


Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-07 15:42:27 -03:00
Nate Butler
00971fbe41
Introduce KeybindingHint (#24397)
- Implements scaling for `ui::Keybinding` and it's component parts
- Adds the `ui::KeybindingHint` component for creating keybinding hints
easily:

![CleanShot 2025-02-04 at 16 59
38@2x](https://github.com/user-attachments/assets/d781e401-8875-4edc-a4b0-5f8750777d86)

Release Notes:

- N/A
2025-02-06 21:45:03 +00:00
Conrad Irwin
5d1c56829a
Add staged checkboxes to multibuffer headers (#24308)
Co-authored-by: Mikayla <mikayla@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2025-02-05 18:32:07 -07:00
Conrad Irwin
971a91ced7
Commit All Mode (#24293)
- **Base diffs on uncommitted changes**
- **Show added files in project diff view**
- **Fix git panel optimism**
- **boop**
- **Co-Authored-By: Cole <cole@zed.dev>**
- **Fix commit (all) buttons state**
- **WIP**
- **WIP: commit all mode**

Closes #ISSUE

Release Notes:

- N/A
2025-02-05 12:13:32 -07:00
Bennet Bo Fenner
e1a6d9a485
edit prediction: Improve UX around disabled_globs and show_inline_completions (#24207)
Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-05 17:09:19 +00:00
Michael Sloan
f8c436fe7f
Fix prediction preview binding: Alt + Preview -> Alt Preview (#24220)
Release Notes:

- N/A
2025-02-04 19:32:30 +00:00
Anthony Eid
8c7096f7a6
Rename model based variable names to entity (#24198)
## Context
While looking through the client crate, I noticed that some of the old
functions and variables were still using gpui::model name that was
deprecated during the gpui3 transition. This PR renames those instances
of model to entity to be more inline with gpui3.

In addition, I also renamed `model` to `entity` in cases found by the
below search terms given by @someone13574

- model = cx.
- model: Entity
- model: &Entity
- OpenedModelHandle
- model.update
- model.upgrade
- model = .*\.root (regex)
- parent_model
- model = cx.new
- cx.spawn(move |model

Release Notes:

- N/A
2025-02-04 10:24:35 -08:00
Mikayla Maki
71f2cbe798
Git Panel: separate new and changed (#24181)
Release Notes:

- N/A

---------

Co-authored-by: conrad <conrad@zed.dev>
Co-authored-by: nate <nate@zed.dev>
2025-02-04 09:15:09 +00:00
Agus Zubiaga
93f8ccaaee
zeta: Revised data-collection onboarding experience (#24031)
Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: João Marcos <marcospb19@hotmail.com>
2025-02-04 04:06:09 -03:00
Michael Sloan
29e559d60c
Fix display of + between modifiers on linux and windows (#24173)
Regressions in #24024:

* `+` was no longer included between modifiers and key
* Multi-character keys like "control" were displayed all lowercase,
whereas before they were all uppercase like "CONTROL". Now they are
capitalized, so "Control".
* Brings back icon for tab key.

Release Notes:

- N/A
2025-02-04 07:03:35 +00:00
Agus Zubiaga
4c29e1ff07
zeta: Improve UX for simultaneous LSP and prediction completions (#24024)
Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
2025-02-03 21:47:11 -03:00
João Marcos
5bd7eaa173
Solve 50+ cargo doc warnings (#24071)
Release Notes:

- N/A
2025-02-01 06:19:29 +00:00
Agus Zubiaga
e23e03592b
zeta: Onboarding and title bar banner (#23797)
Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: João Marcos <joao@zed.dev>
2025-01-30 16:55:32 -03:00
Richard Feldman
ee0d2a8d94
Revise "Hide/Show Inline Completions" menu (#23808)
> **Note:** https://github.com/zed-industries/zed/pull/23813 should be
merged first!

@nathansobo and I paired on revising this menu, including adding the
"Predict Edits at Cursor" menu item (to make the keyboard shortcut more
discoverable; clicking it makes the inline edits show up, as shown in
the second screenshot) and switching from "Hide/Show" language to
checkboxes.

## Before
<img width="282" alt="Screenshot 2025-01-28 at 4 51 37 PM"
src="https://github.com/user-attachments/assets/309c82c1-8fb5-44db-950e-1a8789a63993"
/>

## After
<img width="1138" alt="Screenshot 2025-01-28 at 4 50 05 PM"
src="https://github.com/user-attachments/assets/302a126c-9389-42a4-bb7d-2896bce859e7"
/>

We also switched to use `SharedString` in more places, where it made
more sense.

@danilo-leal This isn't necessarily *exactly* what we want, but we were
pairing and decided to get it in a state where we can actually try it
out and tweak from here.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-01-29 17:45:28 -03:00
Nate Butler
a03b7624f1
Revert "gpui & ui: Use shader for dashed dividers" (#23850)
Reverts zed-industries/zed#23839

getting some reports of linux crashes – will investigate later today

Release Notes:

- N/A
2025-01-29 19:19:20 +00:00
Nate Butler
e5943975f9
gpui & ui: Use shader for dashed dividers (#23839)
TODO:
- [x] BackgroundOrientation
- [x] PatternDash
- [x] `pattern_horizontal_dash` & `pattern_vertical_dash`
- [x] Metal dash shader
- [x] Blade dash shader
- [x] Update ui::Divider to use new pattern

---

This PR introduces proper dashed dividers using the new `PatternDash`
background shader.

![CleanShot 2025-01-29 at 09 33
06@2x](https://github.com/user-attachments/assets/2db5af58-1aa9-4ad7-aa52-b9046fbf8584)

Before this we were using 128 elements to create a dashed divider, which
is both expensive, and would not scale beyond a certain size. This
allows us to simplify the divider element as well.

Changes:

- Adds `BackgroundOrientation` to `gpui::color::Background` to allow
specifying a direction for a pattern
- Adds the PatternDash pattern variant
- Updates `ui::Divider`'s dashed variants to be more efficient

Misc:
- Documents the `ui::Divider` component
- Treat `.metal` files as `C` in the Zed project until we get some metal
syntax highlighting.

Release Notes:

- N/A
2025-01-29 12:18:34 -05:00
邻二氮杂菲
29bfb56739
Add DeepSeek support (#23551)
- Added support for DeepSeek as a new language model provider in Zed
Assistant
- Implemented streaming API support for real-time responses from
DeepSeek models.
- Added a configuration UI for DeepSeek API key management and settings.
- Updated documentation with detailed setup instructions for DeepSeek
integration.
- Added DeepSeek-specific icons and model definitions for seamless
integration into the Zed UI.
- Integrated DeepSeek into the language model registry, making it
available alongside other providers like OpenAI and Anthropic.

Release Notes:

- Added support for DeepSeek to the Assistant.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-01-27 13:40:59 -05:00
Mikayla Maki
9cae96f82f
Remove more references to 'model' in GPUI APIs (#23693)
Release Notes:

- N/A
2025-01-27 04:00:27 +00:00
Nathan Sobo
6fca1d2b0b
Eliminate GPUI View, ViewContext, and WindowContext types (#22632)
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>
2025-01-26 03:02:45 +00:00
Danilo Leal
fc3a871264
assistant2: Adjust spacing and icons on the context picker (#23607)
Just fine-tuning spacing, icon size and color, and ensure they're are
consistent throughout.

Release Notes:

- N/A
2025-01-24 12:34:11 -03:00
Danilo Leal
f2c2ed0ccd
Allow the context menu to take an icon_color (#23600)
Doing this to enable customization in the Assistant 2 context picker.

Release Notes:

- N/A
2025-01-24 09:44:00 -03:00
Marshall Bowers
76bf4686ef
ui: Don't add an on_click handler for disabled ListItems (#23569)
This PR updates the `ListItem` component to not register an `on_click`
handler for `ListItem`s that are disabled.

When working on #23350 I noticed that even when the context menu entry
was disabled you could still click on the entry to fire the action.

Release Notes:

- Fixed some instances of disabled list items still registering clicks.
2025-01-23 19:58:07 +00:00
k4leg
6eaaced60d
Fix button demo in the component preview (#23423)
Problem: If you click on "Tinted Icons", "Icon Color" is also activated.

Release Notes:

- N/A
2025-01-21 19:33:08 +00:00
Michael Sloan
aacd80ee4a
Prefer later bindings in keymap section for display in UI (#23378)
Closes #23015

Release Notes:

- Improved which keybindings are selected for display. Now later entries
within `bindings` will take precedence. The default keymaps have been
updated accordingly.
2025-01-20 23:20:15 +00:00
Agus Zubiaga
919703e6a8
Toggle inline completion menu from keyboard (#23380) 2025-01-20 19:11:13 -03:00
Agus Zubiaga
919803a4f4
Require accepting ToS when enabling zeta (#23255)
Note: Design hasn't been reviewed yet, but the logic is done

When the user switches the inline completion provider to `zed`, we'll
show a modal prompting them to accept terms if they haven't done so:


https://github.com/user-attachments/assets/3fc6d368-c00a-4dcb-9484-fbbbb5eb859e

If they dismiss the modal, they'll be able to get to it again from the
inline completion button:


https://github.com/user-attachments/assets/cf842778-5538-4e06-9ed8-21579981cc47

This also stops zeta sending requests that will fail immediately when
ToS are not accepted.

Release Notes:

- N/A

---------

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Joao <joao@zed.dev>
2025-01-20 11:48:49 -03:00
tims
8c92da45a9
terminal: Add scrollbar (#23256)
Closes #4798

This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.

While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.

Preview:


https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f

Todo:

- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait  
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal

Release Notes:

- Added scrollbar to the terminal
2025-01-18 17:36:41 +01:00
Piotr Osiewicz
c9534e8025
chore: Use workspace fields for edition and publish (#23291)
This prepares us for an upcoming bump to Rust 2024 edition.

Release Notes:

- N/A
2025-01-17 17:39:22 +01:00
Piotr Osiewicz
795376cb07
ui: Track changes to UI font size made via actions with settings (#23265)
Fixes #5380

Closes #5380

Release Notes:

- Font size changes made with actions are now persisted in user settings
2025-01-16 23:28:18 +00:00
Danilo Leal
9f52683ebc
Remove the SwitchWithLabel component (#23240)
This PR removes the `SwitchWithLabel` component because we're adding
`label` as a method to `Switch`. Thus, we no longer need an extra
component just to append a label. Additionally, we're also adding
`keybinding` as a method.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-01-16 12:18:59 -03:00
Danilo Leal
5c5a938ecf
Expose a theme preview keybinding function (#23237)
This is useful if we want to pass random strings as keybindings for any
component that takes one, so we can display them on the debug theme
preview pane.

Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-01-16 11:43:56 -03:00
Michael Sloan
972176a574
Avoid doing string manipulation on render for single line label (#23227)
Release Notes:

- N/A
2025-01-16 11:15:45 +00:00