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

Override constrainToScroll prop default value to false #586

Merged
merged 32 commits into from
Mar 22, 2024

Conversation

kafukoM
Copy link
Contributor

@kafukoM kafukoM commented Mar 21, 2024

Description

Options dropdown will open downwards as expected.

Issue addressed

Options dropdown opens upwards regardless of available space below.

Addresses #432

Before/after screenshots

BEFORE
before

AFTER
Screenshot (16)

Changelog

  • #586
    • Description: Adjust KDropdownMenu to open downwards when there's sufficient space, improving user experience and interface consistency.
    • Products impact: Bugfix
    • Addresses: #432
    • Components: KDropdownMenu.vue
    • Breaking: no
    • Impacts a11y: no
    • Guidance: This update ensures the KDropdownMenu component behaves more predictably in various layouts, enhancing UI consistency across applications. No action is needed from consumers aside from updating to the latest version to benefit from this improvement.

Steps to test

  1. Go to Facility
  2. Click Settings
  3. Scroll down and create PIN if non-existent
  4. Click Options button

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical and brittle code paths are covered by unit tests
  • The change is described in the changelog section above

After review

  • The changelog item has been pasted to the CHANGELOG.md

@kafukoM
Copy link
Contributor Author

kafukoM commented Mar 21, 2024

@MisRob Hello. Kindly requesting for your review.

@MisRob MisRob requested a review from akolson March 21, 2024 07:33
@MisRob MisRob added the TODO: needs review Waiting for review label Mar 21, 2024
Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Hi @kafukoM! Generally, changes look good to me. Just a minor change and we should be good. Thanks

