-
Notifications
You must be signed in to change notification settings - Fork 349
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
Shorten names for tournament/ladder games in game lists #2425
Shorten names for tournament/ladder games in game lists #2425
Conversation
Show more of the relevant part of the game name in game lists before the text overflows, by replacing: - the "Tournament Game:" prefix with the trophy icon and - the "Ladder Challenge:" prefix with the ladder icon. Without this change, the now-shortened prefix was the only visible text in such games.
Uffizzi Preview |
BTW, I'm new to React and TypeScript... the initial patch shares the core logic for this change between the two places, but duplicates the rendering code. Not sure if this is okay, or too spaghetti-like. I had a look at sharing the rendering code but what I came up with (changing the new |
CI linting rejected the delayed initialization of `GameNameForList`'s non-optional `text` field in 3dfe0b5. Refactor to avoid that, and also be more clear about the `null` case.
Just pushed d4f047b to respond to CI failure (I hadn't seen failures locally when testing with beta.online-go.com... looks like the CI checks more thoroughly!). |
React has Functional Components that are a lot lighter weight than class components. In modern React these are preferred anyway (the React docs only cover class components as a "Legacy API"). This PR looks good to me as-is, but I've opened PR dexonsmith#1 as an example of how you can dedupe the render code too. |
Make GameNameForList the component.
Awesome; your version is what I might have hoped for, so I merged it in. |
(BTW, if you preferred my patch before your change, I can force push back to that version. But it seems useful to me for the archived games and current games to share the rendering code, in case there are other tweaks to make, and this seems pretty clean.) |
Long overdue. Thank you ❤️ |
I don't know if it's in scope, but could the ladder games say which ladder they belong to? Many ladder players are in multiple ladders and it's hard to tell them apart. |
I think better to do separately (IMO, out of scope). It might also be better server-side... depending on where the logic for creating/naming ladder games (I haven't looked yet). IMO, it'd be better to actually change the names of the games to include the ladder name, rather than just prettifying it in game lists (which is what this patch does). I.e., the game-creation logic could be changed such that the name is something like:
And then this patch would (continue to) prettify the display of the name in game lists to use the ladder symbol instead of the words "Ladder Challenge:". Unlike this patch, it wouldn't retroactively change names of old ladder games, but new ones would include the ladder name. |
Yeah, confirmed the names are generated server-side. This is what online-go.com sends to the server:
I'd be happy to write a patch for that, but I don't think I have access to the server code right now. |
Good improvement, thanks! |
Show more of the relevant part of the game name in game lists before the text overflows, by replacing:
Without this change, the now-shortened prefix was the only visible text in such games.
This fixes both
GobanLineSummary
andGameHistoryTable
.Fixes #2424