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

UI misalignment due to the font-family choice #38

Closed
johnhany97 opened this issue Nov 8, 2023 · 7 comments · Fixed by #40
Closed

UI misalignment due to the font-family choice #38

johnhany97 opened this issue Nov 8, 2023 · 7 comments · Fixed by #40

Comments

@johnhany97
Copy link

I noticed that a few weeks ago, the plugin started yielding the following mis-alignment when used in my Slack workspace:
image

On experimenting with the CSS, I noticed that if I were to remove monospace from the following code snippet, the issue is resolved.
https://github.com/yamadashy/slack-channels-grouping/blob/main/app/styles/content.css#L14

I tried opening the Slack workspace in incognito mode with only this plugin enabled and was still facing the same issue. Please let me know if opening this PR would be sufficient to resolve this issue, or if there are other complications you foresee from such a change.

@yamadashy
Copy link
Owner

I apologize for the delayed response to this issue and thank you for bringing it to our attention.

While I haven't been able to reproduce the issue in my environment yet, I will investigate further to understand the problem.

@yamadashy
Copy link
Owner

@johnhany97
I haven't been able to investigate in detail yet, but the fact that removing 'monospace' resolves the issue seems to suggest a scenario where the system is not finding a font that matches 'sans-serif', thus falling back to 'monospace', but not being monospaced.
Additionally, I found information indicating that even with 'monospace', it might not always result in a monospaced format depending on the environment.
Following your suggestion to use only 'sans-serif' seems like a good approach, but I would like to investigate a bit more.

If it's convenient for you, could you please provide details about your operating system and browser?

@johnhany97
Copy link
Author

@yamadashy , thank you for taking a look. I really appreciate your help here. I'm running this on my M1 MacBook Pro on macOS Sonoma (though this issue started on the previous macOS), and opening Slack through Chrome. I have Slack saved as a Chrome app - but opening Slack through the regular Chrome window still displays this message.

I dug deeper based on your insights and noticed that for the spans that use the class highlighted above, Chrome is choosing to render Helvetica and Menlo on my computer
image

I attempted to change both font types in Chrome's settings but that doesn't seem to fix it yet.

@yamadashy
Copy link
Owner

Thank you for providing such detailed information; it's been very insightful. The shared details about the fonts being used helped identify the cause of the issue.

When font-family: sans-serif, monospace is specified, if sans-serif doesn't support certain characters, only those characters may fallback to monospace or another font, leading to a lack of consistency in rendering.

I experimented with Helvetica, Menlo on CodePen and found that Helvetica only supports characters like and , while Menlo covers the others such as and . This partial support can lead to the odd display we're seeing. It was a valuable learning experience.
https://codepen.io/yamadashy/pen/PoVLKmO?editors=1000
スクリーンショット 2023-12-09 17 13 26

By the way, perhaps because I am Japanese, the font used for sans-serif was Hiragino Kaku Gothic ProN, which support all characters, so I didn't initially notice this issue.

As of now, I haven't come up with a good solution, but I'll explore some options, such as creating a web font dedicated solely to Box-drawing characters and loading it accordingly. Thank you for your research and report.

@johnhany97
Copy link
Author

Thank you for figuring this out, I really appreciate you spending the time to put up the codepen as well - this has been very informative.

I leave it to you if you want to investigate a solution that comes pre-bundled with the extension. In my case, I've proceeded to pick another font (Arial Unicode MS) as the default sans-serif font and that's resolved my initial issue.

While i'm here, I wanted to thank you for building this plugin - it's been of great help visually as I'm in a significant number of channels that have similar prefixes.

@yamadashy
Copy link
Owner

yamadashy commented Dec 25, 2023

The fix has been implemented into the main branch. I will be testing it on a few PCs and across several Slack workspaces over the next three days. If everything works well without any issues, I'll proceed to create a new release version and make it available.

#40

@yamadashy
Copy link
Owner

@johnhany97
I've successfully passed the Google review and have published version 1.0.35.
After updating, I was able to confirm that it is working as expected.

Screenshot 2023-12-30 15:33:57

Thank you for reporting the issue.
I will be closing this issue now.

It's greatly appreciated. Wishing you a wonderful holiday season!

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

Successfully merging a pull request may close this issue.

2 participants