// Override default prop value
constrainToScrollParent: {
type: Boolean,
default: false
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, I think this needs to default to true as is with Keen UI. We can then override the default if we need to by passing false. This will also ensure that we are backward compatible too.

Copy link
Member

Choose a reason for hiding this comment

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

There are also, 1 or 2 linting issues to take care of. You can fix any linting issues by running yarn run lint-fix before adding and committing your changes

Copy link
Member

Choose a reason for hiding this comment

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

For changelog build failures, please copy the changelog below(I made a few changes to your changelog from the pr) and add it to the CHANGELOG.md just below the ## Version 3.x.x (release-v3 branch) section as the latest entry, since your fix is targeting release-v3

- [#586]
  - **Description:** Adds a new prop `constrainToScrollParent ` to `KDropdownMenu` to allow overriding of its popover flipping behavior.
  - **Products impact:** Bugfix
  - **Addresses:** [#432](https://github.com/learningequality/kolibri-design-system/issues/432)
  - **Components:** KDropdownMenu
  - **Breaking:** no
  - **Impacts a11y:**  no
  - **Guidance:** Use the `constrainToScrollParent` prop to override the default popover flipping behavior of the `KDropdownMenu` component prop where necessary.

[#586]: https://github.com/learningequality/kolibri-design-system/pull/586

Copy link
Member

Choose a reason for hiding this comment

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

Please be sure to let me know in case you need any support in the process. Thanks again

@@ -34,6 +35,11 @@
UiMenu,
},
props: {
// Override default prop value
Copy link
Member

@akolson akolson Mar 21, 2024

Choose a reason for hiding this comment

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

Can we replace this comment with documentation instead

/**
 * The dropdown menu popover flips its position to avoid overflows within the parent. Setting it to false disables the flipping behavior.
 */

@MisRob, happy to hear your thoughts if this developer friendly language :)

Copy link
Member

Choose a reason for hiding this comment

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

That'd be helpful documentation definitely, thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback @akolson. I have made the requested changes in the latest commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this mean I have to submit another PR showcasing the override for the template in Kolibiri rendering the KDropdownMenu component?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think we could start by overriding the value in Kolibri: Facility Settings, where the bug was initially caught. Please see #432 for specifics. You can test your KDS changes locally in kolibri by running

yarn run devserver-with-kds /path/to/your/local/kolibri-design-system

The rest of the overrides will be done as and when its needed.

yarn.lock Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want to be changing yarn.lock as part of this task. Could you please revert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MisRob I have reverted the commit, leaving out the yarn.lock changes

Copy link
Member

Choose a reason for hiding this comment

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

@kafukoM I think this change on yarn.lock is still present

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akolson @MisRob The new commit should have reverted the changes on the yarn.lock file

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @kafukoM, although It looks like we picked up some conflicts in the process.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like you are not having some changelog entries. All the below should be present in your version of the changelog

- [#586]
  - **Description:** Adds a new prop `constrainToScrollParent ` to `KDropdownMenu` to allow overriding of its popover flipping behavior.
  - **Products impact:** Bugfix
  - **Addresses:** [#432](https://github.com/learningequality/kolibri-design-system/issues/432)
  - **Components:** KDropdownMenu
  - **Breaking:** no
  - **Impacts a11y:**  no
  - **Guidance:** Use the `constrainToScrollParent` prop to override the default popover flipping behavior of the `KDropdownMenu` component prop where necessary.

[#586]: https://github.com/learningequality/kolibri-design-system/pull/586

- [#552]
  - **Description:** New `KListWithOverflow` component.
  - **Products impact:** new API.
  - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/556, https://github.com/learningequality/studio/issues/3423, https://github.com/learningequality/kolibri/issues/11923.
  - **Components:** KListWithOverflow.
  - **Breaking:** no.
  - **Impacts a11y:** no.
  - **Guidance:** -.

[#552]: https://github.com/learningequality/kolibri-design-system/pull/552

- [#552]
  - **Description:** New `useKResponsiveElement` private composable, `KResponsiveElementMixin` translated to this composable.
  - **Products impact:** -.
  - **Addresses:** -.
  - **Components:** -.
  - **Breaking:** no.
  - **Impacts a11y:** no.
  - **Guidance:** -.

[#552]: https://github.com/learningequality/kolibri-design-system/pull/552

- [#538]
  - **Description:** Complete KImg implementation
  - **Products impact:** new API
  - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/368
  - **Components:** KImg
  - **Breaking:** no
  - **Impacts a11y:** yes
  - **Guidance:** One of the benefits of using KImg is that it throws a11y related warnings

[#538]: https://github.com/learningequality/kolibri-design-system/pull/538

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akolson I have updated my changelog file with the latest commit

Copy link
Member

@akolson akolson Mar 22, 2024

Choose a reason for hiding this comment

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

@kafukoM, the above was only intended as a guide for you when resolving the conflict locally, my apologies for any confusion. Could you please revert your most recent commit and do the following?

  1. git rebase release-v3 or git merge release-v3. This will bring in any changes you don't have
  2. Resolve the conflicts,
  3. commit the changes
  4. Finally, push

Another more straightforward option would be to undo all changes made in the changelog, then rebase or merge release-v3 into your branch after which you can add the changelog here again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akolson I think my latest commit should have resolved the conflict

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @kafukoM. please see my other comment here

@akolson
Copy link
Member

akolson commented Mar 22, 2024

image
🙂

@akolson
Copy link
Member

akolson commented Mar 22, 2024

@MisRob I am happy for this to be merged, if everything is okay on your side :)

Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Looks good to me! Great job @kafukoM!

@MisRob
Copy link
Member

MisRob commented Mar 22, 2024

@MisRob I am happy for this to be merged, if everything is okay on your side :)

Sure @akolson, you know more than me about this issue :) Thank you.

@akolson
Copy link
Member

akolson commented Mar 22, 2024

I'll proceed with the merge.

@MisRob
Copy link
Member

MisRob commented Mar 22, 2024

Okay. Do we need Kolibri follow up issue for this to take effect to be able close this #432 or will the new default value resolve it automatically?

@akolson
Copy link
Member

akolson commented Mar 22, 2024

We need a follow up pr. @kafukoM has already opened one here. Once we have the KDS NPM package ready, we should be good for the merge for it.

@akolson akolson merged commit 045fa85 into learningequality:release-v3 Mar 22, 2024
8 checks passed
@MisRob
Copy link
Member

MisRob commented Mar 22, 2024

Ah I see, perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants