cd8a09be897006eeca7a7be51eef309c64605da4
9
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4b4fb6a56 |
git_graph: Selectable commit message in detail panel (#59674)
# Objective Fixes #57766 Allow users to select and copy the text of commit messages from the git graph details panel. ## Solution Implements selectable commit message in the detail panel using `MarkdownElement`s a la `commit_view`. ### Affordances considered and abandoned: - "copy message" and/or "copy subject" buttons, but the UI here is already pretty tight and I don't feel confident enough in my design chops or familiarity with Zed to propose bigger UI changes here. - Default-collapsed message with expand button, a la `commit_view`. The use-case of this panel is to get the gist of a commit while moving somewhat quickly through the graph. One might argue that the subject line alone is enough for that, but often it isn't and the thought of having to constantly expand commit messages rather than making the message immediately visible with scroll felt like it would produce a repetitious experience. ## Testing - Adds two unit tests to verify that selection works and is idempotent ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase Video demonstrating the functionality: https://github.com/user-attachments/assets/b910aaa3-2db2-4da8-904b-21b270677ca9 --- Release Notes: - Show full commit message as markdown in details panel of the git graph |
||
|
|
be50aaccbe |
picker: Simplify presentation and sizing APIs, add preview-aware defaults (#59719)
The recent "pickers with previews" overhaul left the picker
sizing/presentation API spread across several overlapping knobs that
every call site had to set correctly — and many didn't, causing pickers
across the app to render at the wrong width, lose their container, or
stop dismissing. This PR consolidates that surface into a small,
hard-to-misuse API and makes correct sizing the default.
Net effect: a plain `Picker::uniform_list(delegate, …)` now renders
correctly out of the box (standard width, standard max-height, shrinks
to fit, dismisses properly), and the ~35 call sites only specify what
genuinely differs.
## API changes
**Presentation** — three overlapping booleans (`is_modal`, `is_popover`,
`is_resizable`) collapsed into one enum, with resizability living inside
the only variant where it's meaningful:
```rust
enum Presentation {
Modal { resizable: bool }, // own chrome, dismisses on blur, optionally resizable
Popover, // own chrome, dismisses on blur, never resizable
Embedded, // host container owns chrome + dismissal
}
```
- `modal(bool)` is **removed** in favor of explicit, self-documenting
builders:
- *(default)* → `Modal` (resizable iff it has a preview)
- `.popover()` → `Popover` (menu-attached surfaces)
- `.embedded()` → `Embedded` (pickers nested in a larger modal/view)
- Dynamic callers use `.when(cond, Picker::embedded)` (added `impl
FluentBuilder for Picker`).
**Sizing** — preview-vs-not now drives everything; the manual padding
knob is gone:
| Before | After |
|---|---|
| `vertical_padding` field + `no_vertical_padding()` | removed — derived
from whether a preview is visible |
| `height(...)` (ambiguous: fixed vs max) | `max_height(...)` (plain
pickers shrink-to-fit, capped here) |
| `minimum_results_width(...)` | removed — a plain picker's min width
tracks its opening width; preview pickers use standard internal pane
mins |
| default size = 60% viewport | default = `DEFAULT_MODAL_WIDTH` (34rem)
× `DEFAULT_MODAL_MAX_HEIGHT` (24rem, max) |
| resize handles gated on `is_modal` | gated on `is_resizable` (new
`resizable(bool)` builder; auto-`true` for preview pickers) |
Call sites now only override the exceptions: narrow popover selectors
(`initial_width`), the taller outline view (`max_height`), and preview
pickers (constructed via `*_with_preview`).
## Behavior fixes
- **Wrong widths everywhere**: pickers were falling back to
60%-of-viewport because the original migration set
`minimum_results_width` but never `initial_width`. Fixed at the source
via the new defaults.
- **Popovers had no container and wouldn't dismiss**: `is_modal=false`
was suppressing both the elevated background *and* blur-dismiss. Split
out so popovers keep their chrome and dismiss on click-away/escape. This
fixed the agent-panel model/profile selectors, sidebar recent projects,
and the settings theme/font/icon/ollama pickers (which were incorrectly
using `modal(false)`).
- **Sidebar recent projects stretched to full height**: was missing the
shrink-to-fit behavior; now capped and content-sized like other
popovers.
- **Preview crash**: removed an over-strict `debug_assert!` that
panicked when previewing an empty file (`message == None && editor
empty` is valid).
- **Preview-aware default size**: pickers open at standard width with
the preview hidden, and expand to the larger "telescope" size when a
preview is shown. Fixes the text finder rendering super-wide by default,
and makes the file finder expand (rather than cram its results) when you
toggle the preview.
---
Release Notes:
- N/A
|
||
|
|
c84982260e |
Migrate missed pickers to new width system (#59693)
# Objective - Fixes #59643. ## Problems - Initial and minimum width was not migrated for all pickers. - Some pickers had their width still determined by their wrapper. - Some pickers where not modals but did not have modal false set. ## Solution - Migrate the pickers we missed. - Remove the width being set on the div's wrapping the pickers. - Set modal false on the missed pickers. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A |
||
|
|
583fd90c37 |
git_ui: Search commits by hash (#59132)
## Summary - Allows Git Graph search to match abbreviated or full commit hashes when the query looks like a SHA. - Keeps the existing message search behavior for non-hash queries. - Mirrors the hash search heuristic in the fake git backend and adds GPUI coverage for hash and message search. <img width="1912" height="1241" alt="image" src="https://github.com/user-attachments/assets/903b438e-baa8-4447-95dc-faf321bca6a5" /> ## Test Plan - `cargo fmt --check --package git_ui` - `cargo -q test -p git_ui test_git_graph_search_matches_commit_hash_prefix -- --nocapture` - `./script/clippy -p git_ui` ## Suggested .rules additions - N/A Release Notes: - Improved Git Graph search to find commits by abbreviated or full hash. |
||
|
|
6a6fcbebc4 |
Add preview to pickers and make them resizable (#59604)
Overhauls Zed's pickers to make them resizable and give them a preview. Closes #8279 ### Background The most requested Zed feature has the last year has been a [Telescope like search box](https://github.com/zed-industries/zed/issues/8279) [discussion](https://github.com/zed-industries/zed/discussions/22581). To understand why this is so popular we need to understand search can serve thee goals: - Navigation: fuzzy search is faster & easier then clicking in a file tree - Exploration: example, find a function by a word in its doc comment - Collecting: example, getting a list of functions to change The project search which shows results in a multibuffer is the perfect way to operate on a list of items. Navigation and Exploration need a lot of context around each result and offer fast navigation between them. For both of these live searching is also critical. The `telescope UI` is a picker with a preview to the right or below. It's offered in various editors and IDE's most famously Neovim (through the Telescope plugin), IntelliJ (natively), Helix (natively) and of course VScode (plugins) and it's _many_ forks. While having a UI like that for text search (our project search) is most requested the UX pattern is applied widely, from `find_all_references` to `bookmarks`. It enhances most pickers. Note that we have over 50 different picker modals! The community has tried to build something like this for Zed: - https://github.com/zed-industries/zed/pull/44530 - https://github.com/zed-industries/zed/pull/45307 - https://github.com/zed-industries/zed/pull/46478 - https://github.com/zed-industries/zed/pull/43790 These all became huge PR's that we could not merge for various reasons. This is a really hard feature to integrate in Zed! This PR got started as https://github.com/zed-industries/zed/pull/46478 and supercedes that. ### Design - Extend pickers to support an optional preview with minimal changes to the pickers themselves. - Make pickers resizable. - Complement the existing search do not replace it by having both UI's share the underlying search and allow freely switching between them. - Allow extending the preview to things other then files. - Maintain a clean design on all the pickers. ### Heigh level Implementation overview - Adds an `Option<Preview>` to `Picker` - Gives `PickerDelegate` a method to communicate a preview to the Picker - Overhaul the way pickers are drawn to allow for resizing them. Implemented on the `Shape` and `SizeBouds` structs. - Adds a high level way to draw the `footer` and `editor` so we do not need to change much to the pickers. - Adds a new text finder Picker - Adds a way to take a running search from project search and hand it to the text finder Picker and the other way round - Give the file finder a preview ### Next steps A more detailed list and how to help out will be added to the tracking issue for [Pickes with previews](https://github.com/zed-industries/zed/issues/56037) - Add more previews to more pickers! - Enable selectioning multiple items in pickers and performing actions on those - Open selected items in a multibuffer - Add a way to restore the last picker - Make popovers (picker attached to some menu) resizable as well ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase TODO (will be done post merge) --- Release Notes: - Added resizing via dragging to all picker modals. - Added a preview to the File finder, the preview can be to the right or below. - Added a Text finder picker with a preview as alternative project search UI. The search is shared and allowes switch between UIs while running. --------- Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com> Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com> |
||
|
|
359fcde776 |
git_graph: Fix infinite loading for empty repos (#58959)
Fixes git graph showing an infinite loading state for repositories with no commits. The bug happened because an empty `git log --all` result completed successfully with zero commits, but the UI treated a loaded graph with `0` commits as still loading instead of showing the empty state. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #53399 Release Notes: - Fixed git graph loading forever for empty repositories. |
||
|
|
9ddd1113f7 |
git_ui: Pass the clicked ref to git graph custom commands (#58781)
Right-clicking a ref label (branch, remote ref, or tag) in the git graph now opens a ref-specific context menu that resolves custom git commands with the clicked ref exposed as ZED_GIT_REF, mirroring how VS Code's git graph offers ref-aware actions. Right-clicking elsewhere on a commit keeps the existing commit-scoped menu. <img width="875" height="525" alt="zed (Ubuntu) 2026_06_07 23_26_35" src="https://github.com/user-attachments/assets/140bdcdf-6536-4b5e-ac2f-9df84f744477" /> releated: #55844 #56354 Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Added a context menu for ref labels in the git graph that runs custom git commands with the clicked ref available as `$ZED_GIT_REF`. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com> |
||
|
|
590928affc |
git_graph: Add tree view for commit changed files (#58198)
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Summary: - Added a toggleable tree view for changed files in the git graph commit details panel - Reused shared ListItem rows and file icon folder rendering for changed-file entries - Kept flat view available for status-sorted changed files Tests: - cargo check -p git_graph Release Notes: - Improved commit details changed-file lists with an optional tree view |
||
|
|
9abfeab186 |
git_ui: Move git_graph into git_ui (#57503)
cc @Anthony-Eid ## Why This is the first step in moving the Git Graph work into the Git UI crate before continuing with follow-up refactors and feature work. The goal is for Git UI components and shared Git UI helpers to live in one crate, so future changes to the Git Graph can reuse existing `git_ui` code instead of duplicating it. This PR is not only a filesystem move. While moving `git_graph` into `git_ui`, a few small dependency and helper boundaries had to change: - `git_graph` and `git_ui` both needed the same remote parsing and commit tooltip construction behavior, so those pieces are now shared from `git_ui`. - `git_graph` previously depended on `project_panel` to resolve file-history actions from the project panel selection. After moving `git_graph` into `git_ui`, keeping that dependency would create an undesirable `git_ui` -> `project_panel` relationship. The project-panel-specific action forwarding now lives in `project_panel`, and calls into exported `git_ui::git_graph` helpers instead. - `git_graph` initialization now happens through `git_ui::init`, so downstream crates only need to initialize `git_ui`. This prepares the codebase for the next planned PRs: splitting the large `git_graph.rs` implementation into smaller pieces, then adding Git Graph features such as keeping the main branch lane at index `0`. ## License removal The removed `crates/git_graph/LICENSE-GPL` file was a symlink to the repository root `LICENSE-GPL`. The moved code is now inside `git_ui`, which is also licensed as `GPL-3.0-or-later` and has its own `LICENSE-GPL` symlink to the same root license file. The code did not move to a differently licensed crate; it remains covered by the same GPL license. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Anthony Eid <anthony@zed.dev> |