-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
Fix misaligned tab list indentation on mobile #4610
Conversation
9537609
to
77406be
Compare
c68f159
to
0ba19bd
Compare
I suspect some windi issues here. Let's wait until #4614 is done |
9595c4e
to
79c1c87
Compare
for more information, see https://pre-commit.ci
79c1c87
to
b3f0356
Compare
OK got it working now. |
@pat-s Can we apply the formatting changes in a single PR that does not contain anything else? Its really hard to review such PRs. |
Why not just disable your plugin for now. I'm ok to review the existing PRs in this state, but would reject any new PR with such an amount of unrelated changes. |
<span | ||
class="flex gap-2 items-center md:justify-center flex-row py-1 px-2 w-full min-w-20 dark:hover:bg-wp-background-100 hover:bg-wp-background-200 rounded-md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I should have done so already. Just didn't think about it and went on doing work. |
Is an option. I tried it but didn't like that the line highlights spawns so wide to the right. For steps it is smaller and hence less an issue. But I can try, makes sense to use the same approach. |
Yes, but not using the full width, it is also bad on mobile. |
class="border-transparent w-full py-1 md:w-auto flex cursor-pointer md:border-b-2 text-wp-text-100 items-center" | ||
:active-class="tab.matchChildren ? '!border-wp-text-100' : ''" | ||
:exact-active-class="tab.matchChildren ? '' : '!border-wp-text-100'" | ||
class="flex items-center px-2 py-1 border-transparent md:border-b-2 w-auto w-full md:w-auto text-wp-text-100 cursor-pointer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w-full
and w-auto
should not be used together and as I said already, I'm strictly against not using full width on mobile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying this out, I think now that using full-width on mobils is a mistake.
It forces the tabs to be sorted below each other, by this using up a lot of vertical screen space and leaving a lot unused. In addition, a full width background highlighting of the active one looks really odd.
By restricting width, the tabs are aligned horizontally. To me, this makes much better use of the available space.
This is a mobile screenshot:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that we mix in more and more issues and new ideas in existing PRs. If you want to get forward, I would suggest staying with the current layout. Otherwise, it needs to wait until it gets more feedback/approvals from other maintainers. I cant approve it as I think its technically and in terms of UX wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point and I am also fine to revert to keep this PR small. However, it sometimes/often happens that one stumbles over an issue only when iterating on a specific topic. Then again it might happen that the proposed solution doesn't work so well and including an additional change might round up the picture of the PR.
TBH, I am absolutely unhappy with adding a full-width bg highlighting. In that case, I would have a strong vote in favor of the initially proposed underline.
To find a middleground that suits both, I've started iterating on a "good" bg highlighting approach that would suit both. Yet now we're here in a semi-complicated (meta) discussion.
One option now is to merge the "small" PR variant with the full width bg highlighting but I will open add a follow-up PR then to propose a change to a horizontal layout (which hopefully doesn't get denied then as otherwise I would feel somewhat played out 😅️).
If that is not agreed on, I'd favor to not merge this PR and let it be evaluated again later in a broader scope, once I've finished to come up with such a horizontal solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a meta discussion. You changed the overall layout fundamentally in the middle of a PR that aims to fix a small alignment issue. I will for sure deny any horizontal layout on mobile 😅 We can make the mobile nav a rollup menu or a popup like github or gitea do or any similar approach but is has to be vertically aligned in any case.
As you like to compare to other well known apps as reference, can you name a single one where the mobile nav looks like the one you proposed? I cant and there is a good reason for it.
Im ok to go with an underline indicator for now, even if the bg indicator isnt that bad...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a meta discussion. You changed the overall layout fundamentally in the middle of a PR that aims to fix a small alignment issue.
Yes, but I didn't hide this change and fully OK in general with the idea of changing a PR scope after creation for a good reason. If this would have been the initial scope, nothing would be wrong about it.
And I'd rather have a PR that ends up in a "working" solution than a partially working one, even if that means extending/delaying the PR. It is not about winning a sprint in merging PRs.
I also think it is pretty normal to discover such things when you touch parts of the code base for the first time (personally) and then find out that XYZ are suboptimal but should ideally be changed together.
I started with wanting to fix the indentation of the chevron-right
icon. Then I realized it has no function at all and only exists on mobile and should likely be removed. While at it, I realized there is no indicator which tab is actually active, so I had the idea of the underline. You then brought up the bg highlighting idea, which is good and I tried to add. I then (accidentally) discovered the forced full-width for each of these items and the odd look of the full-width highlight and now we're here.
(I know you're aware of all this, just wanted to outline how the overall process was and that there's always a reason for every step in the process).
We can make the mobile nav a rollup menu or a popup like github or gitea do or any similar approach but is has to be vertically aligned in any case.
I am with you for the admin list as this is one is long and might potentially get even longer. In such cases I am fully with you and would even say that there should be hamburger fold by default (as for GH and GL mobile).
The pipeline list however consists of three fixed items which perfectly fit horizontally without needing folding. I don't see why these must be aligned vertically at all costs with a questionable full-width highlighting. Have you tested the current state directly on your phone? It is much better than before (again, only talking about the pipeline list). We don't need hover on mobile (this still needs to be removed).
PS: Thanks for the calm and positive-minded discussion. I think such discussion are required to achieve (good) improvements in the end. Appreciate it 🤝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pipeline list however consists of three fixed items which perfectly fit horizontally without needing folding.
The menu should work in the same way for all pages. Just because it looks ok on one page doesnt solve the problem. Besides that what happens if more menu items are added? Or someone uses a smaller phone than yours? The approach chosen by GH keeps items vertically aligned as long as they fit in one line, all items that dont fit in this single line are moved into a "more" menu dynamically. As I said, Im fine with such an approach.
We don't need hover on mobile (this still needs to be removed).
Well hover effects apply e.g. on long press actions on mobile. I dont see a reason to remove them, in best case they never appear and can just stay instead of adding more code to remove them.
:active-class="tab.matchChildren ? '!border-wp-text-100 dark:wp-background-100 bg-wp-background-300' : ''" | ||
:exact-active-class="tab.matchChildren ? '' : '!border-wp-text-100 dark:wp-background-100 bg-wp-background-300'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
border-radius
is missing and it is the wrong color.
Tearing down https://woodpecker-ci-woodpecker-pr-4610.surge.sh |
Remove the unneeded and unresponsive
chevron-right
in mobile view and instead use a plain list in which the active item is underlined.fix #2162 (comment)