Skip to content

Enhance color logic for phantom elements to improve visual distinction based on collision status#42710

Merged
danilo-leal merged 2 commits intozed-industries:mainfrom
libondev:style/breakpointer-hover-color
Nov 27, 2025
Merged

Enhance color logic for phantom elements to improve visual distinction based on collision status#42710
danilo-leal merged 2 commits intozed-industries:mainfrom
libondev:style/breakpointer-hover-color

Conversation

@libondev
Copy link
Contributor

This change modifies the color assignment for phantom elements in the editor. If a phantom element collides with existing elements, it now uses a custom color based on the theme's debugger accent with reduced opacity. Otherwise, it defaults to the hint color.

BEFORE:
20251114-0939-17 9919633

AFTER:
20251114-0942-38 8596606

Release Notes:

  • Enhanced color logic for phantom elements to improve visual distinction based on collision status.

… state

This change modifies the color assignment for phantom elements in the editor. If a phantom element collides with existing elements, it now uses a custom color based on the theme's debugger accent with reduced opacity. Otherwise, it defaults to the hint color.

Release Notes:

- Enhanced color logic for phantom elements to improve visual distinction based on collision status.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 14, 2025
@maxdeviant maxdeviant changed the title Enhanced color logic for phantom elements to improve visual distinction based on collision status Enhance color logic for phantom elements to improve visual distinction based on collision status Nov 14, 2025
@danilo-leal
Copy link
Member

Hey, thanks for the PR! I'm not sure if I'm following what's the improvement here... effectively, I see that there's now a hover state color difference for set breakpoints, which I'm not sure if it's an upgrade because the lighter color due to reduced opacity makes me think for a second whether the breakpoint is disabled or something. Is there another testing case I'm missing? Maybe I'm unsure which other elements could be considered as "phantom", but I'm assuming this is all about the breakpoint, given we're inside render_breakpoint.

@libondev
Copy link
Contributor Author

Sorry to make you confused. My initial idea was to adjust the interaction of creating breakpoints in zed to be translucent red when creating breakpoints as in vscode/jetbrains, and to fix the color when the mouse passes over the already created breakpoints. However, I found that zed has actually implemented the distinction between these two states, so what I can think of is to distinguish the color of the breakpoints that have been created, so that I can know whether this operation is creating a breakpoint or canceling a breakpoint.

But actually I’m not sure whether my idea is in line with zed’s design concept. I’m sorry that I made the modification without opening an issue for discussion first. I’m sorry.

@libondev
Copy link
Contributor Author

If my idea is wrong please tell me and I will close this pr :)

Copy link
Member

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

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

Thank you for following up! I think when I initially ran the branch vs. main, I didn't see that we were persisting the regular color when hovering an already set breakpoint; this is definitely an improvement! I tweaked the color, though, so it is lighter rather than darker on hover, just so it doesn't get confused with a disabled state.

@danilo-leal danilo-leal enabled auto-merge (squash) November 27, 2025 21:26
@danilo-leal danilo-leal merged commit b17b903 into zed-industries:main Nov 27, 2025
23 checks passed
@libondev libondev deleted the style/breakpointer-hover-color branch November 28, 2025 03:46
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
…n based on collision status (zed-industries#42710)

This change modifies the color assignment for phantom elements in the
editor. If a phantom element collides with existing elements, it now
uses a custom color based on the theme's debugger accent with reduced
opacity. Otherwise, it defaults to the hint color.

BEFORE:
![20251114-0939-17
9919633](https://github.com/user-attachments/assets/4ec56f03-4708-4b35-b1ab-abdfd41c763e)

AFTER:
![20251114-0942-38
8596606](https://github.com/user-attachments/assets/6e9a98f1-a34d-4676-9dc6-b3e2b9f967bc)


Release Notes:

- Enhanced color logic for phantom elements to improve visual
distinction based on collision status.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
@katie-z-geer katie-z-geer moved this from Community PRs to Done in Quality Week – December 2025 Dec 2, 2025
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

Development

Successfully merging this pull request may close these issues.

3 participants