Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force code actions to be single line #21409

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WeetHet
Copy link
Contributor

@WeetHet WeetHet commented Dec 2, 2024

Addresses #21403 partially. Is consistent with the behaviour in VSCode

Before:
391571084-1bef4ef9-b8f5-4c8f-9a32-9c0ab6c91af1

After:
Screenshot 2024-12-02 at 18 35 11

Release Notes:

  • Fixed an issue with multiline code actions' rendering by forcing them to be single line

Addresses zed-industries#21403 partially. Is consistent with VSCode behaviour
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 2, 2024
@@ -1707,7 +1709,7 @@ impl CodeActionsMenu {
}
}),
)
.child(SharedString::from(task.resolved_label.clone()))
.child(SharedString::from(task.resolved_label.replace("\n", "")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we have a single_line helper on Label, if you'd like to use that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It replaces \n with which looks weird. I'd rather prefer nothing or a space, not sure which is better

danilo-leal added a commit that referenced this pull request Dec 3, 2024
Closes #20678

| Before | After |
| --- | --- |
| <img width="672" alt="SCR-20241203-jreb"
src="https://github.com/user-attachments/assets/411ba2a6-712f-4ab7-a320-12ac9a35c1e1">
| <img width="771" alt="SCR-20241203-jwhe"
src="https://github.com/user-attachments/assets/022c8ee9-4089-4c09-aa4b-12a0f5528822">
|

Release Notes:

- Fixed AI Context menu text wrapping causing overlap.

Also cc #21409 @WeetHet @osiewicz to use `Label`, this PR has been fixed
`Label` to ensure `whitespace_nowrap` when use `single_line`.

---------

Co-authored-by: Danilo Leal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants