# git_panel: Fix empty state label not align to center \(\#55235\) · gitcafe/zed

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

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

Visibility: public

Requested revision: dc5af1de6448a1ed9bcdd4b57d5708e3846ad3b5

Requested commit: dc5af1de6448a1ed9bcdd4b57d5708e3846ad3b5

Commit: dc5af1de6448a1ed9bcdd4b57d5708e3846ad3b5

Tree: 6b59e098069ed4cc7a625fad85c6432d3a809b04

Author: Dong

Committer: GitHub

## Message

```
git_panel: Fix empty state label not align to center (#55235)

When the git panel is too narrow for "No changes to commit" or "No Git
Repositories" to fit on a single line, the wrapped lines were
start-aligned while the button below remained centered, breaking the
visual stack.

This wraps each label in a stretched, text-centered `div`, matching the
pattern already used by `render_unsafe_repo_ui` in the same file. The
bare string is kept (no `Label`) so the parent `v_flex`'s
`text_color(Color::Placeholder)` continues to apply unchanged.

### Repository detect

| As-is | To-be |
| --- | --- |
| <img width="400"
src="https://github.com/user-attachments/assets/d4388d15-057f-4ea2-ac02-528aa165578a"
/> | <img width="400"
src="https://github.com/user-attachments/assets/a7901061-9ff2-4bbc-b135-728089d6f43e"
/> |

### Repository not detect

| As-is | To-be |
| --- | --- |
| <img width="400"
src="https://github.com/user-attachments/assets/cc41387a-108e-43c1-848e-f7241dd33c73"
/> | <img width="400"
src="https://github.com/user-attachments/assets/c8a2f263-9fe4-450f-9d54-174bfa68e483"
/> |



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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes N/A

Release Notes:

- git_panel: Fixed empty state labels in the git panel becoming
left-aligned when wrapped to multiple lines
```

## Parents

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

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