Skip to content

Emojis in Commit Messages can Break UI Layout and Affect Displayed Diffs #3811

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

Open
ghost-in-the-zsh opened this issue Aug 9, 2024 · 0 comments · May be fixed by #4247
Open

Emojis in Commit Messages can Break UI Layout and Affect Displayed Diffs #3811

ghost-in-the-zsh opened this issue Aug 9, 2024 · 0 comments · May be fixed by #4247
Labels
bug Something isn't working

Comments

@ghost-in-the-zsh
Copy link

ghost-in-the-zsh commented Aug 9, 2024

Describe the bug

When commit messages have some emojis, the UI layout can break. So far, I've seen this with the lightning emoji ⚡️.

The part of the UI that I've observed breaking is the vertical line/bars that separates the viewports (e.g. staged/unstaged changes from commits/reflog.)

Because of the misplaced border, the diff itself gets affected. The text's indentation will be off by one column on that line, and in some cases, a character may be duplicated, even if it's not really part of the actual diff.

To Reproduce

  1. Make a commit that includes the zap/lightning emoji ⚡️ in the summary line of the commit message.
  2. Look at the viewport borders around the commits/reflog area.
  3. The commit message's row should have a misplaced vertical bar at the border. (See context notes.)

Expected behavior

The UI borders don't break and the displayed diff matches the actual diff

Screenshots

Notice the misplaced bar on the far right side, and the - diff symbol occupying the space where the border bar should be:

Screenshot from 2024-08-08 18-11-10

In the following pic, the ⚡️ is followed by ➖, which does not break the border, but does make it seem like there's a typo in the commit message itself (notice the ttests instead of tests):

Screenshot from 2024-08-08 18-25-00

Compare the above with the output of git log, which shows that there's no actual typo in the commit message for hash a94a...:

Screenshot from 2024-08-08 18-30-21

And here are 2 examples of how the diffs look different. Notice the duplicated double-quotes in the highlighted lines, in addition to the off-by-one column alignment:

Screenshot from 2024-08-08 17-53-41

Screenshot from 2024-08-08 17-55-59

The issue follows the highlighted line as you move up/down due to the broken layout.

Version info:

LazyGit version: commit=71ad3fac63a3ef3326021837b49e9497d332818b, build date=2024-07-13T10:24:19Z, build source=binaryRelease, version=0.43.1, os=linux, arch=amd64, git version=2.43.0

Git version: git version 2.43.0

Additional context

For the issue to show up, the ⚡️ emoji might need to be followed by text. It seems emoji order and/or different combinations can make a difference, so there're issues I may not have noticed (yet). If more than just the ⚡️ is used, the issue may manifest itself differently (e.g. bar vs typo).

Also, the duplicated diff chars, which don't always show up, also seem to go away if you scroll enough to move them "off-screen" within the staged/unstaged changes viewport --assuming the diff has enough changes to allow for this.

@ghost-in-the-zsh ghost-in-the-zsh added the bug Something isn't working label Aug 9, 2024
X1Vi added a commit to X1Vi/lazygit that referenced this issue Feb 9, 2025
Now the emoji is not visible in the commits panel. However a commit
message is not changed it remains as is. This fixes the UI issue where
it was distrubing the diff panel

Closes jesseduffield#3811
X1Vi added a commit to X1Vi/lazygit that referenced this issue Feb 9, 2025
Now the emoji is not visible in the commits panel. However a commit
message is not changed it remains as is. This fixes the UI issue where
it was distrubing the diff panel

Closes jesseduffield#3811

fixed linting issues
@X1Vi X1Vi linked a pull request Feb 9, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant