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

✨(react) Datepicker position #133

Merged
merged 5 commits into from
Aug 21, 2023
Merged

Conversation

AntoLC
Copy link
Contributor

@AntoLC AntoLC commented Aug 3, 2023

Purpose

We have a problem on marsha and LTI with the datepicker not accessible (see conversation).

The goal is to change the position of the datepicker depend of the place available in the screen.

Proposal

  • 🔧(packages) make scripts cross platform friendly (fix problem with windows)
  • 🔧(react) adapt script and config to use the watch mode of vite
  • 🚨(packages) fix eslint tsconfig root dir
  • ✨(react) datepicker position

If not enough place on the bottom and enough place on the top, we place it to the top, otherwise to the bottom.

Vite.+.React.+.TS.webm

Review

@AntoLC AntoLC added feature request New feature or request improvement labels Aug 3, 2023
@AntoLC AntoLC self-assigned this Aug 3, 2023
@changeset-bot
Copy link

changeset-bot bot commented Aug 3, 2023

🦋 Changeset detected

Latest commit: 419d61e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@openfun/cunningham-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@AntoLC AntoLC force-pushed the feature/anthony/datepicker-position branch 6 times, most recently from 22f0a73 to 8396d68 Compare August 3, 2023 13:38
@AntoLC AntoLC marked this pull request as ready for review August 3, 2023 13:46
packages/react/package.json Outdated Show resolved Hide resolved
packages/react/.eslintrc.cjs Outdated Show resolved Hide resolved
packages/tokens/.eslintrc.cjs Outdated Show resolved Hide resolved
.changeset/wet-keys-occur.md Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.tsx Outdated Show resolved Hide resolved
@AntoLC AntoLC force-pushed the feature/anthony/datepicker-position branch 4 times, most recently from 38f9330 to 35240d7 Compare August 9, 2023 08:54
@AntoLC AntoLC requested a review from jbpenrath August 9, 2023 09:02
@AntoLC AntoLC force-pushed the feature/anthony/datepicker-position branch 2 times, most recently from f773486 to 669d8ab Compare August 11, 2023 08:02
packages/tokens/tsconfig.eslint.json Outdated Show resolved Hide resolved
packages/react/tsconfig.eslint.json Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.tsx Outdated Show resolved Hide resolved
@AntoLC AntoLC force-pushed the feature/anthony/datepicker-position branch from 669d8ab to 4d65cfd Compare August 11, 2023 13:55
@AntoLC AntoLC requested a review from jbpenrath August 11, 2023 14:07
Some scripts had errors when running on windows.
We now use some cross platform cli tools to be
able to run the scripts on every platform.
If we work from an app perspective, it is nice to have a watch mode
on our packages to see the changes in real time. Better to use the
watch mode of vite (rollup) compare to nodemon because it is faster,
we re-transpile only the files that have changed.
Possility to use the wath mode by polling as well, on a remote machine
the HMR does not work well, the polling mode helps to solve this issue.
Eslint extension highlighted some issues with the way we were
importing the tsconfig.json file in the .eslintrc.json file.
By changing the extension to .cjs, we are now able to set
tsconfigRootDir to the root of the package thanks to `dirname`.
It helps eslint to find the correct tsconfig.json file.
@jbpenrath jbpenrath force-pushed the feature/anthony/datepicker-position branch from 931b8c6 to 757cfb6 Compare August 16, 2023 17:29
Prettier had some missing extensions in the config, this commit
added them, we then prettified the whole project. We
ignore the `cunningham-tokens` files.
@jbpenrath jbpenrath force-pushed the feature/anthony/datepicker-position branch 2 times, most recently from 08b7d9d to 1a6db4e Compare August 16, 2023 17:53
Copy link
Collaborator

@lebaudantoine lebaudantoine left a comment

Choose a reason for hiding this comment

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

A few nit-picking remarks 🌟 and a conversation about the refined UX 👀

Are the following behaviors expected? Let's discuss it; there might be an issue within the code. The popover position should update upon scrolling and close when necessary. WDYT?

Enregistrement.de.l.ecran.2023-08-17.a.22.08.46.mov
Enregistrement.de.l.ecran.2023-08-17.a.22.08.03.mov

In general, @jbpenrath, should we establish a standardized branching model for the project? I had it on my to-do list to initiate a conversation regarding this in the Tech channel. I'm more than willing to take that step.

.changeset/wet-keys-occur.md Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@lebaudantoine lebaudantoine left a comment

Choose a reason for hiding this comment

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

LGTM 🤗

Position the datepicker on top of the input when the input is
at the bottom of the screen and whenthere is enough space to display
the datepicker on the top.
@jbpenrath jbpenrath force-pushed the feature/anthony/datepicker-position branch from ce80a59 to 419d61e Compare August 21, 2023 10:00
@jbpenrath jbpenrath merged commit 9edb976 into main Aug 21, 2023
@lebaudantoine lebaudantoine mentioned this pull request Sep 11, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants