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

Fix misaligned tab list indentation on mobile #4610

Closed
wants to merge 15 commits into from

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented Dec 22, 2024

Remove the unneeded and unresponsive chevron-right in mobile view and instead use a plain list in which the active item is underlined.

image

fix #2162 (comment)

@pat-s pat-s added bug Something isn't working ui frontend related build_pr_images If set, the CI will build images for this PR and push to Dockerhub labels Dec 22, 2024
@pat-s pat-s changed the title fix misaligned tabs list identation on mobile fix misaligned tabs list indentation on mobile Dec 22, 2024
@pat-s pat-s changed the title fix misaligned tabs list indentation on mobile fix misaligned tab list indentation on mobile Dec 22, 2024
@pat-s pat-s force-pushed the chore/fix-identation-tabs-mobile branch 6 times, most recently from 9537609 to 77406be Compare December 28, 2024 09:51
@pat-s pat-s force-pushed the chore/fix-identation-tabs-mobile branch from c68f159 to 0ba19bd Compare December 28, 2024 09:59
@pat-s
Copy link
Contributor Author

pat-s commented Dec 28, 2024

I suspect some windi issues here. Let's wait until #4614 is done

@pat-s pat-s force-pushed the chore/fix-identation-tabs-mobile branch 7 times, most recently from 9595c4e to 79c1c87 Compare December 28, 2024 12:46
@pat-s pat-s force-pushed the chore/fix-identation-tabs-mobile branch from 79c1c87 to b3f0356 Compare December 28, 2024 12:50
@pat-s
Copy link
Contributor Author

pat-s commented Dec 28, 2024

OK got it working now.

@pat-s pat-s marked this pull request as ready for review December 28, 2024 12:56
@xoxys
Copy link
Member

xoxys commented Dec 28, 2024

@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.

@pat-s
Copy link
Contributor Author

pat-s commented Dec 28, 2024

Yes, I know, I did #4622 to solve this.
But this is a bit blocked / WIP still.
We can push #4622 first, then the unrelated sorting changes should be wiped in the other ones.

@xoxys
Copy link
Member

xoxys commented Dec 28, 2024

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.

@xoxys xoxys changed the title fix misaligned tab list indentation on mobile Fix misaligned tab list indentation on mobile Dec 28, 2024
<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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

px-2 got lost here:

image

@xoxys
Copy link
Member

xoxys commented Dec 28, 2024

Personally, I don't think this way of highlighting looks nice. What do you think about using the same way we use for pipeline list items and use the hover bg?

image

@pat-s
Copy link
Contributor Author

pat-s commented Dec 28, 2024

Why not just disable your plugin for now.

Yes, I should have done so already. Just didn't think about it and went on doing work.

@pat-s
Copy link
Contributor Author

pat-s commented Dec 28, 2024

What do you think about using the same way we use for pipeline list items and use the hover bg?

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.

@xoxys
Copy link
Member

xoxys commented Dec 28, 2024

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"
Copy link
Member

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.

Copy link
Contributor Author

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:

image

Copy link
Member

@xoxys xoxys Dec 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but then at least I will not approve it. It looks ugly, is pretty uncommon, and its difficult to hit the correct button on small screens:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you name an argument why the vertical variant would be better? I can't find any.

The colored space is fully unused for no reason. It covers 60% of the default horizontal screen space on mobile.

image

Copy link
Member

@xoxys xoxys Dec 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not blind :) Im aware of the spacing issue and yes we can improve the menu with something like a "more" menu on mobile e.g. similar to gh:

image

But that's not that easy and needs more work and is not a topic for this PR. I added my argumentation to my last comment.

Copy link
Member

@xoxys xoxys Dec 28, 2024

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.

Copy link
Contributor Author

@pat-s pat-s Dec 28, 2024

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.

Copy link
Member

@xoxys xoxys Dec 29, 2024

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...

Copy link
Contributor Author

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 🤝️

Copy link
Member

@xoxys xoxys Dec 29, 2024

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.

Comment on lines 8 to 9
: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'"
Copy link
Member

@xoxys xoxys Dec 28, 2024

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.

@pat-s pat-s marked this pull request as draft December 28, 2024 23:58
@pat-s pat-s closed this Dec 30, 2024
@pat-s pat-s deleted the chore/fix-identation-tabs-mobile branch December 30, 2024 11:14
@woodpecker-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build_pr_images If set, the CI will build images for this PR and push to Dockerhub ui frontend related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants