Skip to content
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

Who/Staffwho in TGUI #3786

Closed
wants to merge 8 commits into from
Closed

Who/Staffwho in TGUI #3786

wants to merge 8 commits into from

Conversation

Ssshizoprenia
Copy link

@Ssshizoprenia Ssshizoprenia commented Jul 2, 2023

About the pull request

I heard some bad feedback on the onyx space about my past WHO window migration, so I decided that's the way to go... I should upgrade it to CM so people would be happy! Not just chic and feast on a dead CMI server.

Explain why it's good for the game

New nice TGUI Who interface, sound COOL, no?

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
ui: new interface for who/staffwho in tgui
code: change who/staffwho to tgui
/:cl:

@github-actions github-actions bot added UI deletes nanoui/html Code Improvement Make the code longer labels Jul 2, 2023
@BeagleGaming1
Copy link
Contributor

What do they look like?

@Ssshizoprenia
Copy link
Author

Ssshizoprenia commented Jul 2, 2023

What do they look like?

Sorry for long response, I get for you some picks (you need click on name to get PP)
image

@Ssshizoprenia
Copy link
Author

image
image
image
image

@morrowwolf
Copy link
Member

brain worms moment

@morrowwolf morrowwolf closed this Jul 2, 2023
@morrowwolf
Copy link
Member

Apology accepted for the moment. Avoid being a dickhead to maintainers.

@morrowwolf morrowwolf reopened this Jul 2, 2023
Copy link
Contributor

@mullenpaul mullenpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good approach. I feel that the data model between backend and front end is quite coupled. In particular how the back end provides the exact text to display - e.g. ' - In Lobby' and how the colour is hardcoded in the backend.

I quite strongly feel that the colouring and styling information should be moved to scss to allow for a more robust solution going forward. I'm happy to discuss this further.

<Window resizable width={600} height={600}>
<Window.Content scrollable>
{administrators !== undefined && (
<Stack fill vertical>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use a stack to frame the collapsible when you only have one child?

{administrators.map((x, index) => (
<StaffWhoCollapsible
key={x.index}
title={x.category + ' - ' + x.category_administrators}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally think that string interpolation is better than adding strings together


const GetAdminInfo = (props, context) => {
const { admin, content, color, text } = props;
return admin ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally not a fan of the ternary operator used like this. My personal preference is to do something like:
if admin return admin_button return default_button
Essentially the return early principle. The main issue I have with the ternary operator like this - is that you end up with one operator being dragged across many lines, you gotta jump up and down to read it.

return admin ? (
<Button
color={'transparent'}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to style this in scss? Using react to directly plug in style information - works - but isn't great. Using scss we would be able to reduce the amount of code in the button definition here.

<Window resizable width={600} height={600}>
<Window.Content scrollable>
<Stack fill vertical>
{total_players !== undefined && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you expecting the total players list to ever resolve to undefined? I could understand it resolving to an empty list

return (
<Button
color={'transparent'}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue I described regarding styling

const GetPlayerInfo = (props, context) => {
const { act } = useBackend(context);
const { admin, ckey, ckey_color, color, text } = props;
return admin ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment regarding the ternary operator

new_mobs_ckey[client.key] = client_mob
if(client_mob)
if(istype(client_mob, /mob/new_player))
client_payload["text"] += " - in Lobby"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we want to directly change the display code in the backend. I feel that this couples the backend code with the render code quite tightly. I believe that a looser approach of say, a flag variable of being in lobby, would be preferable.

continue

if(isobserver(client_mob))
client_payload["text"] += " - Playing as [client_mob.real_name]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above regarding changing the text name

"text" = "Queen: [faction.living_xeno_queen ? "Alive" : "Dead"]",
))

/* in future...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still required?

@mullenpaul mullenpaul marked this pull request as draft July 3, 2023 17:05
@github-actions
Copy link
Contributor

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the Stale beg a maintainer to review your PR label Jul 11, 2023
@github-actions github-actions bot closed this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Improvement Make the code longer Stale beg a maintainer to review your PR UI deletes nanoui/html
Projects
Status: PR merged
Development

Successfully merging this pull request may close these issues.

4 participants