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

React Migration - part 2 #5493

Merged
merged 6 commits into from
Jan 23, 2024
Merged

Conversation

mullenpaul
Copy link
Contributor

@mullenpaul mullenpaul commented Jan 18, 2024

About the pull request

Switches TGUI from Inferno to React.

Part 2 of the PR #5435

Based heavily on the work from: https://github.com/tgstation/tgstation/pull/80044/files

Explain why it's good for the game

React is a more suitable framework

Testing Photographs and Procedure

Screenshots & Videos

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

Changelog

🆑
refactor: switched from infernojs to react
/:cl:

@mullenpaul mullenpaul added UI deletes nanoui/html Do Not Тestmerge I will find you and I will testmerge you into the ground if you even think about testmerging this. labels Jan 18, 2024
@github-actions github-actions bot added the Refactor Make the code harder to read label Jan 18, 2024
@mullenpaul mullenpaul added Testmerge Candidate we'll test this while you're asleep and the server has 10 players and removed Do Not Тestmerge I will find you and I will testmerge you into the ground if you even think about testmerging this. labels Jan 20, 2024
@mullenpaul
Copy link
Contributor Author

This seems to work fine locally, we need to TM it to see any issues

@mullenpaul mullenpaul marked this pull request as ready for review January 20, 2024 13:49
@Vicacrov
Copy link
Contributor

I added a box of vials and a bucket into the Turing Dispenser, I clicked Run Program, and then I got this tgui error - I cannot access the Turing Dispenser again.

Error: Minified React error #62; visit https://reactjs.org/docs/error-decoder.html?invariant=62 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
   at ge (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:15121)
   at ql (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:86579)
   at jc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109486)
   at vc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109378)
   at xc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109245)
   at pc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109108)
   at lc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:106225)
   at Wi (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:46865)
   at tc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:103309)
   at Vc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:118741)
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Tablet PC 2.0; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)
State: {"ckey":"vicacrov","interface":"Autodispenser","window":{"key":"[0x2004fe7]-main","size":null,"fancy":1,"locked":0}}

@Vicacrov
Copy link
Contributor

Vicacrov commented Jan 20, 2024

The IC > View research objectives throws this error from the moment I spawned in (as a researcher):

ReferenceError: 'cotext' is undefined
   at t.ResearchMemories (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:867437)
   at _a (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:63019)
   at ks (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:120235)
   at vc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109311)
   at xc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109245)
   at pc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:109108)
   at lc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:106225)
   at Wi (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:46865)
   at cc (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:106735)
   at Anonymous function (http://cdn.cm-ss13.com/live/51/asset.510921d6848feba589d94ba635f9c727.js:1:124772)
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Tablet PC 2.0; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)
State: {"ckey":"vicacrov","interface":"ResearchMemories","window":{"key":"[0x21029f23]-main","size":null,"fancy":1,"locked":0}}

Other issue I noticed - I accidentally maximised a tgui window and I can no longer resize it, it is stuck in full window mode. Dragging the edges, double-clicking the top bar, nothing works. Every single tgui window is now maximised that I open. :waaa: I needed to restart the game for it to reset.

Copy link
Member

@harryob harryob left a comment

Choose a reason for hiding this comment

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

further bugs can shake themselves out in master

@harryob harryob added this pull request to the merge queue Jan 23, 2024
Merged via the queue into cmss13-devs:master with commit d5dfe13 Jan 23, 2024
26 checks passed
cm13-github added a commit that referenced this pull request Jan 23, 2024
@Staykeu Staykeu mentioned this pull request Jan 24, 2024
3 tasks
github-merge-queue bot pushed a commit that referenced this pull request Feb 21, 2024
# About the pull request

This PR is a follow up to #5493 fixing the Medals Panel. Some reason
Fragment is busted if you don't use a key?

# Explain why it's good for the game

Fixes 

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/c811b7ef-c9b5-45e3-b95b-bad416e8ab7a)

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/76988376/41a05979-eda5-4a1f-ae7d-1f8ddaf50129)

</details>


# Changelog
:cl: Drathek
ui: Fix broken admin Medals Panel
/:cl:

fixes #5768
github-merge-queue bot pushed a commit that referenced this pull request May 19, 2024
# About the pull request

This PR is a follow up to #5493 and ultimately is aimed at bringing us
back into parity with TG's version of the TGUI components again. For the
most part this PR is done via diffing TG's TGUI folder with ours. The
PRs listed below are what I found in blames and I double checked to see
what files if any they affected outside the TGUI folder.

**It is recommended to close VSC and run bin/clean.cmd and then
bin/build.cmd if you try out this branch**. You will be using the wrong
node & prettier version otherwise.

This at least partially ports these PRs (and likely many others - but
these I explicitly checked for how they affected other files):
- tgstation/tgstation#67935
- tgstation/tgstation#74638
- tgstation/tgstation#75029
- tgstation/tgstation#75431
- tgstation/tgstation#75463
- tgstation/tgstation#75534
- tgstation/tgstation#78879
- tgstation/tgstation#79322
- tgstation/tgstation#79895
- tgstation/tgstation#79898
- tgstation/tgstation#79974
- tgstation/tgstation#79991
- tgstation/tgstation#80044
- tgstation/tgstation#80057
- tgstation/tgstation#80189
- tgstation/tgstation#80304
- tgstation/tgstation#80430
- tgstation/tgstation#80453
- tgstation/tgstation#80454
- tgstation/tgstation#80920
- tgstation/tgstation#81354
- tgstation/tgstation#81381
- tgstation/tgstation#81495
- tgstation/tgstation#82334
- tgstation/tgstation#82377
- tgstation/tgstation#82385
- tgstation/tgstation#82417
- tgstation/tgstation#82420
- tgstation/tgstation#82527
- tgstation/tgstation#82571
- tgstation/tgstation#82792
- tgstation/tgstation#82854
- tgstation/tgstation#83098
- tgstation/tgstation#83096
- tgstation/tgstation#83218

Additionally it ports the new base components from: 
- tgstation/tgstation#71531
- tgstation/tgstation#71847
- tgstation/tgstation#74544
- tgstation/tgstation#74704 (just a fix to
above)
- tgstation/tgstation#80743
- tgstation/tgstation#82181 (just a fix to
above)
- tgstation/tgstation#82533
- tgstation/tgstation#83179 (just a fix to
above)

But these are missing documentation in the components readme, and we do
not have any interface that utilizes them yet. I wanted to explicitly
mention them separately so people can see what they can do.

Changes I still intend to do in this PR or investigate:
- [X] Fix Button.Confirm not properly handling clicks (Sort of stumped
on this atm)
- [X] Fix Relay Viewer buttons not always updating
- [X] Port TGSay 1.1 & TextArea changes
(tgstation/tgstation#75431)
- [X] Fix ByondUI in Drop pod panel
- [X] Check parity with TG again and port anything else that may have
been done during the creation of this PR
- [X] Find a way to prevent TGSay passthrough when hotkeying InputList
(and maybe others)? tgstation/tgstation#75463

Other notable changes not directly related to the above ports, but done
as I was fixing other problems:
- Strip panel is now larger with sprites at 64x64 instead of 48 because
as an Image component now they didn't alias the same.
- VOX panel's second tab now doesn't overlap the other buttons
- Wiring panel from #1623 is
now restored to use circular indicators again instead of the regression
to ColorBox in #2641
- Smart fridge interface is more in line with sorted inventories as far
as layout & tooltips
- Tacmap drawing interface is tweaked a little to deal with the changes
to dropdowns + clicking the tab is now disabled again until the tacmap
is ready (It needs minimap subsystem to fire to have icons when
flattening the map to be up to date)
- Fixes runtimes when quickly switching between tgsay categories
- Basically reverts #5651 in
favor of how TG ended up solving it via
tgstation/tgstation#81495
- Rolls back SWC to the version TG is currently using because of
#6196 (comment)
- Adds these commands from
tgstation/tgstation#81381 though I also have it
check jsx files that somereason TG doesn't do (needs to have been built
once to function - just run build.bat):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/ed107278-93ee-4a2a-bbf2-b38e60417099)
- Chat: Adds a clear chat button clearing the current tab, mute button
to disable unread notifications for a tab, and updates the word
highlight regex for case sensitivity. I left out one of the Cyrillic
fixes since we shouldn't normally be handling Cyrillic anyways.
- Ship manipulator window can now replace any existing shuttle and
generally is polished up more than it was.
- Ports TGSay 1.1 though I discarded basically all the layout changes
they did.
- TGUI modals can now accept a ui_state in case you want an alert for
say a mob that might qdel while it is open.
- Finishes porting the reservation changes to shuttles.dm from
tgstation/tgstation#73261 that some reason were
absent from #5165
- Fixes F5 refreshing a window if default is prevented (e.g. when the
hotkey interface is waiting for a key press).
- All depreciated useLocalState is now removed. In almost all situations
I could useState, but a few things for MFD on CAS I needed to use
sharedState.

# Explain why it's good for the game
Prepares us for 516 (though still more changes will be necessary) and
finalizes the react port.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

New list modal w/ duplicate key handling:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/b84e2db6-4e42-42d3-9b6d-4ae418f63c60)

Fixed VOX panel (sound files used to overlap type select):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/a3cde1ea-1816-4187-b7a4-040803e52d4e)

Updated shuttle manipulator window:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/f978c2e2-9174-4635-9da7-6d2768f9fbff)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/607a0b91-5c64-4ca0-9256-d981c7073fb9)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/9b69cfb2-d4c2-4caf-846d-1d32f965cff0)

With replace any shuttle support: 

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/ace7f58a-0991-4147-b13f-d2be2d012b21)

Erase current tab chat history:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/9554ccfe-43da-4eee-b9ae-ad5cbec0523b)

Working case sensitivity highlights: 

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/182971ac-a0f2-42de-ad41-fa12991d760c)

Unread counter toggle per tab:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/9de5b9ae-5cb2-4905-9592-556e9cf45ad2)

Larger strip panel:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/2229c7d4-935a-427e-9699-942acae1cfbf)

Tacmap panel polish (button positioning + dropdown text color when
highlighted):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/dcdf86fa-ba48-4d6f-bd42-bb8f3c1dd2bf)

Minor tweak to camera panel:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/930d64b8-1c36-4cc4-a24d-900d57c642b0)

Dropdowns will now display above if too little space below: 

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/3f4916d9-f020-489d-8494-277bde9cd741)

Kitchen sink works again (F12 w/ tgui-dev):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/aa3bd2c7-b320-4158-ae8f-cea4896f0a9c)

Layout mode works again (F11 w/ tgui-dev):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/cb683cd2-e62b-4cdf-bb38-10e7e1902030)

New checkbox modal (with theme support):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/ddc2da93-8987-44f2-be3f-1c2694d9489e)

![checkbox](https://github.com/cmss13-devs/cmss13/assets/76988376/6a6ddab9-25b6-47cb-b833-295b3b7bf6c2)

New handling for button sizes in alert modals (stacked list since
options wanted to use more horizontal space than limit):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/976a2a86-c1c6-421a-bb7a-80f20cc8f22d)

Polished smart fridge + restore wiring panel:
![smart
fridge](https://github.com/cmss13-devs/cmss13/assets/76988376/5524132f-c657-45d2-a7bc-aa09e00eb45b)

Fixed byondui in supply pod menu:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/18555668-34fe-4aa7-83aa-c1045bc54dd0)

