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

Various Improvements to NanoChat #2922

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Toby222
Copy link
Contributor

@Toby222 Toby222 commented Feb 7, 2025

About the PR

  • Better notifications
    • Notifications get sent without NanoChat open
    • Notifications get sent when you're on another chat
    • Notifications include sender's job
    • Muting specific contacts
  • Allow editing contacts
  • Better notifications
  • Editing contacts
  • Make NanoChat UI nicer to use
    • Enter to send
    • Tab to switch fields
    • Keybinds for switching channel

Why / Balance

NanoChat as-is is still not very nice to use. These changes should ideally make it a good alternative communication method to trying to call out people in common.

Technical details

Some ported from:

Media

2025-02-08.01-36-20.mp4
2025-02-08.01-43-33.mp4
2025-02-08.01-48-51.mp4

Requirements

  • I have tested all added content and changes.
  • I have added media to this PR or it does not require an ingame showcase.

Breaking changes

  • Several constants relating to NanoChat were moved, removed, or renamed
  • The NanoChatMessage enum got a new member

Changelog
🆑

  • add: NanoChat message notifications will now show you the job title of the sender alongside their name.
  • add: NanoChat now lets you edit contacts.
  • add: Enter and tab now work in NanoChat and its popup
  • add: Keybinds for switching chats in NanoChat
  • tweak: The character limits for names and job titles are not consistent between ID cards and NanoChat
  • tweak: NanoChat chat list names/titles and notification titles that are too long will be shortened, indicated with "..." at the end.
  • tweak: Changed the layout of NanoChat buttons
  • fix: NanoChat will now send a new message notification no matter what, so long as you're not currently looking at it.
  • fix: Fixed a issue where users could potentially send NanoChat messages longer than the maximum allowed message length.
  • fix: Fixed being able to create a new chat when you haven't typed in 4 digits in the number field.

@github-actions github-actions bot added size/L 256-1023 lines Changes: UI Changes: C# Changes any cs files Changes: Localization Changes any ftl files labels Feb 7, 2025
Copy link
Contributor

@dvir001 dvir001 left a comment

Choose a reason for hiding this comment

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

Move edit.svg.png under _DV Folders.

@sleepyyapril
Copy link
Contributor

merge is from wizden, i made it, hi

@Toby222
Copy link
Contributor Author

Toby222 commented Feb 7, 2025

merge is from wizden, i made it, hi

I tried to look there but the relevant commits are for NanoChat which isn't on wizden, if I'm not mistaken

@sleepyyapril
Copy link
Contributor

merge is from wizden, i made it, hi

I tried to look there but the relevant commits are for NanoChat which isn't on wizden, if I'm not mistaken

I made them in the PR, silly of me I know

@github-actions github-actions bot added the Changes: YML Changes any yml files label Feb 7, 2025
@Toby222 Toby222 changed the title Port improvements to NanoChat from Einstein-Engines and Goob-Station Various Improvements to NanoChat Feb 7, 2025
@Toby222 Toby222 marked this pull request as ready for review February 8, 2025 00:52
@Toby222 Toby222 requested review from a team as code owners February 8, 2025 00:52
Lyndomen
Lyndomen previously approved these changes Feb 10, 2025
Copy link
Contributor

@Lyndomen Lyndomen left a comment

Choose a reason for hiding this comment

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

Amazing QOL, huge +1

Comment on lines +43 to +46
common.AddFunction(ContentKeyFunctions.NanoChatNavigateUp); // DeltaV - NanoChat keybinds
common.AddFunction(ContentKeyFunctions.NanoChatNavigateDown); // DeltaV - NanoChat keybinds
common.AddFunction(ContentKeyFunctions.NanoChatNavigateUpUnread); // DeltaV - NanoChat keybinds
common.AddFunction(ContentKeyFunctions.NanoChatNavigateDownUnread); // DeltaV - NanoChat keybinds
Copy link
Member

Choose a reason for hiding this comment

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

begin/end instead

Comment on lines +243 to +247
AddHeader("ui-options-header-nano-chat");
AddButton(ContentKeyFunctions.NanoChatNavigateUp); // DeltaV - NanoChat keybinds
AddButton(ContentKeyFunctions.NanoChatNavigateDown); // DeltaV - NanoChat keybinds
AddButton(ContentKeyFunctions.NanoChatNavigateUpUnread); // DeltaV - NanoChat keybinds
AddButton(ContentKeyFunctions.NanoChatNavigateDownUnread); // DeltaV - NanoChat keybinds
Copy link
Member

Choose a reason for hiding this comment

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

.

@@ -229,6 +290,15 @@ private void HandleToggleMute(Entity<NanoChatCardComponent> card)
UpdateUIForCard(card);
}

private void HandleToggleMuteChat(Entity<NanoChatCardComponent> card, NanoChatUiMessageEvent msg)
{
Log.Debug($"Toggling mute for chat #{msg.RecipientNumber:D4} on card #{card.Comp.Number:D4}");
Copy link
Member

Choose a reason for hiding this comment

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

gamer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What does this mean?

Comment on lines +604 to +607
private static string Truncate(string text, int maxLength, string overflowText = "...") =>
text.Length <= maxLength
? text
: text[..(maxLength - overflowText.Length)] + overflowText;
Copy link
Member

Choose a reason for hiding this comment

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

put this in shared so ui doesnt copy paste it

Comment on lines +27 to +30
public static readonly BoundKeyFunction NanoChatNavigateUp = "NanoChatNavigateUp"; // DeltaV - Keybinds for NanoChat
public static readonly BoundKeyFunction NanoChatNavigateDown = "NanoChatNavigateDown"; // DeltaV - Keybinds for NanoChat
public static readonly BoundKeyFunction NanoChatNavigateUpUnread = "NanoChatNavigateUpUnread"; // DeltaV - Keybinds for NanoChat
public static readonly BoundKeyFunction NanoChatNavigateDownUnread = "NanoChatNavigateDownUnread"; // DeltaV - Keybinds for NanoChat
Copy link
Member

Choose a reason for hiding this comment

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

begin/end comments

Comment on lines 173 to +174
# DeltaV - Swap Hands Reversed End
# DeltaV - NanoChat keybinds Start
Copy link
Member

Choose a reason for hiding this comment

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

remove middle comments and change outer to Begin DeltaV Additions / End DeltaV Additions
no reason to have separate comments for 1 thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes: YML Changes any yml files S: Needs Review size/L 256-1023 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants