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
Tgchat and tgui4.3 #8343
Tgchat and tgui4.3 #8343
Conversation
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 #52943 Fixes #52908 Fixes #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
Makes the game screen bigger by removing the status bar and moving the chat bar Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
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
Changelog status: ✔️ |
А эту проверку я уже не починю, сборка tgui штук изменилась, а тест старый. А не, на тг вообще этот тест похоже перестали использовать когда-то. |
КАК ЖИТЬ БЕЗ ЭМОДЖИ? |
Ты можешь в этом же ПРе переписать тест, чтобы гх экшонсы всё сделали нормально. |
FIX UI ломает чат. |
Возможна такая-же проблема с одним Flex.Item мафии, но у меня на локалке мафия вообще не робит (возможно проблема с версией node js). |
Так же, я заметил одно интересное поведение, которое довольно неприятно. Админский чатик по дефолту на F5. Если кликнуть по зоне, выделенной красным, то чатик рефрешится и пропадают некоторые стили и впринципе неприятно. Но если кликнуть по зоне с текстом, то ф5 уже не работает и можно спокойно общаться |
Я, если честно, не помню как было раньше, но вроде как, раньше текст после имени куклы был не черным, а тоже синим. |
f5 похоже бьёндовское обновление окон (или кнопка обновления браузера т.к. браузеры на неё обновляют страницу). И у меня получилось обновить так и в зоне чата. |
А разве нельзя из реакта хендлить нажатие кнопок и таким образом переопределить F5? Я думаю, что это как-то можно обойти. |
Я в реакт настолько не умею, это первое, второе, я не уверен что вообще возможно блокировать передачу кнопок браузеру. Типо, это не безопасно для пользователя, и браузеры не должны такое разрешать. |
Тгюи уже блокирует и отправляет избранные кнопки бьенду, смотреть |
Файл там .ts и f5 уже включён. А это значит что f5 проходит и без js-а, особенно учитывая что кнопка работает и на byond окнах и на nanoui. |
Так, никто не против если я ченжлог сделаю всегда цветастым, и останутся только сообщения в чатик и жирный шрифт? |
Че |
Стоило бы написать, в чем именно была проблема. |
Ченжлок меняет цвета, тгчат меняет цвета, остаться должен только 1. |
Впринципе, уже нет смысла от тма |
Описание изменений
Кривовато портирован tgchat вместе с последней версией tgui.
Основные портированные пры:
Между ними парочка фиксов, номера можно найти в коммитах, но не все.
Что НЕ сделано и я умру до того как сам сделаю:
Сделать нормальную чёрную тему. У нас сильно отличаются файлы тем, оставшихся с гунов, так что тгшный не подходит.Улучшить чёрную тему. tgui/packages/tgui-panel/styles/goon/chat-dark.scss .Портировать emoji с оставшегося гун чата (тут искать: code/modules/goonchat/browserassets/) или с тг.Сделать что-то с code/modules/tgui_panel/audio.dm (портировать с тг верб или перестроить под нашу систему).Не портировал tgfont так как не видел смысла, и генерацию всех tgui штук во время сборки.
fixes #8549
Почему и что этот ПР улучшит
ТГ чат.
Авторство
Чеинжлог
🆑 Kalazus