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

Feature/fds navigation mobile version #40

Merged
merged 31 commits into from
Dec 8, 2023

Conversation

Joonas-M-S
Copy link
Collaborator

Elikkäs pyrin olemaan rikkomatta mitään. Nyt tuo navigaatio menee navigaationapin taakse, kun ruudun koko on tarpeeksi pieni. Lisäsin myös tuommoisen mobileOrder propertyn, jonka avulla navigaation itemejä voi järjestellä haluamaansa järjestykseen mobiilinäkymässä. Tämä sen takia, että näyttäisi Fintrafficin projekteissa olevan sellainen tapa, että hakukenttä on sijoitettu navigaation oikeaan nurkkaan desktopilla, mutta mobiililla se on listan ensimmäisenä.

src/fds-navigation.ts Outdated Show resolved Hide resolved
src/fds-navigation.ts Outdated Show resolved Hide resolved
src/fds-navigation.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@ninopenttinen ninopenttinen left a comment

Choose a reason for hiding this comment

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

Lähinnä tohon style guideen ja muihin käytäntöihin liittyviä muutos toiveita. Päivitä myös tämä uusi mobileWidth property tonne storybookkiin!

Pyysin tähän myös Roopelta katselmointia kun hän on enemmän lähiaikoina tehnyt Litin kanssa hommia ja osannee arvioida näitä ratkaisuja sikäli paremmin.

Huomiona myös, että pidetään jatkossa PR:t englanniksi, kun meillä on nyt suomea puhumattomia kehittäjiä myös mukana.

src/fds-navigation.ts Outdated Show resolved Hide resolved
src/fds-navigation.ts Outdated Show resolved Hide resolved
src/fds-navigation.ts Outdated Show resolved Hide resolved
src/fds-navigation.ts Outdated Show resolved Hide resolved
src/fds-navigation.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@rooperl rooperl left a comment

Choose a reason for hiding this comment

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

Tuosta primary-tyyppisessä navigaatiopalkista puuttunee jokin margin/padding jostain. Storybookista näkee, että oikeanpuoleisin nav-item (Settings) on kiinni navigaatiopalkin reunassa. Vertailukohtana voi käyttää tätä: https://fintraffic-design.github.io/coreui-components/?path=/docs/navigation--docs

@Joonas-M-S
Copy link
Collaborator Author

Tuosta primary-tyyppisessä navigaatiopalkista puuttunee jokin margin/padding jostain. Storybookista näkee, että oikeanpuoleisin nav-item (Settings) on kiinni navigaatiopalkin reunassa. Vertailukohtana voi käyttää tätä: https://fintraffic-design.github.io/coreui-components/?path=/docs/navigation--docs

Totta! Hyvin hoksattu. Pitääpä käydä lisäämässä.

En ole ennen tuota Storybookkia käyttänytkään missään muussa projektissa, niin pitä vähän siihen tutustua kans tässä.

…navigation height to desktop view so that the navigation renders correctly on different browsers. Add 'mobile-width' to storybook.
src/fds-navigation.ts Outdated Show resolved Hide resolved
@rooperl
Copy link
Collaborator

rooperl commented Sep 15, 2023

Tuli vielä mieleen, että meidän käytössä tuo navigaatiopalkki on leveydeltään pienempi kuin tuo 768px, vaikka kyseessä on desktop-selaimessa käytettävä sovellus. Eli jos ei halua tuota kollapsointia niin onko oikea tapa antaa mobile-width-propertylle jokin iso arvo?

@Joonas-M-S
Copy link
Collaborator Author

Tuli vielä mieleen, että meidän käytössä tuo navigaatiopalkki on leveydeltään pienempi kuin tuo 768px, vaikka kyseessä on desktop-selaimessa käytettävä sovellus. Eli jos ei halua tuota kollapsointia niin onko oikea tapa antaa mobile-width-propertylle jokin iso arvo?

Juu eli, jos haluaa, että kollapsointi tapahtuu vaikkapa 1000px kohdalla, niin siitten näin:

<fds-navigation mobile-width=1000>

Tosiaan, myöhemmin javascriptillä tuon propertyn muuttaminen ei vaikuta mitään.

@Haprog
Copy link
Contributor

Haprog commented Nov 16, 2023

Hey, I'm new in the project but will be working on this actively for now. I'd just want to know what is the state of this PR so we can get this moving?

Seems like Roope already approved this but Nino's previous request for changes is still active/blocking.

If this is ready for merge, we can just dismiss Nino's review (or he can add approval) so we can get this merged.

