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

git diff hunk background color does not look correct #24091

Closed
heyanurag opened this issue Feb 2, 2025 · 7 comments
Closed

git diff hunk background color does not look correct #24091

heyanurag opened this issue Feb 2, 2025 · 7 comments
Assignees

Comments

@heyanurag
Copy link

Summary

The git diff hunk background color has changed in the Zed Preview v0.172.5.

Steps to trigger the problem:

  1. Make any change and view the inline git diff.

Actual Behavior:

  • This is the current behaviour in Zed Preview v0.172.5:
Image

Expected Behavior:

  • This is how it currently looks in stable Zed v0.171.6:
Image

The green background color does not look good even though both Zed and Zed preview are using the same zed config.

My theme in zed config:

"experimental.theme_overrides": {
    "background.appearance": "opaque",
    "border": "#2B2B2B",
    "border.variant": "#2B2B2B",
    "border.focused": "#fff",
    "border.selected": "#fff",
    "border.transparent": "#2B2B2B",
    "border.disabled": "#2B2B2B",
    "surface.background": "#181818",
    "background": "#1F1F1F",
    "element.background": "#2B2B2B",
    "info": "#fee56cff",
    "info.border": "#fee56c3d", // ts error stuff
    "info.background": "#73c9913d",
    "error.background": "#54051bff",
    "error.border": "#72092aff",
    "warning": "#feb454ff",
    "warning.background": "#572815ff",
    "warning.border": "#572815ff",
    // "hint": "#fff", // git inline blame
    "panel.focused_border": "#fee56c3d",
    "hint.background": "#feb4543d",
    "hint.border": "#feb4543d",
    "success.background": "#184618ff",
    "element.hover": "#ffffff02",
    "element.selected": "#04395E",
    "drop_target.background": "#383B3D",
    "text": "#D4D4D4",
    "text.muted": "#ffffff80",
    "status_bar.background": "#181818",
    "title_bar.background": "#181818",
    "search.match_background": "#623315",
    "editor.document_highlight.read_background": "#ffffff30",
    "editor.document_highlight.bracket_background": "#ffffff30",
    "editor.foreground": "#CCCCCC", // tooltip text color
    "terminal.background": "#1e1e1e",
    "terminal.ansi.black": "#000000",
    "terminal.ansi.bright_black": "#666666",
    "terminal.ansi.red": "#FF205A",
    "terminal.ansi.bright_red": "#FF0039",
    "terminal.ansi.green": "#0DBC79",
    "terminal.ansi.bright_green": "#23D18B",
    "terminal.ansi.yellow": "#FFC046",
    "terminal.ansi.bright_yellow": "#E5B400",
    "terminal.ansi.blue": "#2472C8",
    "terminal.ansi.bright_blue": "#3B8EEA",
    "terminal.ansi.magenta": "#C573EB",
    "terminal.ansi.bright_magenta": "#D670D6",
    "terminal.ansi.cyan": "#5FD8FF",
    "terminal.ansi.bright_cyan": "#29B8DB",
    "terminal.ansi.white": "#E5E5E5",
    "terminal.ansi.bright_white": "#E5E5E5",
    "link_text.hover": "#4DAAFC",
    "conflict": "#d16969",
    "created": "#73c991",
    "deleted": "#F85149",
    "deleted.background": "#F851493d",
    "modified.background": "#E2C08D3d",
    "hidden": "#6b6b73ff",
    "ignored": "#8c8c8c",
    "modified": "#E2C08D",
    "renamed": "#4ec9b0",
    "predictive": "#aca8aeff",
    "players": [
      {
        "cursor": "#39bae5ff",
        "background": "#39bae5ff",
        "selection": "#39bae53d"
      },
      {
        "cursor": "#5ac1feff",
        "background": "#5ac1feff",
        "selection": "#5ac1fe3d"
      },
      {
        "cursor": "#fe8f40ff",
        "background": "#fe8f40ff",
        "selection": "#fe8f403d"
      },
      {
        "cursor": "#d2a6feff",
        "background": "#d2a6feff",
        "selection": "#d2a6fe3d"
      },
      {
        "cursor": "#95e5cbff",
        "background": "#95e5cbff",
        "selection": "#95e5cb3d"
      },
      {
        "cursor": "#ef7177ff",
        "background": "#ef7177ff",
        "selection": "#ef71773d"
      },
      {
        "cursor": "#feb454ff",
        "background": "#feb454ff",
        "selection": "#feb4543d"
      },
      {
        "cursor": "#aad84cff",
        "background": "#aad84cff",
        "selection": "#aad84c3d"
      }
    ],
    "syntax": {
      "predictive": {
        "color": "#315f70ff", // grey (faded)
        "font_style": "italic"
      },
      "comment": {
        "color": "#6A9955"
      },
      "comment.doc": {
        "color": "#6A9955"
      },
      "constant": {
        "color": "#42B3FE"
      },
      "constructor": {
        "color": "#4788CC"
      },
      "embedded": {
        "color": "#4EC9B0"
      },
      "emphasis.strong": {
        "color": "#569cd6"
      },
      "keyword": {
        "color": "#c586c0"
      },
      "operator": {
        "color": "#D4D4D4"
      },
      "preproc": {
        "color": "#499CD5"
      },
      "punctuation": {
        "color": "#969696ff"
      },
      "punctuation.bracket": {
        "color": "#969696ff"
      },
      "punctuation.delimiter": {
        "color": "#969696ff"
      },
      "punctuation.list_marker": {
        "color": "#969696ff"
      },
      "punctuation.special": {
        "color": "#969696ff"
      },
      "tag": {
        "color": "#569CD6"
      },
      "text.literal": {
        "color": "#CE9178"
      },
      "type": {
        "color": "#4EC9B0"
      },
      "variable": {
        "color": "#42B3FE"
      },
      "variable.special": {
        "color": "#42B3FE"
      },
      "variant": {
        "color": "#9cdcfe"
      },
      "label": {
        "color": "#DCDCAA"
      }
    }
  },

