arqalite / rummy-nights Goto Github PK
View Code? Open in Web Editor NEWA rummy score counter web app written with Rust/Dioxus and Tailwind CSS.
Home Page: https://rummy-nights.vercel.app
License: MIT License
A rummy score counter web app written with Rust/Dioxus and Tailwind CSS.
Home Page: https://rummy-nights.vercel.app
License: MIT License
During IRL testing, players wanted to discuss the final scores for quite a bit, so we need to ensure they can do that safely. #55 is one of the suggested features, and it would be worth disabling LocalStorage clearing to prevent games disappearing in the middle of discussions due to accidental refreshes.
This can be most easily be replicated by adding players very quickly in the player select screen. Sometimes if you move too fast, the textbox doesn't have time to clear so you start typing in it and it keeps the text since the buffer is now reset with the new text.
Recently I've noticed a lot of things re-rendering unnecessarily or functions running infinitely in the background. Placing log! statements all around the code would help to see what things execute too often or for no reason.
This is clearly not our problem per-se, but if you disable CSS you can click a player's name to grant them the tile bonus without checking if it was already granted.
Players should be able to start a new game immediately if they want to play again with the same group.
After the game is finished and the winner screen is shown, if we return to the score table, the styling is incorrect. Unclear how and why that happens.
During early development we had PWA set up, however we ran into issues with caching and testing updates since the browsers would load the cached version instead of the new one even after a hard refresh. Simultaneously, photos would load with a delay, which either means performance issues when loading images, or they weren't cached properly/at all.
get_game_status() runs on every re-render instead of running only when a score changes.
When the game has started but the first round (first row of scores) isn't complete - back button should return to score table.
When the first round has started, the back button should go to the main menu, disabling editing players in an ongoing game to prevent issues.
Romanian Tile Rummy (RTR) has a bonus given to the player that has the matching tile with the exposed one (in Romanian, the "atu").
It would be nice if this can be tracked in-app so players don't have to manually add the points later.
Implementation could involve a second BTreeMap on the Player struct which will hold as keys the round where the bonus was granted, and the value.
If you use the exit button to close game and return to main menu, it doesn't ask you to confirm if you really want to delete the game.
I think the button should just return to the main menu without deleting the game.
This changes the order of players everywhere, not just the winner screen.
For now the focus has been mobile, so the design is mobile-first, which leads to weird layout and element styling on desktops.
A workaround has been limiting the max-width to a phone size on desktop, but this isn't great.
Rummy has as many variations as there are cultures in the world, each with its own rules and quirks.
The app aims to be as inclusive as possible, so we have a goal to support as many variations of the game as possible.
However there needs to be a "default" that the app will automatically configure when the game starts.
As of v0.1, the game defaults to Romanian Tile Rummy rules, with a maximum of 4 players and a max score of 1000.
Given that this is a personal project, I believe it's best to keep Romanian Tile Rummy as the default, but there is still work to be done.
Currently the tile bonus feature doesn't do anything if you try to use it twice in the same round. Ideally we should show an error message.
This was fixed for Firefox and Chrome (Android) a while back, but desktop Chrome and probably both Safaris still have it.
Input boxes in the score table have the spinner arrows next to it which are both unhelpful (scores are expected to be in the hundreds and multiples of 5 and 10, not individual points) and not aesthetically pleasing.
Describe the bug
When typing in an input element (player name input or score input), the whole UI re-renders.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
UI renders once, then re-renders on submit, not on input.
Clippy currently complains about score_table() being too big, exceeding its standard of 100 lines per fn.
It would make sense to split it into multiple function components, and while we're at it, refactor and spruce up the code.
Is your feature request related to a problem? Please describe.
When the game ends, and you return to the game screen, it still shows the message "Good luck and have fun!".
Describe the solution you'd like
It would be nice if it showed "X won!" or something similar instead.
Finish a game, return to score table, you can add tile bonus.
We might want to let the user tweak a few things regarding the app and the game they are playing.
Currently thinking of:
For the game screen:
This will be a dynamic list, things will be added/removed/ticked off as development goes on.
Since Dioxus is under rapid development, the 0.2 release is quite behind on features, and 0.3 doesn't seem to be releasing soon, it might be worth switching to the master branch.
This does imply dealing with possible bugs, breaking changes and other fun things that come with following a master branch, but it might provide the benefit of getting new features and bug-fixes faster than normal. Both projects are not 1.0 yet anyway, so it doesn't matter that much. Plus it will make bug reporting and bug-fixing easier since the Dioxus team is referencing master for any issue.
Players can return to the score table after the game ends to check scores, discuss individual games, whatever. However currently they can also go back to player select and modify the player list which shouldn't be allowed.
This needs to be solved before we implement any kind of game history tracking.
Describe the bug
I cannot add players using the add player button in the player select screen. Using Enter on the keyboard works though.
To Reproduce
Go to player select, enter a player's name, and press the add button. Nothing happens.
Expected behavior
Player gets added to the game.
Smartphone (please complete the following information):
This might require other developments before it can be properly implemented, but it should be pretty easy. Going for a black background might be all we need.
I think we need to make a settings menu first, in the intro screen and maybe in the score table too, and then add this.
Images load with a slight delay, which implies they either are redownloaded after each refresh (which is impacting performance and is wasting resources), or it takes a while to load them from cache (meaning there is a performance problem somewhere).
We already have the button for it, but no functionality yet.
Ideally it should allow dragging elements around but I'm unsure how what would be implemented right now, so we could replace it with two buttons, one for up and one for down maybe.
When 2+ players are tied at the end of the game, the app tries to repeatedly sort the players, and keeps doing it infinitely.
Make sure LocalStorage/SessionStorage is read only once per session to improve performance.
Now that v0.1 is live, the repo became public - which means we need to clean up things and make sure people can contribute. Also the release system that GitHub uses relies a lot on pull requests - something that hasn't been used to its fullest now.
Apparently opening the keyboard shrinks the viewport so we need to find a new way to pin stuff to the bottom of the screen.
If playing with 4 people, the last person is not visible in the winner screen. This seems to persist on all screen sizes and aspect ratios.
Dioxus devs intend for the crate to be used with their CLI tool - however when development of this app started, it was not compiling properly. Assuming it's fixed now, it might be worth testing if migrating to Dioxus CLI is feasible, and if so, if there are any benefits to moving to it and ditching Trunk.
AFAIK one blocking issue is that Dioxus CLI doesn't handle service workers properly, and we need that for PWA functionality (#25).
Related to #17 - when the game ends and there is a tie for 1st place, we go directly to the winner screen. Some players might prefer we give them the choice between playing a tiebreaker game to determine the true winner, or end it as-is and make everyone that tied the winner.
...it and start game.
Currently the app is written using a fixed width (the smallest width Firefox on Windows allows) but there are devices with narrower viewport than that, i.e my Asus Zenfone 8 on default settings.
The app has broken styling on them, with stuff overflowing off the edges of their parents.
Describe the bug
In the game screen, the app saves to local storage endlessly. This is wasting CPU cycles and causing unnecessary read/writes.
It should only save when something actually changes, for now when the total score changes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Game saves when score changes.
It currently saves endlessly.
Is your feature request related to a problem? Please describe.
If you create a game with 4 players and move them around the list - once you start the game their IDs are also shuffled. This causes the score input focus to jump from ID to ID instead of the visible order of the players.
Describe the solution you'd like
When the start game button is clicked after adding players, reassign IDs so they match the player order.
This will affect the color assignments - but considering that is not a developed feature yet, we'll ignore that.
SessionStorage maybe?
After a game ends, let the user go back and forth between game screen and winner screen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.