Repository navigation
Open
Labels
pinnedExempt from being closed as stalepriority: highImportant, work on this soonstatus: availableAvailable for anyone to pick uptype: bugSomething isn't working
Description
Problem description: on small screens table cells have uneven widths which looks odd.
This seems to be related to the length of the username and word wrapping.
Reproduction repository: https://github.com/ehmicky/portable-node-guide
Must be looked at on a smartphone.
all-contributors-cliversion:6.1.2nodeversion:11.11.0npm(oryarn) version:6.9.0
Relevant code or config
{
"projectName": "portable-node-guide",
"projectOwner": "ehmicky",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"contributors": [
{
"login": "ehmicky",
"name": "ehmicky",
"avatar_url": "https://avatars2.githubusercontent.com/u/8136211?v=4",
"profile": "https://twitter.com/ehmicky",
"contributions": [
"code",
"design",
"ideas",
"doc"
]
},
{
"login": "thatalextaylor",
"name": "thatalextaylor",
"avatar_url": "https://avatars3.githubusercontent.com/u/1481643?v=4",
"profile": "https://github.com/thatalextaylor",
"contributions": [
"ideas",
"doc"
]
},
{
"login": "bnoordhuis",
"name": "Ben Noordhuis",
"avatar_url": "https://avatars0.githubusercontent.com/u/275871?v=4",
"profile": "https://github.com/bnoordhuis",
"contributions": [
"ideas",
"doc"
]
},
{
"login": "SteveALee",
"name": "Steve Lee",
"avatar_url": "https://avatars2.githubusercontent.com/u/618922?v=4",
"profile": "http://opendirective.com",
"contributions": [
"ideas",
"doc",
"talk"
]
},
{
"login": "tracker1",
"name": "Michael J. Ryan",
"avatar_url": "https://avatars3.githubusercontent.com/u/444316?v=4",
"profile": "http://tracker1.info/",
"contributions": [
"ideas"
]
}
],
"contributorsPerLine": 7
}Reacted by Jake Bolam
Metadata
Metadata
Assignees
Labels
pinnedExempt from being closed as stalepriority: highImportant, work on this soonstatus: availableAvailable for anyone to pick uptype: bugSomething isn't working

Activity
Berkmann18 commentedon Mar 11, 2019
Thanks for reporting this.
I tried a few things but since GH blacklists (inline) CSS it's really tricky to get an HTML-only working approach.
@tbenning @jakebolam Would you guys know another solution?
jakebolam commentedon Mar 16, 2019
Thanks for reporting this @ehmicky. Any thoughts on approaches to address this?
ehmicky commentedon Mar 16, 2019
Unfortunately not, sorry :/
I've also noticed that the table is horizontally scrolled on mobile, but I'm not sure if this is intentional and/or this is related.
Berkmann18 commentedon Mar 16, 2019
@ehmicky > I've also noticed that the table is horizontally scrolled on mobile, but I'm not sure if this is intentional and/or this is related.
This is definitely not intentional, I'll try fixing that.
ehmicky commentedon Mar 16, 2019
@Berkmann18 you can reproduce by checking the same repository I posted above on a mobile screen. Please let me know if you would like me to post a screenshot.
style: set table width
Berkmann18 commentedon Mar 16, 2019
@ehmicky Yes I know, I tried something out but since there's more entries on the row than what my (and certainly your) phone can display, there's that horizontal scrolling even when the table's width is set to
99%.Berkmann18 commentedon Apr 15, 2019
@ehmicky Have you tried rolling back to the
v5version where markdown was used for the rendering?ehmicky commentedon Apr 15, 2019
No I haven't because while this issue does lead to horizontal scrolling, I don't think it justifies rolling back and missing bug fixes and features.
Berkmann18 commentedon Apr 15, 2019
@ehmicky Well, the
v5(if I recall correctly) was generating Markdown tables instead of HTML ones so it probably will fix the issue or part of it.If the horizontal scrolling were to re-occur, then either changing the
contributorsPerLineproperty in.all-contributorsrcor making the table responsive (which might be hard or perhaps impossible given the restrictions on GH file rendering).ehmicky commentedon Apr 15, 2019
Thanks for trying to figure a solution to this issue :)
The horizontal scrolling is still an issue (I just tried it), so it will re-occur.
I tried decreasing
contributorsPerLine. It looks better on mobile. However it looks worse on desktop.Locking the version back to a previous major version for the foreseeable future does not look like a good practice, as I might miss important bug fixes, features or security patches.
The real fix would be to make the table responsive, but I'm not sure if this possible :-/
1 remaining item
ehmicky commentedon Apr 15, 2019
Wouldn't it be simpler to re-introduce Markdown rendering in current
masterbut toggled being a configuration option?Berkmann18 commentedon Apr 15, 2019
@ehmicky Yeah, that's a better idea.
@sinchang @jakebolam What do you guys think?
docs: contributing slack (#173)
qyurila commentedon Oct 10, 2022
Improvement for Better Desktop View
After some trials and errors, I ended up reaching the conclusion that specifying
widthattribute of<td>tag would be visually better, especially on the desktop screen.Preview Branch
Personally, the combination of
<td width="16.66%">andcontributorsPerLine: 6config option (2nd table of above preview) looks best in the context of both of repo view and file view. The one withcontributorsPerLine: 7does not guarantee given avatar width (100px) in repo view.The tag of 2nd table would be like this:
It requires manual calculation to get the proper percentage value (because we cannot use
calc()here), but implementing it shouldn't be too difficult.Unfortunately, it seems it makes no significant visual improvement on the mobile browser.
qyurila commentedon Oct 10, 2022
Improvement for Mobile View
The main factor of this problem is long words that is not line-breakable. (e.g. allcontributors[bot], Greenkeeper[bot]) The only ways to make texts line-breakable is setting
word-breakCSS property tobreak-all, which is not possible in this case, and inserting Zero-width spaces (​) inside long words fitly.inserting `& #8203;`
Kent C. Dodds
💬 📖 👀 📢
Jeroen Engels
📖 👀 🔧
Jake Bolam
📖 🔧 🚇 🚧 👀 💬
Tyler Benning
🚧 💻 🎨
Jeff Wen
🚧 👀
Maximilian Berkmann
🌍 📖 🚧 👀 📢
Matheus Rocha Vieira
🌍 💻 📖
Robert Lluberes
🌍
이종진
📖 🌍
Wenqing Xue
🌍
Divjot Singh
📖 👀
Ben Briggs
📖 👀
James Monger
📖
Chris Simpkins
📖 👀
F. Hemberger
📖
Daniel Kraft
📖
Mayank Badola
📖 🔧
Marco Biedermann
🎨
Itai Steinherz
📖
Patrick Connolly
📖
Nikola Đuza
📖
Demian Dekoninck
💻
Michael Peyper
📖
David Sima
📖 🌍
allcontributors[bot]
📖
Greenkeeper[bot]
🚇
Maryam Pazirandeh
📖
Cassandra Venere
📖
The widths of the cells are still different, but it looks way better. The problem is how to insert it automatically and fitly. In the above example, I inserted it in the words that have more than 8 characters.
The other (and very hacky) way I found is using NBSP character (
).utilizing `& nbsp;`
Kent C. Dodds
💬 📖 👀 📢
Jeroen Engels
📖 👀 🔧
Jake Bolam
📖 🔧 🚇 🚧 👀 💬
Tyler Benning
🚧 💻 🎨
Jeff Wen
🚧 👀
Maximilian Berkmann
🌍 📖 🚧 👀 📢
Matheus Rocha Vieira
🌍 💻 📖
Robert Lluberes
🌍
이종진
📖 🌍
Wenqing Xue
🌍
Divjot Singh
📖 👀
Ben Briggs
📖 👀
James Monger
📖
Chris Simpkins
📖 👀
F. Hemberger
📖
Daniel Kraft
📖
Mayank Badola
📖 🔧
Marco Biedermann
🎨
Itai Steinherz
📖
Patrick Connolly
📖
Nikola Đuza
📖
Demian Dekoninck
💻
Michael Peyper
📖
David Sima
📖 🌍
allcontributors[bot]
📖
Greenkeeper[bot]
🚇
Maryam Pazirandeh
📖
Cassandra Venere
📖
Yes, it looks terrible 😂.
EDIT: I'll add these tables to the above preview repo!
According to my experience, it barely can solve any problem here. I added markdown table to the preview repo for the comparison, too.
qyurila commentedon Oct 10, 2022
Additionally, setting
valignattribute of<td>to"top"might result the better visual. I added the example about it to preview repo, too.So I think the best option would be:
tenshiAMD commentedon Oct 10, 2022
@qyurila hi, thanks for suggesting these workarounds. You wanna give this a shot? PRs are very welcome.
width="16.66%"(we can compute this percentage programmatically which iscontributorsPerLinedivided by 100)valign(unfortunately this is already deprecated in HTML5)qyurila commentedon Oct 10, 2022
Sounds good!
It's unfortunate indeed that not only
valignbut alsoalignis deprecated 😞EDIT: Sorry for the referencing commits mess, I didn't remember what happens when I do it 😥
Berkmann18 commentedon Nov 2, 2022
@qyurila @ehmicky Can either of you try with v6.24 and see if it's still an issue?
qyurila commentedon Nov 3, 2022
@Berkmann18 The visual got somewhat better but the issue is not quite solved, especially on edge cases (when there are some long single-word usernames).
You can check this branch of my fork to see what the current generation looks like.
Berkmann18 commentedon Dec 1, 2022
@qyurila Do you have a solution or suggestion for this? I've tried an approach similar to how I did for HTML emails but GH isn't nice when it comes to (inline) CSS so it's tricky to get the table to look clean.
qyurila commentedon Dec 8, 2022
@Berkmann18 I couldn't find any solution to improve this. The main (if not only) cause of the issue is that any long single-word username won't be wrapped, and GitHub simply does not provide any way to force-wrap them. The exception was their mobile app, which always had been showed tables with 100% width IIRC, but some time ago they fixed it.
Berkmann18 commentedon Jan 5, 2023
@qyurila That's unfortunate and yeah the limitations GH puts on HTML/CSS makes stuff like this hard to resolve and they seem fairly slow when it comes to responding to suggestions.