Zed Version and System Specs

Zed: v0.172.5 (Zed Preview)
OS: macOS 14.5.0
Memory: 16 GiB
Architecture: aarch64

Zed: v0.171.6 (Zed)
OS: macOS 14.5.0
Memory: 16 GiB
Architecture: aarch64

@maxbrunsfeld maxbrunsfeld self-assigned this Feb 3, 2025
@maxbrunsfeld
Copy link
Collaborator

Thanks for the report! There must be some theme override that we're no longer respecting, with the new Git Hunk presentation. I'll let you know when the fix is released.

@maxbrunsfeld
Copy link
Collaborator

What theme are you using in that screenshot?

@maxbrunsfeld
Copy link
Collaborator

A couple other questions:

  • I can't reproduce this. Are the settings that you shared the exact ones that you had when you took the bad-looking screenshot?
  • It doesn't look like you override the created.background color in your theme_overrides. That is color that we're using here. Is there any chance you had an override for that color when taking that screenshot, but then removed it?

@maxbrunsfeld maxbrunsfeld added the awaiting info Issue that needs more information from the user label Feb 3, 2025
@nicmue
Copy link

nicmue commented Feb 3, 2025

I'm seeing the exact same issue when using the theme Zedokai Darker (https://github.com/slymax/zedokai).

Zed: v0.172.4 (Zed Preview)
OS: macOS 14.7.1
Memory: 32 GiB
Architecture: x86_64

@maxbrunsfeld maxbrunsfeld removed the awaiting info Issue that needs more information from the user label Feb 3, 2025
@maxbrunsfeld
Copy link
Collaborator

Ok, I see. that theme doesn't define created.background, so we are falling back to some ugly green. There must have previously been some other fallback behavior. I'll put it back.

@maxbrunsfeld
Copy link
Collaborator

Fixed in #24151

@maxbrunsfeld
Copy link
Collaborator

Thanks for the reports! This is fixed in Zed Preview 0.172.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants