-
-
Notifications
You must be signed in to change notification settings - Fork 470
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/2014 Random surah ayah picker #2019
base: master
Are you sure you want to change the base?
Feature/2014 Random surah ayah picker #2019
Conversation
This will be used for the surah randomizer, the reason why recentReadingSessions wasn't used instead was for backwards compatibility
This is to make it more decoupled from the data and make things more testing-friendly. Also moved Qur'an chapters count constant to `utils/chapters.ts`
@MFauzanAP is attempting to deploy a commit to the Quran Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
As salaam alaykum. Would it be worthwhile to add a "Next Random" button in the However, it would mean refactoring some of the current state to keep track of which choice was last picked by the user. Please let me know your thoughts and/or if you have a better solution. |
Summary
Bismillah Al-Rahman Al-Rahim,
As salaam alaykum all.
I apologise in advance for any inconveniences or if this is not the ideal way of creating PRs, I don't contribute to open source projects very often.
With that being said, This PR aims to add a new feature where the site pick any surah or ayah for the user, including picking from a custom list.
I tried my best to maintain the current code style and design theme, add comments, and reuse existing components whenever I could. However, feel free to let me know if there could be some improvements in this department.
Closes #2014
Full Changes
Features
/random
pagerandom.ts
utility fileRefactors
surahLogs
andcustomSelection
keys to thereadingTracker
redux slicesurahLogs
is similar to the currently-usedrecentReadingSessions
with the difference being it stores the furthest ayat a user has reached instead of where they last left offcustomSelection
is used to specify which surahs/ayats the user wants to include in the randomizer if it does not exist, it falls back tosurah logs
recentReadingSessions
was kept intact to maintain stability and backwards-compatibilityNew Translation Keys
common.json
random
pick-random
any-surah
any-ayah
selected-surah
edit
quick-links.json
pick-random
random.json
all
desc
load-previous
reset-changes
save-randomize
search
selected
title
Test Plan
Below are the scenarios I tested for:
The new
random.ts
utility file has also been tested with 100% coverage usingrandom.test.ts
.Future Work
As discussed in the original issue, this feature can be improved in the following ways:
/random
, in particular quick-selecting multiple surahs at onceScreenshots