@ninopenttinen are we ready to merge here or do you still want some changes here first?

@ninopenttinen
Copy link
Collaborator

@Haprog

Hey, I'm new in the project but will be working on this actively for now. I'd just want to know what is the state of this PR so we can get this moving?

Seems like Roope already approved this but Nino's previous request for changes is still active/blocking.

If this is ready for merge, we can just dismiss Nino's review (or he can add approval) so we can get this merged.

@ninopenttinen are we ready to merge here or do you still want some changes here first?

Personally I would like to take the use case that Sabina mentioned into consideration on the component API, by renaming the mobile related properties into something more generic. Would be preferable to do this now, since changing the API afterwards will cause projects that use it to break.

Also I want to note that I don't really have any authority over this repo, so this is just my suggestion, not a demand, you may dismiss my review if you disagree with it.

@solita-sabinaf
Copy link
Collaborator

solita-sabinaf commented Nov 16, 2023

By the way, about the use case I mentioned, it's actually quite a different feature that I don't see it intersecting with this PR anymore. I was meaning having drop downs per menu item like this:

Screenshot 2023-11-16 at 13 38 05

This had been implemented for our project's needs and haven't been published in PR

@ninopenttinen
Copy link
Collaborator

Thanks for clarification, I still do think though, that using "mobile" in the properties is a bit misleading, as it is not a mobile only feature, but rather a responsiveness thingy. However I'm fine with either.

@solita-sabinaf
Copy link
Collaborator

Yup, I agree, that "mobile"-looking layout can still be useful for non-mobile scenarios as well

@ninopenttinen
Copy link
Collaborator

If we want to this to be a "mobile only" feature, then I think rather than using a pixel threshold for changing the navbar, I would just add a boolean property that decides if we should render this component in "mobile" or "desktop" mode.

@ninopenttinen
Copy link
Collaborator

ninopenttinen commented Nov 16, 2023

Although if we were to go with that (separate mobile/desktop modes) I would then rather have entirely different components for those to keep the code cleaner.

@Haprog
Copy link
Contributor

Haprog commented Nov 16, 2023

Thanks for the quick replies. I'll need to familiarize myself with this component code and API to have a more informed opinion on the changes. Sounds like naming could be improved.

Generally for component responsiveness and toggling between display modes based on available space I'd prefer container queries (if CSS is enough) or JS (e.g. ResizeObserver) if needed, preferring to make it automatic without need for manually toggling modes by user (app developer). Breakpoint may be configurable if necessary but it would be better if mode can be automatically deduced based on container and content size.

Also I want to note that I don't really have any authority over this repo, so this is just my suggestion, not a demand, you may dismiss my review if you disagree with it.

I don't assume any authority either (at least so far). Just going to try my best to make things better. This should be a productive collaboration between interested/related parties. 🙂

@Joonas-M-S
Copy link
Collaborator Author

Hi, sorry for not getting back to this earlier. So there are two changes that need to be made

  • mobile -> verticalMenuThreshold
  • change media query to container one
    I'll try to make those changes today

@Haprog
Copy link
Contributor

Haprog commented Nov 27, 2023

The filenames and structure changed a bit in main since #59 was merged. I can help merge the changes into this branch.

@Joonas-M-S Joonas-M-S dismissed ninopenttinen’s stale review November 28, 2023 09:21

Nuo muutokset on tehty, mutta tämä "change requested" tässä vielä jostain syystä roikkuu.

@Joonas-M-S Joonas-M-S requested a review from Haprog November 28, 2023 09:21
Copy link
Contributor

@Haprog Haprog left a comment

Choose a reason for hiding this comment

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

Found couple of minor things but otherwise looks good to me.

src/navigation.ts Outdated Show resolved Hide resolved
src/stories/fds-navigation.stories.ts Outdated Show resolved Hide resolved
@Joonas-M-S Joonas-M-S requested a review from Haprog December 8, 2023 11:21
@Haprog Haprog removed the request for review from solita-markuspulkkinen December 8, 2023 11:25
@Haprog
Copy link
Contributor

Haprog commented Dec 8, 2023

@ninopenttinen if this looks ok to you now, let's squash and merge this.

Copy link
Collaborator

@ninopenttinen ninopenttinen left a comment

Choose a reason for hiding this comment

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

👌

@Haprog Haprog merged commit 7fe6dea into main Dec 8, 2023
1 check passed
@Haprog Haprog deleted the feature/fds-navigation-mobile-version branch December 8, 2023 13:51
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 this pull request may close these issues.

5 participants