Skip to content

[PORT] Dropdowns v2; plus, dropdowns now highlight their selected element #5731

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

Merged

Conversation

LikeLakers2
Copy link
Collaborator

About The Pull Request

This PR ports the following PRs from tgstation:

Here's how dropdowns looked before this PR:
236760396-5eb71a23-7b3d-4a9e-98d4-6bd4dc5fe1c7

and after:
236758675-b2ab90a7-0482-492e-b911-9e59f827f6b8

Why It's Good For The Game

Code improvements, and the highlighting dropdowns makes it easier to know what you selected, especially in long lists.

Changelog

🆑MichiRecRoom, actioninja, lebedev, KoJIT2009
refactor: TGUI dropdowns have been refactored; please let me know if you spot any broken dropdowns!
qol: (lebedev) Made selected elements highlighted in TGUI Dropdowns
/:cl:

actioninja and others added 3 commits March 1, 2025 09:12
Complete rewrite of dropdowns to use popper elements that are injected
at the body level.
This means they are now horribly overcomplicated and also suck a lot
less

![2023-05-04_06-57-12](https://user-images.githubusercontent.com/5194834/236229806-2f676e7b-d6c5-427a-af2f-520d883be790.gif)
Also ported `Icon` to typescript for a reason that didn't end up making
it in the PR

![image](https://user-images.githubusercontent.com/5194834/236226086-35ec2009-e9a9-404b-9b52-3ab8de0a0ae6.png)

![image](https://user-images.githubusercontent.com/5194834/236226573-880c0380-0f70-41c7-90c6-d51ba4238561.png)

:cl:
add: good tgui dropdowns
del: tgui dropdown suck
qol: tgui dropdowns suck less
balance: buffed tgui dropdowns
/:cl:
## About The Pull Request
This PR makes selected elements in Dropdowns to be highlighted.
Without this:

![image](https://user-images.githubusercontent.com/5000549/236760396-5eb71a23-7b3d-4a9e-98d4-6bd4dc5fe1c7.png)
With this:

![image](https://user-images.githubusercontent.com/5000549/236758675-b2ab90a7-0482-492e-b911-9e59f827f6b8.png)
## Why It's Good For The Game
It's convenient to have this kind of selection indication, especially in
long lists.
## Changelog
:cl:
qol: Made selected elements highlighted in TGUI Dropdowns
/:cl:
## About The Pull Request

If dropdown not receive `selected` prop, buttons will be change value to
first(when press next) or last element(when press back)

## Changelog
:cl:
fix: Fixed dropdown buttons empty selected case
/:cl:
@LikeLakers2 LikeLakers2 marked this pull request as draft March 1, 2025 16:06
@LikeLakers2
Copy link
Collaborator Author

LikeLakers2 commented Mar 4, 2025

I was notified that this caused the Chromosome selection on the Genetics console to look a little weird. It looks a bit like this:
image

I was able to replicate this on tgstation, but only after reverting to a pre-react commit (I chose tgstation/tgstation@84ba2dc).

So Absolucy and I believe this to be an issue with us still being pre-react.

However, I was able to find a temporary solution (which we will want to try to revert once the react port is done), and have implemented it in 4b0e68d. Now it looks like this, as it should:

image

@Absolucy Absolucy merged commit 82b7748 into Monkestation:master Mar 6, 2025
45 of 48 checks passed
github-actions bot added a commit that referenced this pull request Mar 6, 2025
@LikeLakers2 LikeLakers2 deleted the project/port/tg-75164-dropdowns-v2 branch March 6, 2025 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Fix fix da bug Feature: Refactor/Rework Completely redoing a larger thing / recoding a thing QoL improves quality of life
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants