Commit graph

592 commits

Author SHA1 Message Date
Danilo Leal
64ce696aae
ui: Add the SwitchField component (#34713)
This will be useful for both the current agent panel and some other
onboarding stuff we're working on. Also ended up removing the
`SwitchWithLabel` as it was unused.

Release Notes:

- N/A
2025-07-18 15:03:14 -03:00
Danilo Leal
4476860664
Add refinements to the AI onboarding flow (#33738)
This includes making sure that both the agent panel and Zed's edit
prediction have a consistent narrative when it comes to onboarding users
into the AI features, considering the possible different plans and
conditions (such as being signed in/out, account age, etc.)

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2025-07-18 18:25:36 +02:00
Ben Kunkle
948c1f22bb
keymap_ui: Improve keybind display in menus (#34587)
Closes #ISSUE

Defines keybindings for `keymap_editor::EditBinding` and
`keymap_editor::CreateBinding`, making sure those actions are used in
tooltips.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Finn <dev@bahn.sh>
2025-07-17 11:10:07 -04:00
Danilo Leal
59d524427e
ui: Add Chip component (#34521)
Possibly the simplest component in our set, but a nice one to have so we
can standardize how it looks across the app.

Release Notes:

- N/A
2025-07-16 01:15:45 -03:00
Danilo Leal
ee4b9a27a2
ui: Fix wrapping in the banner component (#34516)
Also removing the `icon` field as the banner component always renders
with an icon anyway. Hopefully, this fixes any weird text wrapping that
was happening before.

Release Notes:

- N/A
2025-07-15 23:51:12 -03:00
Piotr Osiewicz
6673c7cd4c
debugger: Add memory view (#33955)
This is mostly setting up the UI for now; I expect it to be the biggest
chunk of work.

Release Notes:

- debugger: Added memory view

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2025-07-14 16:32:06 +02:00
Smit Barmase
1cadff9311
project_panel: Fix sticky items horizontal scroll and hover propagation (#34367)
Release Notes:

- Fixed horizontal scrolling not working for sticky items in the Project
Panel.
- Fixed issue where hovering over the last sticky item in the Project
Panel showed a hovered state on the entry behind it.
- Improved behavior when clicking a sticky item in the Project Panel so
it scrolls just enough for the item to no longer be sticky.
2025-07-13 06:14:30 +05:30
Cole Miller
970a1066f5
git: Handle shift-click to stage a range of entries in the panel (#34296)
Release Notes:

- git: shift-click can now be used to stage a range of entries in the
git panel.
2025-07-12 19:04:26 +00:00
Danilo Leal
46834d31f1
Refine status bar design (#34324)
Experimenting with a set of standardized icons and polishing spacing a
little bit.

Release Notes:

- N/A
2025-07-12 11:48:19 -03:00
Ben Kunkle
d1a6c5d494
keymap_ui: Hover tooltip for context (#34290)
Closes #ISSUE

Ideally the tooltip would only appear if the context was overflowing
it's column, but for now, we just unconditionally show a tooltip so that
long contexts can be seen.

This PR also includes a change to the tooltip element, allowing for
tooltips with non-text contents which is used here for syntax
highlighting

Release Notes:

- N/A *or* Added/Fixed/Improved ...

Co-authored-by: Anthony <anthony@zed.dev>
2025-07-11 10:54:08 -04:00
Kirill Bulatov
a1188848ef
Make inline and regular diagnostics more related (#34237)
Release Notes:

- N/A
2025-07-10 21:11:49 +00:00
Conrad Irwin
495ec7a109
ACP (#34030)
Implements an ACP client that can be used from the agent panel
2025-07-09 16:02:31 +00:00
Smit Barmase
81cc1e8f75
project_panel: Improve last sticky item drifting logic (#34119)
- Now instead of drifting directory along with last item of that
directory, it waits till last item is completely consumed.

Release Notes:

- N/A
2025-07-09 20:26:21 +05:30
Kirill Bulatov
45d200f2f8
Wrap back around in context menu properly (#34112)
When navigating back in the context menu, it was not possible to get
past first element, if it was not selectable.
The other way around works, hence the fix.

Release Notes:

- N/A
2025-07-09 11:44:29 +00:00
Smit Barmase
3a247ee947
project panel: Add indent guides for sticky items (#34092)
- Adds new trait `StickyItemsDecoration` in `sticky_items` which is
implemented by `IndentGuides` from `indent_guides`.

<img width="347" alt="image"
src="https://github.com/user-attachments/assets/577748bc-13f6-41b8-9266-6a0b72349a18"
/>

Release Notes:

- N/A
2025-07-09 05:28:25 +05:30
Smit Barmase
1f3575ad6e
project_panel: Only show sticky item shadow when list is scrolled (#34050)
Follow up: https://github.com/zed-industries/zed/pull/34042

- Removes `top_slot_items` from `uniform_list` in favor of using
existing `decorations`
- Add condition to only show shadow for sticky item when list is
scrolled and scrollable

Release Notes:

- N/A
2025-07-08 14:22:24 +05:30
Kirill Bulatov
82aee6bcf7
Another lsp tool UI migration (#34009)
https://github.com/user-attachments/assets/54182f0d-43e9-4482-89b9-94db5ddaabf8

Release Notes:

- N/A
2025-07-07 14:28:18 +00:00
Smit Barmase
6efc5ecefe
project_panel: Add Sticky Scroll (#33994)
Closes #7243

- Adds `top_slot_items` to `uniform_list` component to offset list
items.
- Adds `ToPosition` scroll strategy to `uniform_list` to scroll list to
specified index.
- Adds `sticky_items` component which can be used along with
`uniform_list` to add sticky functionality to any view that implements
uniform list.


https://github.com/user-attachments/assets/eb508fa4-167e-4595-911b-52651537284c

Release Notes:

- Added sticky scroll to the project panel, which keeps parent
directories visible while scrolling. This feature is enabled by default.
To disable it, toggle `sticky_scroll` in settings.
2025-07-07 08:32:42 +05:30
Danilo Leal
5253702200
Move the LoadingLabel component to the UI crate (#33893)
So we can use it in other places and don't require them to depend on the
`agent_ui`. This PR also renames it from `AnimatedLabel` to
`LoadingLabel`.

Release Notes:

- N/A
2025-07-04 04:49:11 +00:00
Danilo Leal
77c4530e12
Add refinements to the keymap UI (#33816)
This includes mostly polishing up the keystroke editing modal, and some
other bits like making the keystroke rendering function more composable.

Release Notes:

- Added refinements to the keymap UI design.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Ben Kunkle <Ben.kunkle@gmail.com>
2025-07-02 19:48:49 -03:00
Ben Kunkle
79f3cb1225
keymap_ui: Add context menu for table rows (#33747)
Closes #ISSUE

Adds a right click context menu to table rows, refactoring the table API
to support more general row rendering in the process, and creating
actions for the couple of operations available in the context menu.

Additionally includes an only partially related change to the context
menu API, which makes it easier to have actions that are disabled based
on a boolean value.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-02 03:06:45 +00:00
Danilo Leal
42f788185a
agent: Use callout for displaying errors instead of toasts (#33680)
This PR makes all errors in the agent panel to use the `Callout`
component instead of toasts. Reason for that is because the toasts
obscured part of the panel's UI, which wasn't ideal. We can also be more
expressive here with a background color, which I think helps with
parsing the message.

Release Notes:

- agent: Improved how we display errors in the panel.
2025-07-01 09:00:20 -03:00
Mikayla Maki
7609ca7a8d
Sketch in a table for the keybindings UI (#32436)
Adds the initial semblance of a keymap UI. It is currently gated behind the `settings-ui` feature flag. Follow up PRs will add polish and missing features.

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Anthony <anthony@zed.dev>
2025-06-30 19:25:11 -04:00
Michael Sloan
24c94d474e
gpui: Simplify Action macros + support doc comments in actions! (#33263)
Instead of a menagerie of macros for implementing `Action`, now there
are just two:

* `actions!(editor, [MoveLeft, MoveRight])`
* `#[derive(..., Action)]` with `#[action(namespace = editor)]`

In both contexts, `///` doc comments can be provided and will be used in
`JsonSchema`.

In both contexts, parameters can provided in `#[action(...)]`:

- `namespace = some_namespace` sets the namespace. In Zed this is
required.

- `name = "ActionName"` overrides the action's name. This must not
contain "::".

- `no_json` causes the `build` method to always error and
`action_json_schema` to return `None`
and allows actions not implement `serde::Serialize` and
`schemars::JsonSchema`.

- `no_register` skips registering the action. This is useful for
implementing the `Action` trait
while not supporting invocation by name or JSON deserialization.

- `deprecated_aliases = ["editor::SomeAction"]` specifies deprecated old
names for the action.
These action names should *not* correspond to any actions that are
registered. These old names
can then still be used to refer to invoke this action. In Zed, the
keymap JSON schema will
accept these old names and provide warnings.

- `deprecated = "Message about why this action is deprecation"`
specifies a deprecation message.
In Zed, the keymap JSON schema will cause this to be displayed as a
warning. This is a new feature.

Also makes the following changes since this seems like a good time to
make breaking changes:

* In `zed.rs` tests adds a test with an explicit list of namespaces. The
rationale for this is that there is otherwise no checking of `namespace
= ...` attributes.

* `Action::debug_name` renamed to `name_for_type`, since its only
difference with `name` was that it

* `Action::name` now returns `&'static str` instead of `&str` to match
the return of `name_for_type`. This makes the action trait more limited,
but the code was already assuming that `name_for_type` is the same as
`name`, and it requires `&'static`. So really this just makes the trait
harder to misuse.

* Various action reflection methods now use `&'static str` instead of
`SharedString`.

Release Notes:

- N/A
2025-06-24 04:34:51 +00:00
Remco Smits
ad76db7244
debugger: Add variable watchers (#32743)
### This PR introduces support for adding watchers to specific
expressions (such as variable names or evaluated expressions).

This feature is useful in scenarios where many variables are in scope,
but only a few are of interest—especially when tracking variables that
change frequently. By allowing users to add watchers, it becomes easier
to monitor the values of selected expressions across stack frames
without having to sift through a large list of variables.


https://github.com/user-attachments/assets/c49b470a-d912-4182-8419-7406ba4c8f1e

------

**TODO**:
- [x] make render variable code reusable for render watch method
- [x] use SharedString for watches because of a lot of cloning
- [x] add tests
  - [x] basic test
  - [x] test step debugging

Release Notes:

- Debugger Beta: Add support for variable watchers

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
2025-06-20 20:45:55 +00:00
Piotr Osiewicz
db99d7131e
debugger: Add onboarding modal (#32961)
- **debugger: Add debugger onboarding modal (wip)**
- **woops**

Release Notes:

- debugger: Added the onboarding modal.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Julia Ryan <p1n3appl3@users.noreply.github.com>
2025-06-18 18:44:02 +00:00
Danilo Leal
d280c95d91
agent: Suggest turning burn mode on when close to the context window limit (#32691)
Previously, upon getting close to reaching the context window, we'd just
suggest creating a new thread using the summary of the current one. Now,
we also suggest turning burn mode on as an alternative action to solve
the context window problem.

Release Notes:

- agent: Added a suggestion to turn burn mode on when getting close to
the context window limit.
2025-06-13 11:41:17 -03:00
Danilo Leal
29f3e62850
ui: Refactor the Callout component (#32684)
What motivated me to refactor this component was the fact that I wanted
a new variant to allow having _two CTAs_ instead of just one. This
variant should work with either a single or multiline description. But,
given we were using a `Callout::single_line` and `Callout::multi_line`
API, I'd then need to have both `Callout::single_line_one_button` and
`Callout::single_line_two_buttons` type of variants, which just points
to a combinatorial problem.

With this refactor, the Callout now follows the same structure of the
Banner component, where it's all `Callout::new` and every method is
passed as if they were props in a React component, allowing for a more
flexible design where you can customize button styles. Also made it
slightly more robust for wrapping and removed the top border as that
should be defined by the place it is being used in.

Release Notes:

- N/A
2025-06-13 10:03:32 -03:00
Finn Evers
2fe1293fba
Improve cursor style behavior for some draggable elements (#31965)
Follow-up to #24797

This PR ensures some cursor styles do not change for draggable elements
during dragging. The linked PR covered this on the higher level for
draggable divs. However, e.g. the pane divider inbetween two editors is
not a draggable div and thus still has the issue that the cursor style
changes during dragging. This PR fixes this issue by setting the hitbox
to `None` in cases where the element is currently being dragged, which
ensures the cursor style is applied to the cursor no matter what during
dragging.

Namely, this change fixes this for
- non-div pane dividers
- minimap slider and the
- editor scrollbars

and implements it for the UI scrollbars (Notably, UI scrollbars do
already have `cursor_default` on their parent container but would not
keep this during dragging. I opted out on removing this from the parent
containers until #30194 or a similar PR is merged).


https://github.com/user-attachments/assets/f97859dd-5f1d-4449-ab92-c27f2d933c4a

Release Notes:

- N/A
2025-06-06 16:56:27 -04:00
Michael Sloan
d801b7b12e
Fix bindings_for_action handling of shadowed key bindings (#32220)
Fixes two things:

* ~3 months ago [in PR
#26420](https://github.com/zed-industries/zed/pull/26420/files#diff-33b58aa2da03d791c2c4761af6012851b7400e348922d64babe5fd48ac2a8e60)
`bindings_for_action` was changed to return bindings even when they are
shadowed (when the keystrokes would actually do something else).

* For edit prediction keybindings there was some odd behavior where
bindings for `edit_prediction_conflict` were taking precedence over
bindings for `edit_prediction` even when the `edit_prediction_conflict`
predicate didn't match. The workaround for this was #24812. The way it
worked was:

    - List all bindings for the action

- For each binding, get the highest precedence binding with the same
input sequence

- If the highest precedence binding has the same action, include this
binding. This was the bug - this meant that if a binding in the keymap
has the same keystrokes and action it can incorrectly take display
precedence even if its context predicate does not pass.

- Fix is to check that the highest precedence binding is a full match.
To do this efficiently, it's based on an index within the keymap
bindings.

Also adds `highest_precedence_binding_*` variants which avoid the
inefficiency of building lists of bindings just to use the last.

Release Notes:

- Fixed display of keybindings to skip bindings that are shadowed by a
binding that uses the same keystrokes.
- Fixed display of `editor::AcceptEditPrediction` bindings to use the
normal precedence that prioritizes user bindings.
2025-06-06 06:24:59 +00:00
Michael Sloan
9086784038
gpui: Support hitbox blocking mouse interaction except scrolling (#31712)
tl;dr: This adds `.block_mouse_except_scroll()` which should typically
be used instead of `.occlude()` for cases when the mouse shouldn't
interact with elements drawn below an element. The rationale for
treating scroll events differently:

* Mouse move / click / styles / tooltips are for elements the user is
interacting with directly.
* Mouse scroll events are about finding the current outer scroll
container.

Most use of `occlude` should probably be switched to this, but I figured
I'd derisk this change by minimizing behavior changes to just the 3 uses
of `block_mouse_except_scroll`.

GPUI changes:

* Added `InteractiveElement::block_mouse_except_scroll()`, and removes
`stop_mouse_events_except_scroll()`

* Added `Hitbox::should_handle_scroll()` to be used when handling scroll
wheel events.

* `Window::insert_hitbox` now takes `HitboxBehavior` instead of
`occlude: bool`.

    - `false` for that bool is now `HitboxBehavior::Normal`.

    - `true` for that bool is now `HitboxBehavior::BlockMouse`.
    
    - The new mode is `HitboxBehavior::BlockMouseExceptScroll`.

* Removes `Default` impl for `HitboxId` since applications should not
manually create `HitboxId(0)`.

Release Notes:

- N/A
2025-05-29 21:41:15 +00:00
Smit Barmase
6545c5ebe0
linux: Fix crash when switching repository via git panel (#31556)
Closes #30409

Handles edge case where `f32` turns into `Nan` and causes panic down the
code.

Release Notes:

- Fixed issue where Zed crashes on switching repository via git panel on
Linux.
2025-05-28 05:26:00 +05:30
Danilo Leal
0731097ee5
agent: Improve consecutive tool call UX and rebrand Max Mode (#31470)
This PR improves the consecutive tool call UX by allowing users to
quickly continue an interrupted with one-click. What we do here is
insert a hidden "Continue" message that will just nudge the LLM to keep
going. We're also using the opportunity to upsell the previously called
"Max Mode", now rebranded as "Burn Mode", which allows users to don't be
interrupted anymore if they ever have 25 consecutive tool calls again.

Release Notes:

- agent: Improve consecutive tool call UX by allowing users to quickly
continue an interrupted thread with one click.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-05-27 19:44:10 -03:00
Finn Evers
233b73b385
ui: Implement hover color for scrollbar component (#25525)
This PR implements color changing for the scrollbar component based upon
user mouse interaction.


https://github.com/user-attachments/assets/2fd14e2d-cc5c-4272-906e-bd39bfb007e4


This PR also already adds the state for a scrollbar being actively
dragged. However, as themes currently do not provide a color for this
scenario, this implementation re-uses the hover color as a placeholder
instead. If this feature is at all wanted, I can quickly open up a
follow-up PR which adds support for that property to themes as well as
this component.

Release Notes:

- Added hover state to scrollbars outside of the editor.
2025-05-27 18:16:04 -04:00
Michael Sloan
649072d140
Add a live Rust style editor to inspector to edit a sequence of no-argument style modifiers (#31443)
Editing JSON styles is not very helpful for bringing style changes back
to the actual code. This PR adds a buffer that pretends to be Rust,
applying any style attribute identifiers it finds. Also supports
completions with display of documentation. The effect of the currently
selected completion is previewed. Warning diagnostics appear on any
unrecognized identifier.


https://github.com/user-attachments/assets/af39ff0a-26a5-4835-a052-d8f642b2080c

Adds a `#[derive_inspector_reflection]` macro which allows these methods
to be enumerated and called by their name. The macro code changes were
95% generated by Zed Agent + Opus 4.

Release Notes:

* Added an element inspector for development. On debug builds,
`dev::ToggleInspector` will open a pane allowing inspecting of element
info and modifying styles.
2025-05-26 17:43:57 +00:00
Finn Evers
d312a13f8a
ui: Fix content shift when selecting last tab (#31266)
Follow-up to #29061

This PR ensures that the last tab does not flicker when either
selecting. It also fixes an issue where the layout would shift in the
new last tab when closing the last tab.


https://github.com/user-attachments/assets/529a2a92-f25c-4ced-a992-fb6b2d3b5f61

This happened because in #29061, the left padding was removed due to
issues with borders. However, the padding is relevant for the content to
not shift (we are basically doing border-box sizing manually here).
Instead, we need to remove the padding on the right side, as there is
already a border present on the right side and this padding would make
the last tab slightly larger than all other tabs.


https://github.com/user-attachments/assets/c3a10b3c-4a1d-4160-9b68-7538207bb46e


Release Notes:

- Removed a small flicker when selecting or closing the last tab in a
pane.
2025-05-24 23:36:51 +03:00
Michael Sloan
ab59982bf7
Add initial element inspector for Zed development (#31315)
Open inspector with `dev: toggle inspector` from command palette or
`cmd-alt-i` on mac or `ctrl-alt-i` on linux.

https://github.com/user-attachments/assets/54c43034-d40b-414e-ba9b-190bed2e6d2f

* Picking of elements via the mouse, with scroll wheel to inspect
occluded elements.

* Temporary manipulation of the selected element.

* Layout info and JSON-based style manipulation for `Div`.

* Navigation to code that constructed the element.

Big thanks to @as-cii and @maxdeviant for sorting out how to implement
the core of an inspector.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Federico Dionisi <code@fdionisi.me>
2025-05-23 23:08:59 +00:00
smit
1cad1cbbfc
Add Code Actions to the Toolbar (#31236)
Closes issue #31120.


https://github.com/user-attachments/assets/a4b3c86d-7358-49ac-b8d9-e9af50daf671

Release Notes:

- Added a code actions icon to the toolbar. This icon can be disabled by
setting `toolbar.code_actions` to `false`.
2025-05-23 16:55:29 +05:30
Cole Miller
b2a92097ee
debugger: Add actions and keybindings for opening the thread and session menus (#31135)
Makes it possible to open and navigate these menus from the keyboard.

I also removed the eager previewing behavior for the thread picker,
which was buggy and came with a jarring layout shift.

Release Notes:

- Debugger Beta: Added the `debugger: open thread picker` and `debugger:
open session picker` actions.
2025-05-21 20:56:39 -04:00
Mikayla Maki
315321bf8c
Add end of service notifications (#30982)
Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-05-20 00:20:00 +00:00
Marshall Bowers
03419da6f1
ui_macros: Remove DerivePathStr macro (#30862)
This PR removes the `DerivePathStr` macro, as it is no longer used.

Also removes the `PathStaticStr` macro from `gpui_macros`, which was
also unused.

Release Notes:

- N/A
2025-05-17 10:05:55 +00:00
Marshall Bowers
4d827924f0
ui: Remove usage of DerivePathStr macro (#30861)
This PR updates the `KnockoutIconName` and `VectorName` enums to
manually implement the `path` method instead of using the
`DerivePathStr` macro.

Release Notes:

- N/A
2025-05-17 09:05:58 +00:00
Nate Butler
e26620d1cf
gpui: Add a standard text example (#30747)
This is a dumb first pass at a standard text example. We'll use this to
start digging in to some text/scale rendering issues.

There will be a ton of follow-up features to this, but starting simple.

Release Notes:

- N/A
2025-05-16 17:35:44 +02:00
Marshall Bowers
23d42e3eaf
agent: Use inventory for AgentPreview (#30740)
This PR updates the `AgentPreview` to use `inventory` instead of
`linkme`.

Release Notes:

- N/A
2025-05-15 08:36:13 +00:00
tidely
bc99a86bb7
Reduce allocations (#30693)
Removes a unnecessary string conversion and some clones

Release Notes:

- N/A
2025-05-14 18:29:28 +02:00
Nate Butler
dce6e96c16
debugger: Tidy up dropdown menus (#30679)
Before
![CleanShot 2025-05-14 at 13 22
44@2x](https://github.com/user-attachments/assets/c6c06c5c-571d-4913-a691-161f44bba27c)

After
![CleanShot 2025-05-14 at 13 22
17@2x](https://github.com/user-attachments/assets/0a25a053-81a3-4b96-8963-4b770b1e5b45)

Release Notes:

- N/A
2025-05-14 11:32:51 +00:00
Finn Evers
4280bff10a
Reapply "ui: Account for padding of parent container during scrollbar layout" (#30577)
This PR reapplies #27402 which was reverted in
https://github.com/zed-industries/zed/pull/30544 due to the issue
@ConradIrwin reported in
https://github.com/zed-industries/zed/pull/27402#issuecomment-2871745132.
The reported issue is already present on main but not visible, see
https://github.com/zed-industries/zed/pull/27402#issuecomment-2872546903
for more context and reproduction steps.

The fix here was to move the padding for the hover popover up to the
parent container. This does not fix the underlying problem but serves as
workaround without any disadvantages until a better solution is found. I
would currently guess that the underlying issue might be related to some
rem-size calculations for small font sizes or something similar (e.g.
https://github.com/zed-industries/zed/pull/22732 could possibly be
somewhat related).

Notably, the fix here does not cause any difference in layouting (the
following screenshots are actually distinct images), yet fixes the
problem at hand.

### Default font size (`15px`) 

| `main` | This PR |
| --- | --- |
|
![main_large](https://github.com/user-attachments/assets/66d38827-9023-4f78-9ceb-54fb13c21e41)
|![PR](https://github.com/user-attachments/assets/7af82bd2-2732-4cba-8d4b-54605d6ff101)
|

### Smaller font size (`12px`)

| `main` | This PR |
| --- | --- |
|
![pr_large](https://github.com/user-attachments/assets/d43be6e6-6840-422c-baf0-368aab733dac)
|
![PR](https://github.com/user-attachments/assets/43f60b2b-2578-45d2-bcab-44edf2612ce2)
|

Furthermore, for the second scenario, the popover would be scrollable on
main. As there is no scrollbar in the second image for this PR, this no
longer happens with this branch.


Release Notes:

- N/A
2025-05-14 13:26:14 +02:00
Conrad Irwin
f0f0a52793
Revert "ui: Account for padding of parent container during scrollbar layout (#27402)" (#30544)
This reverts commit 82a7aca5a6.

Release Notes:

- N/A
2025-05-12 09:47:04 +00:00
Finn Evers
82a7aca5a6
ui: Account for padding of parent container during scrollbar layout (#27402)
Closes https://github.com/zed-industries/zed/issues/23386

This PR updates the scrollbar-component to account for padding present
in the parent container.

Since the linked issue was opened,
https://github.com/zed-industries/zed/pull/25288 improved the behaviour
so that the scrollbar does allow scrolling the entire container, however
the scrollbar thumb still does not go the entire way to the bottom. This
can be seen here:


https://github.com/user-attachments/assets/89204355-e6b8-428b-9fa9-bb614051b6fa

This happens because during layouting of the scrollbar, padding of the
parent container is not taken into account. The scrollbar thumb size is
calculated as if no padding was present.

With this change, padding is now included in the calculation, which
resolves the issue:


https://github.com/user-attachments/assets/1d4c62e0-4555-4332-a9ab-4e114684b4b3

The change here is to store the calculated content size during prepaint
_including_ padding and use this for layouting the scrollbar. This
ensures that the actual scroll max and the content size are always in
sync. Furthermore, the existing `TODO`-comment is also resolved, as we
now no longer look at the size of the last child but the actual parent
size instead.

This also removes an existing panic of the scrollbar-component in cases
where the content size was 0, which was previously not accounted for
(this never happened in practice so far, for example because of the
padding added here:

43712285bf/crates/editor/src/hover_popover.rs (L802-L809)
which prevented the container size from ever being 0).

---

Lastly, as I was wiring through the changes of the `content_size` I
noticed that some code was duplicated during the initial layouting as
well as in the click handlers. I refactored this in the second commit to
use `along` where possible as well as computing the new click offset in
one closure which can be passed to both event listeners. As always,
should any of these changes not be wanted, feel free to let me know and
I will revert these.

Looking forward to your feedback 😄 

Release Notes:

- Fixed scrollbars sometimes not scrolling all the way to the bottom.
2025-05-11 21:40:45 +02:00
Danilo Leal
00292450e0
agent: Show delete thread icon buttons on hover/focus (#30370)
This PR's main goal is to show the delete thread button when the list
item is either focused or hovered. In order to do that, we ended up
refactoring (i.e., merging) the `PastThread` and `PastContext` elements
into a single `HistoryElementEntry` that already matches to the entry
type (i.e., context or thread).

Release Notes:

- agent: Simplify the UI by showing the delete thread icon button only
on hover or focus.

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-05-09 12:55:40 -03:00