-
Notifications
You must be signed in to change notification settings - Fork 323
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
Left to right prerequisites trees #3840
Left to right prerequisites trees #3840
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@zehata is attempting to deploy a commit to the modsbot's projects Team on Vercel. A member of the Team first needs to authorize it. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3840 +/- ##
==========================================
+ Coverage 53.87% 54.66% +0.78%
==========================================
Files 274 274
Lines 6032 6072 +40
Branches 1449 1455 +6
==========================================
+ Hits 3250 3319 +69
+ Misses 2782 2753 -29 ☔ View full report in Codecov by Sentry. |
Fixes #3202 |
I wanted to refactor the style class names to use |
Re: https://github.com/nusmodifications/nusmods/pull/3840/files#diff-c16227ad8088f0a3a8edf1ae53344bb0189198cb956157ec0a9083cf3e7069f9L106-L112
so https://github.com/nusmodifications/nusmods/pull/3840/files#diff-c16227ad8088f0a3a8edf1ae53344bb0189198cb956157ec0a9083cf3e7069f9R121 omits
|
getModuleCondensed={props.getModuleCondensed} | ||
/> | ||
<div className={classnames(styles.node, styles.conditional)}>{formatConditional(node)}</div> |
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.
[styles.prereqNode]: isPrereq
is intentionally omitted
See: #3840 (comment)
Update: I have a working copy of a version with a toggle in settings, but I am still refactoring. See preview at temporary branch https://github.com/zehata/nusmods/tree/zehata/website-module-page/3202/toggleable-left-to-right-prerequisites-trees-wip |
I think to allow this feature to have a toggle switch setting in future, it would be good to also have a boolean parameter to switch back to right-to-left. |
eb83ee0
to
c70c538
Compare
Rebased onto 0f33a55 |
Toggleable implementation extending this PR is at #3842. Please note that the branch in that PR diverges from this branch and cannot both be merged. |
Since we've already merged #3842, this shouldn't be needed anymore. |
Context
Fixes #3202 Prerequisite tree right-to-left progression is confusing
Implementation
I referenced the previous 2 PRs #3263 and #3291 to see what was good and why they were not merged.
Having noted #3263 (comment), the implementation was changed to modify the DOM instead of using
flex-direction: row-reverse;
I fully copied @sciffany's copywriting since they are indeed easier to understand, so all credits to her.Having noted the test cases used by @alvynben in PR #3291, I elected to use those cases (though with different modules).
I also noted that the last correspondence for both PRs were in 2021, so I believe opening a new PR should be appropriate.
Options in user settings?
I noted that Issue #3202 specifically asked for left-to-right prerequisites trees, so this PR only targets that specification. However, I would favour closing #3202 and creating a new issue for the same but with an option in the settings that allow users to choose their preference. Having gotten used to the old prerequisites trees, users like myself might choose to stick to that. However, I also note that a left-to-right prerequisites tree is definitely more intuitive so it should not be counted out as well.
UI tests
For a single mod, with no prerequisite or dependant:
![image](https://private-user-images.githubusercontent.com/16816749/378531956-4dbbb9b8-064a-4f59-83fe-bd13272dc920.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NjE5NTgsIm5iZiI6MTczOTg2MTY1OCwicGF0aCI6Ii8xNjgxNjc0OS8zNzg1MzE5NTYtNGRiYmI5YjgtMDY0YS00ZjU5LTgzZmUtYmQxMzI3MmRjOTIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA2NTQxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjMWVkMWYxM2QyN2NlOWM4YWI0MjljMzhhNDk5NjIxMGQ0OTM1ZmQ3NGRlMGNiNTFjNGM0OWY0ZDBjYzhhOWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.V23mUefZQerppwEfUwnC2LPYxcTxfZ6DN6WGLBNt0H0)
![image](https://private-user-images.githubusercontent.com/16816749/378532028-ab7ea32e-23be-49e2-8546-a2689242019c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NjE5NTgsIm5iZiI6MTczOTg2MTY1OCwicGF0aCI6Ii8xNjgxNjc0OS8zNzg1MzIwMjgtYWI3ZWEzMmUtMjNiZS00OWUyLTg1NDYtYTI2ODkyNDIwMTljLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA2NTQxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3ZGIxNTIyYWNmMTdiOTM0YTQxMGI5MDBiYWYzYmZjZmNkYTdjMTBiMTg1NmIwNTM1ODdiZTIwN2I1Y2ZiYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5Eqp9x_pACSGiZsr6i5vuQ1YdwbWi1SS52U9c3x3Jck)
![image](https://private-user-images.githubusercontent.com/16816749/378532147-8cf9e6a3-9b34-4763-883a-f1b32c74c6c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NjE5NTgsIm5iZiI6MTczOTg2MTY1OCwicGF0aCI6Ii8xNjgxN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jNzYxMzJkYWYxZmUzMWM0YmVhMWZiMzYzOGY5ZjA4YjQ2OTM1ZjViOTM1MTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1Lr3nBBrQmWjnEOX7A3vlft-6XFZmF7cVDGuSkUax2M)
![image](https://private-user-images.githubusercontent.com/16816749/378532368-77c182d7-7410-4868-b275-a9a3156d9c9f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NjE5NTgsIm5iZiI6MTczOTg2MTY1OCwicGF0aCI6Ii8xNjgxNjc0OS8zNzg1MzIzNjgtNzdjMTgyZDctNzQxMC00ODY4LWIyNzUtYTlhMzE1NmQ5YzlmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA2NTQxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4YTU0NzViYzkwMTVlZGIyYmVkMjk0YmZkYmQ1ZDU5NzdhNjY4NjE4ZWI3OTBjY2NhNWRkOTY0ZGJhYTJjM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._Tr4ktS0KCsswklB-6WNnlFBmyggvpoUIyZV6bhZiVs)
![image](https://private-user-images.githubusercontent.com/16816749/378533767-48cf0edc-f19f-4ff4-8ba4-fa0492682e8a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NjE5NTgsIm5iZiI6MTczOTg2MTY1OCwicGF0aCI6Ii8xNjgxNjc0OS8zNzg1MzM3NjctNDhjZjBlZGMtZjE5Zi00ZmY0LThiYTQtZmEwNDkyNjgyZThhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA2NTQxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIzZDdiOTQ3ODMzMzcyMDI0Yzc4MTk3MWRmNzMxMTllYWVlYWQzZTk5NDY5NjZiYmU3OTgzNzQzZTlkODcwZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1oXAEQRLx8hP67YsBdDY4_YMJv_NXJZRKpUj3nIZjBg)
For mods with only dependants:
For mods with one layer of prerequisites and dependants, also for mods with
requireNum
modules:For mods with two layers of prerequisites:
For mods with uneven layers of prerequisites:
Highly complex prerequisites, prerequisites with uneven number of letters:
Other Information
Any questions you may have
Is there a tele group specific for development?
Letting us know that you're new to this (so we know how much to help out)
Been almost 3 years since I touched any web dev. Sorry in advance if I had missed out anything.