## About The Pull Request
This has been a long project that has undergone several iterations. I
needed to complete #94514 just to get here, and this is surprisingly
simpler despite handling much more code. This PR replaces the bespoke
redux-based solution with [jotai](https://jotai.org/), a lean state
manager. For the most part, this means the UI will be a bit more
responsive.
I'll post the philosophy from the docs:
In the previous TGUI backend state, both DM messages and UI actions were
handled through an event message system using actions, selectors,
reducers, and middleware. This new event system is designed to handle
only DM messages - separating UI actions into direct state access (eg
setSomeState(true)) or helpers (eg updateSetting({ thing: true})).
The idea behind this was to reduce the amount of abstractions needed and
draw a clear line between what is a server message and what is a UI
action.
There are three components to this system:
1. The event bus, which maintains the list of handlers.
2. The handlers, which delegate backend calls and update application
state.
3. The store, ie the application state.
## Why It's Good For The Game
The previous solution would do a full tree rerender when any backend
message or UI event took place, including pings. We don't need to do
this now. We can atomically update the components when they need
updated.
The code should be easier to maintain (fully documented and concise)
The UI should be more reliable
## Changelog
N/A
## About The Pull Request
8! Yeah! How many more? Well, there's seemingly a fountain of old code
from TG at any given point, and probably a hundred more linter errors
that have collected over time. However, this should be the last batch
before we ship biome. Knock on wood (I am not sitting near anything made
of wood)!
## Command
Get [Biome](https://biomejs.dev/guides/manual-installation/) (the
executable, at least)
`biome lint --write --only "useTemplate" --unsafe`
## Why It's Good For The Game
I would like to install a new linter/formatter
## Changelog
## About The Pull Request
Part of a series of linter auto fixes from biome. These change
typescript imports to specify `type`. It's a safe fix:
https://biomejs.dev/linter/rules/use-import-type/
## Command
Get [Biome](https://biomejs.dev/guides/manual-installation/) (the
executable, at least)
`biome lint --write --only "useImportType"`
## Why It's Good For The Game
Moving us to a simple linter/formatter and shaving off a number of
packages, tech debt
## Changelog
## About The Pull Request
Swaps us back to RSPack. I keep getting pings about this #91925, which I
can only guess is webpack related. That, and I don't want to just give
up on rspack, I was merely frustrated with it while fixing bun builds.
## Why It's Good For The Game
Less javascript. Puts us back on our last build tool. Might fix the html
entity issue
We can also run the config in ts which I think is sweet
## Changelog
## About The Pull Request
Atomized PR from converting us to biome. This converts all cases where
we're using `let` but it's never reassigned. This is considered a safe
fix
https://biomejs.dev/linter/rules/use-const/
## Command
Get [Biome](https://biomejs.dev/guides/manual-installation/) (the
executable, at least)
`biome lint --write --only "useConst"`
## Why It's Good For The Game
Moving us to a simple linter/formatter and shaving off a number of
packages, tech debt
## Changelog
Should be absolutely zero effect on gameplay
## About The Pull Request
This started out as just a small fix for dev server crashing but lo, I
cannot keep my hands off of such a juicy rework, it now uses Bun's own
websocket server and is written entirely in typescript. It makes much
more use of console.log (you can see these in client) as well
## Why It's Good For The Game
Lets devs use tgui-dev again
## Changelog
## About The Pull Request
I don't know anyone that uses these. I don't think bench is even
relevant for webview2. Even the documents are outdated (referencing
ie8).
## Why It's Good For The Game
Anything these were testing for is probably old news, which makes this
just a maintenance burden
## Changelog
## About The Pull Request
Swaps out node & yarn in favor of [bun](https://bun.sh/)

sub tasks
- [x] add bun setup script
- [x] fix tgui-dev-server (bun glob is different)
- [x] set juke to run bun
- [x] remove all yarn stuff
- [x] convert all tests from vitest to bun
- [x] fight with CI/tgs
## Why It's Good For The Game
Yarn has served us over the years as our package manager but the method
it bundles dependencies has lead to issues and setbacks, notably needing
to wait on rspack support, but more recently in trying to switch to
biome
1. I can add in packages that do not need these workarounds, like god
intended
2. We won't need to [keep around
sdks](https://yarnpkg.com/getting-started/editor-sdks) which rely on
yarn to even publish
3. We're not committing the yarn cache or .pnp file, which kind of
defeats the purpose
4. Native typescript support and testing
5. Because it'd be cool
## Caveats
Rspack was throwing errors on TGS while doing this. I needed to switch
back to webpack/swc, which seems to work flawlessly. It was too tiring
for anyone involved to debug and this was the simplest route. It adds a
completely negligible amount of time to build. It might even resolve
some issues elsewhere.
Making this switch extends that very first setup time! I'm working on
cutting it down, but as of right now, it takes about 80 seconds just for
TGUI to download all the packages. Afterwards, it's the same.
## Changelog
## About The Pull Request
Added a catch handler to the dreamseeker.js topic call which removes the
client from the global register if the topic call results in
`ECONNREFUSED` (i.e. the client closed). Allows the dev server to be
left open in the background between game restarts
## Why It's Good For The Game
Better developer experience
Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
## About The Pull Request
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))
I made a few exceptions for bundled and generated files
## Why It's Good For The Game
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
## Changelog
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->
## About The Pull Request
a) updates some dependencies in the project, hopefully fixing this
server lockup bug
b) if a. does not fix it, this uses two separate build methods for tgui.
it's kind of gross, I really dislike that this needs to exist, but
experimental css breaks tgui-dev and css-extract breaks tgui live.
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
## Why It's Good For The Game
So the server doesn't lock up sometimes
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
## Changelog
<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->
## About The Pull Request
The dev server has had an issue where it required devs to press F5 just
to link in for quite some time. Now with 516, it required F5 for *every*
update and would bluescreen at random due to a css issue. This PR fixes
those problems, making the dev server hook in and load updates like it
should. It's interesting to see that both the 515 issue and the 516
issue were simple url problems that have compounded in the same place.
If you're on a downstream and wish to make this change without the
additional typings and conversions to esm, it's just the url - there's
an extra slash in the base url and the dummy file must be dummy.htm /
dummy.html.
Other changes:
- bumps rspack minor version
- readds file system caching that was on webpack
- removes a deprecated module w/ warnings
- converts the debug tgui kitchensink to TS
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
## Why It's Good For The Game
The tgui dev server should work
Fixes#89387
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
## About The Pull Request
Old project that I have been waiting on for some time. We can swap out
our javascript bundler with a rust version. We still have webpack to
some extent because sass-loader requests it, but it's unused.
This was originally suggested by stylemistake years ago but it depended
on tgui using a modern browser #90397 and rspack supporting yarn pnp
https://github.com/web-infra-dev/rspack/pull/7639.
I want to also replace jest with vitest for this PR since it's deep
internals and no one else is really tinkering here. Drafting for now
## Why It's Good For The Game
Both of these tools are the drop in replacement of the modern decade
Makes the dev server borderline instant
https://rspack.dev/misc/faq#what-are-the-advantages-of-rspack-compared-to-webpack--swc-loader
## Changelog
## About The Pull Request
> [!IMPORTANT]
> This PR need's a tgui-core v2 release
> Until then, and until I'm sure everything is fine and I'm satisfied,
PR will be in the draft.
> Also TestMerge would be useful as there are quite a lot of changes and
I might have made a mistake somewhere
Moving all SCSS variables to 21th century technology - [CSS
Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/var)
All variables are taken from and depend on tgui-core. However, you are
free to create completely new variables as well as tgui-core-dependent
variables.
This step gives you much more flexibility when creating themes and
manipulating colors
For more details, go
[here](https://github.com/tgstation/tgui-core/pull/112)
Also a few little things:
- Links in chat got a new colors and no underline on hover
- TGsay scrollbar replaced with thin default scrollbar
### Themes
Some themes started to look a little different, as well as more
coherent, since the replaced color changes in all components, not just
the imported ones
<details> <summary> Examples </summary>
Terminal
| Before | After | Before - KitchenSink | After - KitchenSink
| - | - | - | - |
|

|

|

|

|
NTOS95
| Before | After | Before - KitchenSink | After - KitchenSink
| - | - | - | - |
|

|

|

|

|
</details>
These are not all the themes that have received improvements, but in the
rest of them they are small
There may also be bugs, so TestMerge is highly recommended
### TGchat unread counter
I've made some changes into the chat tab unread coutner, you can see it
bellow
It now takes up no space in the tab and has absolute positioning in the
top right corner

### TODO
- [x] Migrate all themes to CSS Variables
- [x] Migrate all UI styles to CSS Variables
- [x] _Test everything I can get with my hands on to make sure nothing
is missing or broken_
Also, I think in the future it would be good to drop color.scss,
base.scss and functions.scss files from the repository and use tgui-core
files.
### Removed as unused style files
I can't find any defined in it classes as used
1. PersonalCrafting.scss
2. TachyonArray.scss
3. UtilityModulesPane.scss
## Why It's Good For The Game
All compiled styles have a much smaller size, as there is no need to use
SCSS to compile themes, in fact it is enough just to change the values
of variables
It also gives you the ability to use custom cursors in themes if you
override --cursor-xxx variables
After all themes migration: 763kb -> 210kb tgui.bundle.css
As well as more consistent colors in the theme and the ability to create
MORE diverse themes, of varying degrees of complexity
And... maybe... light theme for TGUI
## Changelog
🆑
refactor: All TGUI styles was migrated to CSS Variables, if you find
something odd in styles, feel free to make an issue on GitHub
/🆑
---------
Co-authored-by: jlsnow301 <jlsnow301@pm.me>
## About The Pull Request
This

Apparently this was connecting http for ie8 support, which we dropped a
long time ago in #79974.
I added some early returns to the code as well
## Why It's Good For The Game
Code cleanup
## Changelog
n/a
## About The Pull Request
Updates some of the dependencies in tgui. Should have zero gameplay
impact at all.
This puts our typescript version up to 5.4.3! And it detected errors
immediately
## Why It's Good For The Game
Bzzz here comes the airplane
## Changelog
N/A
## About The Pull Request
Fixes starting the tgui dev server on Windows machines.
Currently on Windows when starting the tgui dev server, it will be
unable to find the Byond cache at any of the predefined paths it
searches, and resort to using the registry even if one of the predefined
paths should successfully locate it. Then, it will fail to find the tmp#
folder inside that cache folder even if it exists.
The reason is that on Windows, the glob package requires forward slashes
when you call its methods such as sync(), as documented in the glob
module's documentation:
>Note Glob patterns should always use / as a path separator, even on
Windows systems, as \ is used to escape glob characters. If you wish to
use \ as a path separator instead of using it as an escape character on
Windows platforms, you may set windowsPathsNoEscape:true in the options.
In this mode, special glob characters cannot be escaped, making it
impossible to match a literal * ? and so on in filenames.
The function being used to assemble the path, node's path.resolve(),
uses backslashes if you call it on a Windows platform. It does not
accept any arguments to alter this, nor are there any
delimter-conversion functions in the path package. There is an
alternative to change the delimiter, forcing POSIX-style path.resolve()
by calling path.posix.resolve(), however this removes the drive letter
and does not work as a valid path on Windows.
For example:
What we need to pass to globPkg.sync():
`C:/Users/SomeName/Documents/Byond/cache`
What path.resolve() returns: `C:\Users\SomeName\Documents\Byond\cache`
What path.posix.resolve() returns:
`/Users/SomeName/Documents/Byond/cache`
Unfortunately there is not a method in the node path module to return
what we need. Instead, we use the workaround provided in glob's
documentation and add the windowsPathsNoEscape option. This COULD have a
negative effect when searching for * and ? literals, however a search of
resolveGlob() callers shows that none of them do this. * and ? in all
callers is intended to be a wildcard, not a literal, so this won't have
any impact on anything.
## Why It's Good For The Game
Helps development efforts for developers using Windows.
## About The Pull Request
Went through tgui:sonar to search for bugs. Some of these are valid -
they've been addressed. Others, not so. Telling me I need to make icon
names and css classes into constants is a nit at best. Radar seems to be
bugged in certain areas: Classnames ok to dupe, but not ones with
conditionals. Most of the function duplication errors rely on hooks.
I think this should close#79815 and we should remove radar shortly
after. See my comment
[here](https://github.com/tgstation/tgstation/issues/79815#issuecomment-1859286784)
## Why It's Good For The Game
Fixes#79815
## Changelog
N/A none of this was player facing
## About The Pull Request
General maintenance for eslint + adds an autofix for import sorting
If you're a reviewer/downstream, don't worry s'much about the file diff,
these are automated changes. To port this is pretty simple:
- `cd tgui`
- Update other packages (optional)
- `yarn add eslint-plugin-simple-import-sort`
- Add linter rules: eslintrc.yml
[guide](https://github.com/lydell/eslint-plugin-simple-import-sort?tab=readme-ov-file#usage)
&& file format rules to eslintignore
- `yarn eslint packages --fix`
Done!
## Why It's Good For The Game
Dev exp ++
## Changelog
N/A nothing player facing
## About The Pull Request
Oh god the file diff... I'm so, so sorry.
No need to worry though. This just replaces the prettierx version that
we were using and replaces it with normal prettier. Most of the settings
were default or no longer valid with this version.
## Why It's Good For The Game
You no longer get this warning #70484
It actually drives me up the wall and I have to click it each time I
open my editor.
## Changelog
N/A nothing player facing
## About The Pull Request
Moves us from Inferno 7.4.11 to React 18.2. This is a big project! You
might find errors here. Sometimes I get carried away fixing external
issues, I'll try to atomize them into separate PRs.
- [x] Implements React
- [x] CSS kebab to camel case
- [x] Some typescript refactors
- [x] Atomize what I can
- [x] Fix dropdowns (opens in the wrong location)
- [x] Fix wonky button placement in a few UIs
- [x] Cleanup
## Why It's Good For The Game
- It'd be nice to just have real hooks. Our implementation is probably
the best possible for Inferno, don't get me wrong.
- React is just easier to maintain and easier to read. It's the web dev
standard.
Closes#78221
## Changelog
🆑
refactor: TGUI V5: The UI has had its entire engine replaced with React
v18.2. This might cause obvious or laughably broken UIs in places you
wouldn't expect. Please report any issues you find to the repo!
/🆑
---------
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->
## About The Pull Request
We currently transpile TGUI down into ie8. This was primarily for Linux
compatibility, which, to my understanding, hasn't worked for quite some
time. As we approach 2024, consider that ie8 is nearly 15 years old and
had its support ended in 2016. I believe sunsetting ie8 is in order.
>I have no objections to remove IE8 support and fully target IE11.
https://github.com/tgstation/tgstation/issues/79943#issuecomment-1826735705_
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
## Why It's Good For The Game
- Probably improves performance to some degree, you're only as slow as
your weakest link.
- Reduced maintenance burden
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
## Changelog
<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->
N/A if they can even see this message it doesn't affect them
<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
## About The Pull Request
Glob package wasn't resolving tmp folder. Javascript does not clue you
in that the arguments have changed at all. I downgraded the package and
it works.
## Why It's Good For The Game
Dev server is 100% confirmed working I swear if it breaks again I
will... I will...
## Changelog
N/A nothing player facing
## About The Pull Request
Woah! Shiny!
Updates most of tgui's internals. Nothing player facing. Tested and
working
## Why It's Good For The Game
Good housekeeping
## Changelog
N/A nothing player facing
## About The Pull Request
- the .js extensions were required, this is my fault.
- fixes a crash "automatic publicPath is not supported in this browser"
## Why It's Good For The Game
Bug fixes. Dev server is working
## Changelog
N/A nothing player facing
## About The Pull Request
A quirk of vite is that it prefers jsx-returning javascript files to be
aptly named *.jsx
Where it was free, I switched the file to .ts. Notably, there are no
constants.js anymore (huzzah for tab completion)
## Why It's Good For The Game
Smooth upgrade?
## Changelog
N/A nothing player facing
## About The Pull Request
The largest change to this is that it updates typescript from 4.3.5 to
4.9.4.
It also does some QoL to update @ types, yarn version, and
typescript-eslint-parser (OPTIONAL)
I did this by:
1. Updating typescript `yarn add typescript`
2. Updating other types `yarn add @types/...`
3. Repackaging typescript (and other) workplace sdks `yarn dlx
@yarnpkg/sdks`
4. Updates yarn via corepack `yarn set version stable`
5. Fixes a couple places where typescript was mad
## Why It's Good For The Game
- I want to do things like make discriminating type unions
- Huge leap into typescript so I can better type out tgui core
- TS >>> JS
## Changelog
N/A Nothing player facing
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
## About The Pull Request
Makes the dev server actually work on 514 again by reverting a removal
in reloader.js!
#71161 didn't take into account that we still use 514 in their TGUI
edits. Pain.
## Why It's Good For The Game
TGUI dev server works again, this is a good thing, I think!
## Changelog
Not player facing!
Makes the code compatible with 515.1594+
Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword
And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.
@tgstation/commit-access Since the .proc/stuff is pretty big change.
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
## About The Pull Request
**Upgrades:**
- Yarn 3.0
- TypeScript 4.3
- Sass 1.37
- Required some refactoring of `/` into `math.div()` in CSS
**Dependency removals:**
- Removed ESM package, see: https://github.com/standard-things/esm/pull/902
I initially thought it was impossible to stop relying on this package, but fortunately, ES module support in Node 12+ now comes standard and I only had to convert the very few external module imports to `require()` (because Yarn PnP).
I also moved `logging.js` directly into `tgui-dev-server` package, because that's where it is used. One less internal dependency.
**Sidegrades:**
- Removed creation of a common tgui chunk, because in practice it creates unnecessary complexity (devs sometimes get a white screen due to this chunk being invalid) and doesn't really save that much data on CDN, and **definitely** doesn't make tgui load faster.
I think that is all. I tested it a bit and everything seemingly works.
* Fix finding of dreamseeker instances and not die on cache copy failures
* Upgrade dependencies, resolve webpack dependencies explicitly
* Preload tgui asset to fix reloading of a not yet sent tgui asset
* Rewrite node bootstrap and DM build task
* Redundant array accessor
* Add install-state.gz to tgui build dependencies
* Update build.js
* Use a proper dmlang vscode var
Fixes#56237
Unblocks #56704
Besides fixing the above mentioned issue with ExoFab UI, I fixed a few tgui component bugs and added a few improvements. Not really atomizable, sorry.
Section changes
level property is now gone, section level is automatically calculated.
Nested sections automatically become transparent.
Nested sections are now properly incapsulated and won't inherit properties of parent sections.
This allows using nested non-scrollable sections, while parent is, for example, scrollable.
Tabs changes
Tabs without a parent section will pretend they are a section (and will look as such, with dark background).
Top corners of tabs are a bit rounded to make it look more like a tab.
Background color for selected and hovered tabs (previously it was just an underline).
2px margin around the tabs, to make them stand out a bit from the section background.
Two new props:
fill - Same as <Section fill>
fluid - Tabs use full width of the container.
scrollable property was not implemented because it's a bit complicated (requires converting it into a class, registering its scrollable node with tgui, etc). If you need scrollable, just wrap tabs with a Section like a good man.
Refactoring of Flex, Fix Section scrollable
Getting presets working
wip
Upgrade dependencies
preset notice, tooltip fixes, pod spawnlocation fixes
finishes UI, final polish
quells one travismoment
Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
better var names
better vars
sound for loop
Further review addressing
runtime fixes
Update code/modules/asset_cache/asset_list_items.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
More review addressing
tgui merge
why was that there
Small improvements
Small Improvements Part 2
dropoff / wall moving improvements
compile!
more fixes
This pull request upgrades Yarn to version 2 (also known as Yarn Berry).
* Update build validator
* Provide inferno in the root level package
* Remove type module from package.json
* Powershell build script
This PR changes the message pipeline a little bit to support list-based messages, which can be annotated with custom data. Function signature of to_chat was slightly changed as well:
// Plain text message
to_chat(client,
type = MESSAGE_TYPE_INFO,
text = "foo")
// HTML message
to_chat(client,
type = MESSAGE_TYPE_INFO,
html = "<span class='notice'>foo</span>")
Old to_chat format is still supported, but handle_whitespace, trailing_newline and confidential flags have no effect. confidential flag could still be revived though, if there is enough merit in it, for example to filter out confidential messages when saving a chat log.
The reason for using /list and not /datum, is because lists are plain faster, and there are minimal data transformations - these lists are fed directly to json_encode and sent to tgchat.
Plain text messages do not need to be HTML-escaped, which makes them safer and more performant than HTML messages. Plain text messages can be made interactive (or formatted with CSS) by custom-handling them in javscript based on message type and annotations.
It would be impossible to annotate every single message in the game (at the moment of writing, there are 9447 to_chat calls in the code), but it could be done selectively, for only those messages that are hard to classify by span classes (and there are still A LOT of them).
Please annotate more messages. Thank you.
Fixes#52943Fixes#52908Fixes#52816
Changelog
cl
add: tgchat: Unread message count is now smarter and won't increase on other tabs if you have already read the same message in the active tab.
add: tgchat: Admin PMs are now properly annotated and can be filtered into separate tabs.
fix: tgchat: Fix: Highlighted message overlay no longer blocks clicks. Clicking a highlighted (F) link should work as it should.
fix: tgui: Fixed NTOS bluescreen due to calling .includes() on a stylesheet href which could be null on certain browsers.
code: tgchat: Chat schema bumped to version 5. All chat-related settings were reset to avoid breakage.
/cl
Replaces goonchat with a tgui based chat panel
Fixes#52898Fixes#52663
It is as fast as goonchat was (if not faster in certain circumstances), and is very extensible. It has all the necessary code for sorting messages into categories, which means that one of the next features will be multiple tab support.
Additional features that you will get with tgchat right now:
Massively faster server-side performance compared to goonchat, especially if batching multiple messages to one client.
Message persistence across rounds and reconnects. (All messages are stored client-side in IndexedDB)
More robust scroll tracking. If you scroll up, it will not change the scroll position on new messages like goonchat did.
Multiple message combining. (Currently set to combine up to 5 messages over last 5 seconds).
If using the highlighting feature, it highlights the whole message as well as the matching word.
"Now playing" widget, with preview of the song title, a knob for adjusting the volume and a stop button.
Architecture is as following:
```
to_chat() -+
|
SSchat
(queue, batching)
|
window.send_message()
|
v
+-------------+
| tgui-panel |
|+-----------+|
|| tgchat ||
|+-----------+|
+-------------+
```
Subsystem is basically goonchat, but without all the garbage that slows the servers down (string concatenation, double urlencoding, sanitizing, etc). Now, instead of all that, it's being slowed down by json_encode in /datum/tgui_window/proc/send_message, which IMO is completely worth it, and allows sending various templates and widgets to tgchat.
/datum/tgui_window abstracts the whole window away from you, establishes a nice message-passing interface between DM and JS, with two message queues on each side, automatically loads js/css assets for you, basically does everything. You as a developer only have to worry about sending/receiving messages and write javascript.
tgui-panel is a slimmed down version of tgui, and functions as a container for various widgets, and tgchat is one of them. It of course can be expanded with more stuff.
It's also a separate entry point and a JS bundle, so it's not bloating the main tgui bundle, and is currently sitting at about 230kB.
* MIT license headers
* various tweaks
- Tweak jsdoc headers a bit
- Use an old-school format with SPDX-License-Identifier for SCSS
- Add headers to tgui dmcode
* Simplify the license section
* Rebuild tgui, small tweaks
Co-authored-by: ZeWaka <zewakagamer@gmail.com>
About The Pull Request
All relevant source code now contains copyright headers, that explicitly assert copyright and license for every file.
This has been done to prepare TGUI for wider adoption. Goon station devs are interested in using TGUI, and hopefully this will result in a nice collaboration and improvements to both codebases.
The following files were relicensed under MIT:
code/controllers/subsystem/tgui.dm
code/modules/tgui/*.dm
tgui/**/*.js
tgui/**/*.scss
The following files were kept untouched:
tgui/packages/tgui/interfaces/**/*.js
tgui/packages/tgui/styles/interfaces/**/*.scss
Project is still basically AGPL-3.0 under /tg/station's parent license (with added MIT texts), but allows importing MIT code into MIT-compatible codebases.
* Initial work on tgui conversion for DNA Consoles
* Some initial button logic complete
TODO: Scanner Open button should disable while scanner is locked
TODO: Scramble DNA should disable while on cooldown
* Tabs for the tab God
* Dropdown changes, genetic sequencer modifications
* Mutation and genetic sequencer functionality
Almost complete. Need to implement Advanced Injectors still.
* Mostly done, converted most of genetic makeup code
* Tactical pocket linting
* More changes
* Everything except advanced injectors complete
* First complete alpha version
* Fixed debug/testing change
* Removal of more debugging code
* Fix pulse bug
* Bugbusters
* Fix for accidental changes
* Fix broken genetics disk changes, fix list of lists
* Squash tgui tab-key bugs and clean up attackby
* Code documenting, refactoring, bugfixing, spellcheck
* Documentation and misc bug squashes and runtime error fixes
* Fixes, features and tweaks
* Special check for those who have shuffled off this mortal coil
* New interface concept for console storage
* Mini code refactor
* Massive refactoring of DnaConsole interface (WIP)
- De-spaghettifying of LawyerCode
- Fixed the flex-basis bug, and removed ForcedBox since it's no
longer needed.
- Added a Divider component.
* Implemented requested changes.
Removed list() versions of strings.
Removed used TGUI-exclusive constants from data object. Currently unused ones still remain, can be removed if they're no longer necessary.
Fixed other DM data structures to serialise as JS Arrays instead of Objects.
Minor TGUI logic fixes for various edge cases.
Added some comments in DnaConsole.js outlining some minor notes and TODOs.
* Fixes "Save to X" being disabled.
* Included 2px outline CSS
* Additional minor logic patches
Don't want certain buttons active unless the mutation relation to them is also active
* Makes these transforms use a timer
* Fixed transformation race condition and stuff.
* Mutation source defined in DM. Conditional formatting improvements.
* Custom cache directory with BYOND_CACHE env var
* Fix gene cycler on index of -1
* Framework and TODO for next interface element. Cleared TODO list a bit.
* Fix 1px shift in gene cycle buttons
* Pass raw event with GeneCycler
* More robust combining logic
* Fix some cycler bugs, start working on enzymes
* Conditional highlighting for unsolved mutations and X'd genes.
* Lint for the Lint God
* Enzyme UI and more refactoring incoming
* Finish tgui refactoring, enzymes injectors done
* Whack-a-Bug
* Unlinted. Advanced injectors moved and improved. Implemented disk genetic data readout.
* Partial linting
* Assorted bug fixes
* Remove debugging code
* DNA Consoles are now more conversational. Initial state set.
* Final tweaks, implemented mutation combining, complete?
* Fixes tooltop, re-enables delayed enzyme transfer, cleans up some data params
* 10 Fix a bug, 20 make a bug, 30 goto 10
* The definition of irony
* Don't drink and derive, kids || How I learned to stop coding while drunk and rely on stylemistake to Flex on my formatting.
* uniqBy
* Add support for dropdowns with disabilities.
* Cleanup
* Remove current mutation from combinations
* Dividing
* Document BYOND_CACHE env var
* Outline cleanup
* Declare radiation constants since they were removed in DM
* Combine mutations only after checking for null
* Advanced Injectors actually work now.
* Comment cleanup, DMDOC, stard and end processing at appropriate times
* Pressing Ctrl-S occasionally helps things
* Fix enzyme mutator timeout bug, added injector timeout display.
* Rebuild tgui
* Rebuild tgui
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: spookydonut <github@spooksoftware.com>