# Fix: prevent completion labels and docs from being truncated \(\#61324\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a3ac036eb6b73e0a50af4a44c96a43f1abf1b989)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a3ac036eb6b73e0a50af4a44c96a43f1abf1b989

Requested commit: a3ac036eb6b73e0a50af4a44c96a43f1abf1b989

Commit: a3ac036eb6b73e0a50af4a44c96a43f1abf1b989

Tree: 0ee7b96b3ccb74e8fd76fcbf0848f2570da05a8b

Author: Tatsuya_yd

Committer: GitHub

## Message

```
Fix: prevent completion labels and docs from being truncated (#61324)

# Objective

- Fixes #60374 

## Solution

- Moved the `documentation_label` from the `ListItem::end_slot` into the
main `h_flex` layout alongside the `main_label`.
- Added `.flex_shrink(1.0)` and `.truncate()` to the documentation
container.
  - To allow it to shrink gracefully when space is tight.
- Removed `.w_full()` from the main label's container. 
- To prevent it from aggressively occupying all available horizontal
space, allowing the layout to balance the width between the label and
the documentation.

## Testing
- Visual and layout fixes tested manually by verifying the completion
menu in `settings.json`.
- All unit tests in the affected crate passed: `cargo test -p editor`.

## 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
### Visual change
<img width="813" height="314" alt="スクリーンショット 2026-07-20 143707"
src="https://github.com/user-attachments/assets/1daa3fa4-a479-465a-b7fd-cc803242c8a2"
/>

---

Release Notes:

- Fixed(CompletionsMenu): prevent completion labels and docs from being
truncated.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
```

## Parents

- [b1b412ddb3a15a1cd93250cf63f509fd8381e4b6](https://git.cafe/gitcafe/zed/commit/b1b412ddb3a15a1cd93250cf63f509fd8381e4b6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a3ac036eb6b73e0a50af4a44c96a43f1abf1b989?format=markdown)