TG Say:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/cc66a143-22ba-4f90-865a-0c00e7dd8bfa)

Some unchanged panels (to just show working):

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/adb8e0cb-64a4-45c4-9bac-1cecc6791667)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/d330bd51-995b-48f4-8f18-5aedd0e2adaf)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/cb5edc05-949d-4564-9548-f255971bb0f8)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/0559cd17-8b5e-4585-8152-d8ac67a82f35)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/31bf0233-dd05-408c-b2c6-5ebee9b2381c)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/314fdec8-cc5c-4815-9ca9-b85422880a29)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/36bf1d5e-91fd-4cb0-8ce5-07ce4746902f)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/b63ee6aa-e80c-4928-9295-05d0e6314a16)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/9b93df2e-a92d-4eeb-a5d4-07018c848c54)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/7b45ba04-30c7-405c-90c2-d52ca99d7890)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/f3ae0b6d-ca77-4dd8-bfc7-8616018211d1)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/9aa28a52-e86d-4bb0-be23-a9ee1b39d97c)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/8108494f-9ce9-44dd-b94b-5306c9ef7e09)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/996b5dd3-89fa-4d19-bebc-de52774de23b)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/2bccace6-2a68-4f8f-ada6-c231aab836f9)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/8362f2ff-b38f-4682-a5c7-b26934e5972e)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/8584e849-8d8d-4ff2-9ff8-932749ea6da5)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/813b21e2-9705-4b5f-8710-e452384c56d9)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/dcd933c5-65bd-41a2-b8c9-e1dcba446231)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/1d81b490-168c-4f88-9d88-099f768cd665)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/1dbe39d6-08fc-4734-bdf6-afc71fef6e6f)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/f7fc5461-5138-4427-ab1a-89627baefb4b)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/032cc12c-802e-4d0a-b8d3-568a48f7d469)

![dropship](https://github.com/cmss13-devs/cmss13/assets/76988376/c85a4ed3-b4a9-4c44-a34b-1990f7ac7d31)

</details>

# Changelog
:cl: Drathek, mullenpaul
ui: Finalizes the TGUI React port and brings us back into parity again
with TG's interface components
ui: Strip panel is now larger with sprites at 64x64 instead of 48
because as an Image component now they didn't alias the same.
ui: VOX panel's second tab now doesn't overlap the other buttons
ui: Wiring panel for some machines is now restored to use circular
indicators again
ui: Smart fridge interface is more in line with sorted inventories as
far as layout & tooltips
ui: Tacmap drawing interface is tweaked a little to deal with the
changes to dropdowns + clicking the tab is now disabled again until the
tacmap is ready (It needs minimap subsystem to fire to have icons when
flattening the map to be up to date)
ui: Reworks RestrictedInput number handling
ui: Adds the DMIcon, VirtualList (deferred lazy list), Dialogue,
MenuBar, StyleableSection, and Checkbox TGUI components (but nothing
uses them yet)
ui: Chat: Adds a clear chat button clearing the current tab, mute button
to disable unread notifications for a tab, and updates the word
highlight regex for case sensitivity
ui: Updates the ship manipulator window to allow replacing any Shuttle
ui: Fixes the supply pod panel not displaying its byondui map correctly
ui: Fixes the research terminal duplicating papers in display old mode.
ui: Updates the tgui_input_list to for new features like hotkey
selection, duplicate key handling, etc
fix: Fixes thinking runtimes when quickly switching between tgsay
categories
code: Shuttle subsystem now is less aggressive with reservations
(skipping deletion if below a threshold, delaying reservation if above a
threshold)
fix: Fixes F5 key still refreshing a TGUI window even if default was set
to be prevented (e.g. Hotkey interface)
/:cl:

---------

Co-authored-by: Jerm <jlsnow301@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Make the code harder to read Testmerge Candidate we'll test this while you're asleep and the server has 10 players UI deletes nanoui/html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants