-
Notifications
You must be signed in to change notification settings - Fork 86
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
Implement k responsive window composable #377
Implement k responsive window composable #377
Conversation
Hi @jtamiace, I am tagging you here so you could have a look at the documentation. Would appreciate your feedback on this. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, but this looks awesome!
lib/useKResponsiveWindow.js
Outdated
`(max-width: ${1440 - SCROLL_BAR}px)`, | ||
`(max-width: ${1600 - SCROLL_BAR}px)`, | ||
`(min-width: 1601px)`, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above 2 variables don't seem to change during calls to useKResponsiveWindow
or widthQueries
, so they could be moved further up in scope. Although I don't think it's a big deal.
@akolson the layout and format of the documentation additions look good to me! Would there be any value to engineers in making a short statement about which scenarios composable is preferable over mixin and vice versa? (I'm not an engineer, so if this is N/A or not helpful, please disregard) |
@jtamiace you raise a valid question. More generally, composables are recommended. I will add a section to capture these thoughts. Thanks |
…ortcomings in vue2
@bjester @rtibbles & @nucleogenesis, based on Friday feedback, some files were moved around, so incase you need to follow along based on old review, this link captures the previous code including your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave the code a look and this looks great. I haven't tested it in Kolibri yet but will do so tomorrow and will give the docs a closer look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great! The only blocker, and requested change, is that I think there's likely an issue with useKWindowDimensions
-- please see my comment on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With QA before me, Blaine & Richard's thoughts in mind; I've looked through the latest additions in the test suits and they're excellent - this should be good to merge!
commit f85ddfb Merge: 29122c4 9d29fe1 Author: akolson <[email protected]> Date: Thu Nov 3 22:42:28 2022 +0300 Merge pull request learningequality#380 from akolson/standardize-kradiobutton-labels Wraps KRadioButton label text commit 9d29fe1 Author: Samson Akol <[email protected]> Date: Wed Oct 26 23:34:47 2022 +0300 updates changelog commit ba2006c Author: Samson Akol <[email protected]> Date: Wed Oct 26 22:23:03 2022 +0300 updates documentation commit f083b25 Author: Samson Akol <[email protected]> Date: Wed Oct 26 22:04:02 2022 +0300 aligns kradiobutton api with kcheckbox's. Changes label from truncate to wrap. Adds truncateLabel prop to truncate text if necessary. updates documenation to reflect changes commit 29122c4 Merge: 115a19d 84ef450 Author: akolson <[email protected]> Date: Tue Oct 18 20:48:16 2022 +0300 Merge pull request learningequality#377 from akolson/implement-kResponsiveWindow-composable Implement k responsive window composable commit 84ef450 Author: Samson Akol <[email protected]> Date: Mon Oct 17 10:51:27 2022 +0300 Adds more review feedback commit 94abe9e Author: Samson Akol <[email protected]> Date: Fri Oct 14 19:16:35 2022 +0300 Improves test descriptions commit 6dc1d50 Author: Samson Akol <[email protected]> Date: Fri Oct 14 18:18:08 2022 +0300 Adds tests to useKWindowDimensions and useKResponsiveWindow commit 51d80a3 Author: Samson Akol <[email protected]> Date: Thu Oct 13 13:25:31 2022 +0300 minor string refactors commit 794ac2a Author: Samson Akol <[email protected]> Date: Thu Oct 13 12:55:00 2022 +0300 Fixes responsiveness bug on IE commit 445c740 Author: Samson Akol <[email protected]> Date: Wed Oct 12 23:01:34 2022 +0300 Adds feedback from review commit 68266f0 Author: Samson Akol <[email protected]> Date: Wed Oct 12 18:53:17 2022 +0300 Improves jsdoc, fixes IE issue commit b16c125 Author: Samson Akol <[email protected]> Date: Mon Oct 10 17:34:57 2022 +0300 Adds use composition-api to composable due to @vue/composition-api shortcomings in vue2 commit 4075c57 Author: Samson Akol <[email protected]> Date: Mon Oct 10 13:30:48 2022 +0300 Updates kresponsivewindow documentation commit 5940c76 Author: Samson Akol <[email protected]> Date: Mon Oct 10 12:38:45 2022 +0300 Adds feedback from code review commit b0fc205 Author: Samson Akol <[email protected]> Date: Thu Oct 6 18:27:24 2022 +0300 Updates changelog commit e504a70 Author: Samson Akol <[email protected]> Date: Thu Oct 6 15:52:29 2022 +0300 Code refactor commit 76c13a8 Author: Samson Akol <[email protected]> Date: Thu Oct 6 15:12:43 2022 +0300 Moves composition api initialization to useKResponsiveWindow commit 9dd5975 Author: Samson Akol <[email protected]> Date: Wed Oct 5 17:52:57 2022 +0300 Updates indentation commit 078c000 Author: Samson Akol <[email protected]> Date: Wed Oct 5 16:34:14 2022 +0300 uses anonymous function in documentation due to failures in character escaping commit ad681dd Author: Samson Akol <[email protected]> Date: Wed Oct 5 15:41:46 2022 +0300 Configures composition api, and documents the useKResponsiveWindow commit 2d1351e Author: Samson Akol <[email protected]> Date: Tue Oct 4 17:45:50 2022 +0300 Refactors code, adds documentation commit 8fe1519 Author: Samson Akol <[email protected]> Date: Mon Oct 3 18:59:22 2022 +0300 fixes bug in breakpoint media query listener commit f6afdf6 Author: Samson Akol <[email protected]> Date: Mon Oct 3 18:56:47 2022 +0300 Renames responsive window compodable to recommended composable file names commit c4278c2 Author: Samson Akol <[email protected]> Date: Fri Sep 30 23:15:15 2022 +0300 updates composable name commit fca8437 Author: Samson Akol <[email protected]> Date: Fri Sep 30 15:57:07 2022 +0300 Fixes bugs in composable commit e43b5a0 Author: Samson Akol <[email protected]> Date: Thu Sep 29 19:45:59 2022 +0300 Port of KResponsiveWindowMixin to KResponsiveWindow composable
Description
This pr ports the
KResponsiveWindowMixin
touseKResponsiveWindow
composable. Logic has also been refactored to use theWindow.matchMedia
interfaceIssue addressed
Closes #288
Before/after screenshots
KResponsiveWindow
documentationSteps to test
KResponsiveWindow
for usage and examples(optional) Implementation notes
At a high level, how did you implement this?
useKResponsiveWindow uses
Window.matchMedia()
to create reactive window properties including width, height, orientation etcDoes this introduce any tech-debt items?
Testing checklist
changelog
Reviewer guidance
Post-merge updates and tracking
Comments