* wip
* wip frontend
* cleanup
* wip
* refactoring
* wip
* first working version
* wip
* update calendar with new result
* add migration script
* dates are hard
* fix naming inconsistencies
* requested changes on migration
* timezones
* update date-fns, use date-fns/utc
* resolve cyclic dependency by extracting test activity calender into new file
* cleanup
* fix increment
* fix
* tests
* test coverage
* test migration
* migration more logging
* migration add unique index on uid if missing
* update legend styling
* 53 columns
* wip
* move dropdown and legend to the top
add dropdown border
yeet hotpink
invisible filler boxes
remove year from month format
* responsive update
* lowercase months
* handle current year, fix tests
* handle year change
* make days square again
* handle newly created users correctly
* move css
* add wrapper for easier styling
rework some font sizes/widths
reorder styles
* media queries
* align
* rework styling once more
* dont commit debug
* add days full to fill the space a bit
* show partial months
* hover on 0 tests
* start dynamic calendar on sunday
* no activity
* hover
* remove label on fillers
* remove label on fillers
* fix months, update tests for months
* adjust tests to new requirements
* cleanup
* fix migration
* impr(commandline): add "add/remove quote to favorites" commands
closes#5368
* chore: remove daily lb which is no longer in the backend
* fix: dropdown element flashing for couple frames on page load
* feat(language): add japanese romaji 1k (nthngnssmnnglss)
* fix: optional chaining
!nuf
* fix(words generator): infinite custom text tests not working correctly
* chore: missing languages in list and group files
* fix(language): remove duplicates
!nuf
* add readline sync to confirm
* gh action complaints
* unnecessary check
* premium only
* add years to drop down only if premium
* Update setup-tests.ts
* test fix
* cleanup
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* feat: indicate premium users
* frontend
* Test multiple userFlags, remove later
* cleanup
* fix flag alignment on profile and leaderboards
* fix name auto scaling
* update screenshot watermark
* update header text
* use userFlags for lbOptOut
* use flex end
* removeo unused code, increase margin
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* move user to shared definitions
this includes whatever user can have on it, tags, presets and so on
* profiles, mail and others
* fix logic
* yeet
* same as master for now
* tsc fixes
* remove comment
* fix tests
* chore: omit ips
* fix(language): remove some unnecessarily capitalised words in german 1k
* fix(typing): first space sometimes soft locking the website
* perf: speed up settings page loading
* fix: use selected typing speed unit on personal best popup (fehmer) (#5070)
* fix: Use selected typing speed unit on personal best popup
* refactor
* refactor
* test coverage
* use Format in more places
* Make config mockable
* dependency injection
* wip
* fix
* test
* touch
* fix(language): typos in russian_10k.json (kae) (#5082)
* Update russian_10k.json
- fixed typos
- removed duplicates
* - fixed extra typos
* remove duplicates
* fix(language): typos in russian_10k.json
* feat: add copy missed words to result screen (fehmer) (#5086)
* feat: Add copy missed words to result screen
* remove margin
* update icons
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* impr(funbox): add 46 group languages to wikipedia funbox (RealCyGuy) (#5078)
* impr: provide all-time LB results during LB update (fehmer) (#5074)
Try to provide LB results during the LB update. There is a very small time-frame where
already running queries might fail during the update. For now we keep the 503 error in this
cases and monitor how often this happens on production.
* impr(funbox): add ` (grave accent, 96) and ~ (tilde, 126) to specials (#5073)
* impr: add testWords and wordsHistory to copy result stats (#5085)
* feat: add testWords and wordsHistory to copy result stats
* fix
* add fe ts dep
---------
Co-authored-by: Christian Fehmer <fehmer@users.noreply.github.com>
Co-authored-by: Andrey Kuznetsov <akuznetsov@outlook.com>
Co-authored-by: Cyrus Yip <cyruscmyip1@gmail.com>
Co-authored-by: fitzsim <fitzsim@fitzsim.org>
* build: include all shared types files instead of just one
* move config property value types to a shared file
* backend build issues
* shared preset and config types
preset and config ape types
* typo
* ignoring unused warnings
* fixed merge
* further shared improvements
- moved more types to shared
- reworked the way results are typed
THIS COULD CHANGE LOGIC, TEST THIS
* removed comment
* update the way completed event is built on the client
* remove unnecessary property
* comment
* move hash check higher
* remove todo
* fix incorrect type
* updated type
remove field if undefined
* perf: improve leaderboard aggregation
Update the leaderboard and public speedStats directly in mongodb without importing the data in the nodejs process first
* Replace type on public collection with magic ids
* feat: Unlimited history for premium users UI
* disable button while loading, show spinner
* optional chaining
* add isPremium to /users, remove check from frontend
* add /results max batch size to configuration
* result batching ui v1
* rename variables, update button based on state, update text
* Return allowed results in /results if limit is partly overshooting the max limit
* use br instead of margin
* let result batches code handle button disabling
* hide title
* limit max width
* hide section when below batch size
* update limit color based on the % of limit used
* bring back loaded bar
* remove unused css
* fix alignemtn
* remove text for now
* add result getting log
* always hiding for non premium users for now
* Add server configuration users.premium.enabled, throw error on /results if premium user exceeds regular limit and premium is globally disabled
* Disable premium feature globally by default
* cleanup open todos
* Don't use premium user max limit on /results if premium feature is disabled on server
* fix merge issue
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* wip: More results and filters for premium users
* use offset+limit instead of beforeTimestamp, add configuration for max results for regular/premium users
* add isPremium to /users response
* cleanup
* review comments
* review comments
* update base config
* update premium data type
* add undefined check
* interface name
* add start timestamp
* refactor
* move function to util, rename params, use isFinite
* merge fix
* fixed tests
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* sharing is caring?
* replace 5 year old package with a more modern one
* ignore firebase config
* update import/resolver settings so that we no longer have to ignore @backend imports
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* backend flow to set hour offset
* added frontend popup to set streak hour offset
* displaying a message that the user can change offset
displaying the actual offset if its already set
* applying offset when checking streaks
* added tests for the new offset
updated old streak tests
* defaulting to undefined
* removing content if offset is already set
* updated the way offset is displayed
* also updating in the local snapshot
* make a util type
* `StringNumber` in `leaderboards.ts`
* fix errors in`pb-tables.ts`
* remove string conversion
* update schemas
* refactor `checkAndUpdatePb`
* use string arrays
* parse the mode2 before comparing
* refactor types
* fallback to empty array
* complete the mode2 string conversion
* missed a few things
* assert
* fix tests
* those were meant to be arrays
* don't supply custom and zen by default
* update interfaces
* add `parseInt`
* rename
* apparently those weren't even needed
* updated type
* added types
* types
* added comment
* added comments, removed triple equals
* another comment and again removed type check
* making sure to include legacy results
* using template strings instead
* using template strings and triple equals
---------
Co-authored-by: Miodec <jack@monkeytype.com>
* added button to opt out of leaderboards
* also not allowing daily leaderboards
* also not allowing weekly lb
* added lb opt out notice on the leaderboards
* updated message
* resetting lboptout state on account reset
* showing error when fetch failed
* added function to only use an array of middlewares in production
* allowing patch configuration and get schema if user is a configuration mod
* fixed empty middleware not working as expected
* input-controller
* result
* Finishing logic
* Numbers + layoutfluid
* One interface
* Filter results
* tts error on undefined
Extencions like NoScript can partly block scripts on the page.
If speech synthesis is not loaded, notification shows up
without freezing the page
* Improved randomcase
* Prevent dublicates in command line
* Change filter logic
* Prettier
* Convert numbers
* num
* Quote and zen modes
* withWords
* Misc
* Expand funboxes list for pb saving
* Move list to backend
* Move to constants
* Async withWords, checkFunbox tweak
* Prettier
* Forbid nonexistent funboxes
* Disable speech if language is ignored
TtS's init() uses setLanguage()
* canGetPb
* Less circular imports
* Ligatures typo
* Simon says blocks word highlight
* blockWordHighlight backend
* Changed imports
* usesLayout
* JSON schema
* Display notification instead of reseting
* canGetPB
* One getWordHtml
* Dividing properties
* No sync
* blockedModes
* forcedConfig
* Infinitness parameter, list sync
* applyConfig, memory
Remove extra applyConfig somewhere;
Memory in quotes and custom modes
* I lost this code after merging
* Remove arrowKeys
* isFunboxCompatible
* Fix logic
* sync canGetPb
* remove FunboxObjectType
* baloons
* moved cangetpb function to pb utils
* updated the pb check to be easier to understand
* Refactor isFunboxCompatible
* Check modes conflicts
* Strict highlightMode type
* Only one allowed or blocked highlight mode
* More checks
* Undefined only, not false
* Prettier
* Highlight modes
* added intersect helper function
* reworked forced config
- storing allowed modes as an array, not string
- first value will be used if config is outside of the allowed values
- instead of checking if highlight mode is allowed, checking if the whole config is available
- removed the "Finite" forced config and replaced it with "noInfiniteDuration" property
- config event listener now checks every config change, not just highlight mode. this will ensure any future forced configs will work straight out of the box
* ManualRestart in commandline
* fixed funbox commands not correctly showing which funbox is active
* Upd list
* Reduce list
* split funbox into smaller files
moved funbox files into its own folder
* missing none command
* added function to convert camel case to space separated words
* changed config validation to be blocking the change rather than reacting to the change
* reduced code duplication
* allowing sub color flash
* moved keymap key higlighting and flashing into an observable event
* moved tts into a observable event
* passing funbox into config validation funcitons
* replaced getActive with get
* only keeping functions structure in the list, moved the actual function bodies to funbox.ts
done to remove a circular dependency
still need to finish the rest of the funboxes
* removed empty function definitions (typing issues)
* removed unnecessary type
* unnecessary check
* moved mode checking to config validation
* longer notification
* checking funboxes before changing mode
* moved more functions
* fixed incorrect type
* checking funboxes when setting punctuation and numbers
* Rest of funboxes
* fixed funbox commands showing tags text and icon
* checking if funbox can be set with the current config
* better error message
* validating with setting time and words
importing from a new file
* added a function to capitalise the first letter of a string
* using function from a new file
new parameters
* moved test length check to a function in a different file
* moved some funbox validation into its own file
* only showing notifications if the setWordCount returned true
* moved funbox validation to its own file
* setting manual restart when trying to set funbox to nonoe
* moving this validation to before activating the funbox
* returning forcedConfigs along side if current value is allowed
moved infinite check to checkFunboxForcedConfigs
* removed function, replaced by funox validation
* removing duplicates
* throwing if no intersection
* wrong type
* always allowing setting funbox
sometimes it might be possible to update the config
* checking forced configs first, and updating config if possible
only setting funbox to none when couldnt update config
* basic difficulty levels
* xp funbox bonus
* removed console logs
* renamed import, renamed type
* lowercase b for consistency across the codebase
* renamed variable for readability
* renamed for clarity
* converted metadata to object
* changed from beforesubgroup on the command to before list on the subgroup
* using code suggested by bruce
* renamed type
* removed console log
* merch banner fix
* important animation
* updating the icon of "none" funbox command
* removed unnecessary import
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Miodec <jack@monkeytype.com>
* Save speed stats in leaderboard update
Saves a histogram data structure of speeds for buckets rounded to the nearest 10.
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* API endpoint to get public speed stats
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Add APE class for public stats (WIP)
I created an APE class for accessing public stats. Also stubbed getting and showing the public speed stats on the about page. Haven't implemented the histogram yet though.
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Draw histogram for global speed stats
On about page
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Update histogram colors on theme change
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Fixed out-of-order data in speed histogram
Data was not sorted correctly, which resulted in an incorrect histogram being drawn.
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Public speed stats PR fixes
Small fixes based on PR feedback:
- changed _req to req
- removed unnecessary client version header
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Add endpoint for typing stats
New endpoint to retrieve the public typing stats such as global count of tests completed.
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Renamed public-stats to public
Except in cases where it would cause an identifier named `public` as this is forbidden in strict mode.
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Add stats section to about page
In this commit:
- add a section above about called stats
- display typing stats in three columns
- underneath show the histogram of speeds on english time 60
- make chart responsive
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* Add unit test for Public DAL
Signed-off-by: Brian Evans <ebrian101@gmail.com>
* updated styling
* only requesting data once per session
* going one column on narrow screens
* added option to specify number of decimal poitns
* just showing million instead of abbreviating
updated structure
updated styling
Signed-off-by: Brian Evans <ebrian101@gmail.com>
Co-authored-by: Miodec <jack@monkeytype.com>
* Add xp reward overrides
* edge case
* switched to defined brackets instead of just min and max
* foreach
* moved type to its own interface
* updated spec
Co-authored-by: Miodec <bartnikjack@gmail.com>
* Implement streaks
* Improve code
* Update package.json
* Store streak on the user
* Pretty-fix
* Ensure that streak is up to date
* Fix issue in streak calculation
* Revert prettier changes
* Update polish.json
* Update db.ts
* Remove initial calculation
* Write mandatory test
* using strict equality
* moved functions to the utils file
* importing utils
* adding streak to breakdown,
rounding and parsing streak modifier
* renamed variable
* renamed fields
* using correct field name
* added streaks to configuration
* showing streak during xp breakdown
* incrementing streak earlier
checking configuration before applying modifier
* returning streak to the client
* setting local streak with the number returned from the backedn
* only reading streak when updating profile instead of updating
* sending streak information in profile
* only showing streak if greater than 0
* setting to empty if no streak
* renamed config property
* updated streak calculation
* refactored isYesterday
* refactored streak update
* only displaying if streak larger than 1
* merged configuration properties into 1
* added configuration for max streak bonus
* added isToday check back (derp)
* reverted streaks back to multiplier approach
* using better maprange functin
* removed import
* moved test to dal spec
* clamping
* removed imports
* fixed test
* increased coverage
* removed angry console log
* typo
* using date now instead of dates
* mocking date now
awaiting expect
* not using date
Co-authored-by: Anonymous <110769200+fasttyperdog@users.noreply.github.com>
Co-authored-by: Rizwan Mustafa <rizwanmustafa0000@gmail.com>
Co-authored-by: Miodec <bartnikjack@gmail.com>
* Add new rate limiting flow
* Oops
* Fix nit
* Fix some bugs
* Split key generation functions
* Remove 429
* Change message for root limiter
* Flag 429 and add config
* Add status code config
* Check enabled flag
* Add custom status for ape keys
* Bump coverage
* swapped conditions around
whats the point of checking if the status code is in the array if the whole thing is turned off anyway
Co-authored-by: Miodec <bartnikjack@gmail.com>
* Fixed badges not showing on all time leaderboards
* updated types to support inventory and single badge id
* Add badge selection
* Fix bug
* Remove unnecessary prefill
* using new inventory system
* added no balloon option
* updated text color
* not showing balloon
* updated styling for showing badges selection
* Add badge selection
Co-authored-by: Bruception <bberr022@fiu.edu>