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

feat(frontend): improve open tables drawer design #1404

Merged
merged 16 commits into from
Jul 23, 2024
Merged

Conversation

Bettelstab
Copy link
Contributor

@Bettelstab Bettelstab commented Jul 11, 2024

🍰 Pullrequest

Styles the open tables drawer according to Figma. Also adds messages in case of no open tables or no search results.

Screenshot 2024-07-19 at 16 13 28 Screenshot 2024-07-19 at 16 14 01 Screenshot 2024-07-19 at 16 14 52 Screenshot 2024-07-19 at 16 19 43

Also fixes these warnings:
Uploading Screenshot 2024-07-19 at 17.07.44.png…

Issues

Todo

@Bettelstab Bettelstab marked this pull request as ready for review July 19, 2024 14:08
Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

so and so

I will request changes for the screenshot below:
image

frontend/src/components/menu/TopMenu.vue Outdated Show resolved Hide resolved
@@ -61,6 +65,6 @@ const toggleDrawer = () => {
.top-menu {
position: sticky;
top: 0;
z-index: 1000;
z-index: 1008;
Copy link
Contributor

Choose a reason for hiding this comment

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

There must be a problem if it is necessary to change z-index values like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. Just had a quick look at https://www.smashingmagazine.com/2021/02/css-z-index-large-projects and the idea makes sense to me. We are dealing with Vuetify values here, I'll check if there is any way to get those values.

Copy link
Contributor Author

@Bettelstab Bettelstab Jul 22, 2024

Choose a reason for hiding this comment

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

I simplified the structure and got rid of that specific z-index entirely. Was like that before because of requirements which changed.


<nav
class="v-navigation-drawer v-navigation-drawer--bottom v-navigation-drawer--temporary v-theme--light v-navigation-drawer--mobile menu-drawer px-4 d-md-none"
data-v-cf2c9067=""
Copy link
Contributor

Choose a reason for hiding this comment

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

What is data-v-cf2c9067?

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 what makes scoped CSS work. The tag is afaik generated from the file name or path.

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦 I was reviewing generated code. Of course, this is how it works with scoped CSS.

<nav
class="v-navigation-drawer v-navigation-drawer--bottom v-navigation-drawer--temporary v-theme--light v-navigation-drawer--mobile menu-drawer px-4 d-md-none"
data-v-cf2c9067=""
style="bottom: 0px; z-index: 1004; transform: translateY(110%); position: fixed; transition: none !important; left: 0px; width: calc(100% - 0px - 0px);"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need style attribute here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's generated by Vuetify unfortunately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Again generated code. But what the heck, Vuetify, style attributes, seriously? They have the highest specificity: https://2019.wattenberger.com/blog/css-cascade#specificity

disappointed

data-v-cf2c9067=""
style="right: 0px; z-index: 1004; transform: translateX(110%); position: fixed; transition: none !important; height: calc(100% - 70px - 0px); top: 70px; bottom: 0px;"
style="right: 0px; z-index: 1004; transform: translateX(110%); position: fixed; height: calc(100% - 70px - 0px); top: 70px; bottom: 0px; transition: none !important;"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the order important here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no explanation why it changed...

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for that, if it's generated, I pretty much don't care about the order here.

@@ -872,7 +872,7 @@ exports[`TopMenu > renders 1`] = `

<i
aria-hidden="false"
aria-label="$vuetify.input.clear"
aria-label="Löschen"
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see a $t('tablesDrawer.noTables') further down. So we're already translating the app, why not translate this, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are translating this, of course. Apparently the Vuetify internal dictionary entries are resolved for the snapshots. That's a strange behaviour and could lead to problems in CI. Good catch.
Why does it appear now: I corrected the keys in the locales files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes! It's good that it's translated now 🙂 the problems in unit testing is another story.

Comment on lines +79 to +91
top: 0 !important;
z-index: 1006 !important;
width: 308px;
height: 100% !important;
padding-top: 70px;
background: var(--v-sidebar-background) !important;
}

@media #{map-get($display-breakpoints, 'sm-and-down')} {
.menu-drawer {
left: var(--sides) !important;
z-index: 2000 !important;
width: calc(100% - (2 * var(--sides))) !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

The sheer amount of !importants in this block indicate a specificity problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vuetify components that we need to override :/

Copy link
Contributor

Choose a reason for hiding this comment

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

Vuetify components that we need to override :/

This is exactly the selling point of Tailwind. No more specificity wars. Every component framework that is built on Tailwind is using the same level of specificity. Every template code that we copy+paste will look the same in our application as it does in a sandbox. The nesting template will only pass in CSS that is not specified in the inner template.

Problems solved. Once. And. For. All.

@@ -1,6 +1,6 @@
{
"$vuetify": {
"input:": {
"input": {
"clear": "Löschen"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? It's used in the search field.

</v-list-item>
</v-list>
</v-card>
<ul class="list">
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that we're using plain HTML when possible 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:)

@Bettelstab
Copy link
Contributor Author

Bettelstab commented Jul 22, 2024

@roschaefer
Thank you for the valuable feedback! I'll address some of the issues you mentioned. Your main point: There is the plan to move the Light/Dark switch from where it is to some settings menu, therefore we decided to ignore this problem.

@Bettelstab
Copy link
Contributor Author

@roschaefer
Please have another look :) Guess we should create an issue for the vuetify translation thing

Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

image

We could give the light/dark switch a white outline, just like the other buttons.

I will hit approve here to get things going though.

I'm afraid this won't be the last PR where I will complain about vuetify.

position: sticky;
top: 0;
z-index: 1008;
.hide-on-mobile {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is such a utility class. It shouldn't go into scoped. I think in tailwind it would be invisible md:visible.

Copy link
Contributor Author

@Bettelstab Bettelstab Jul 23, 2024

Choose a reason for hiding this comment

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

Yes, I totally agree and will make it global with a better name the next time I'll use it. No, visibility is something different and takes rendering time. md:hidden would be right, I guess.

@Bettelstab Bettelstab enabled auto-merge (squash) July 23, 2024 18:49
@Bettelstab Bettelstab merged commit d92018a into master Jul 23, 2024
35 checks passed
@mahula mahula deleted the sidebar-style branch July 25, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

🚀 [Feature] Frontend: Optimize openRoom Sidebar Design
2 participants