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

ПРОЧИТАТЬ МЕРЕД МЕРДЖОМ [UPSTREAM] #159

Closed
wants to merge 162 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
14e0c3f
feat: HydroCo - Beverage Powders (#2210)
DisposableCrewmember42 Nov 29, 2024
1507ff2
Automatic changelog update
DeltaV-Bot Nov 29, 2024
6ad7f7e
Update RobustToolbox to v237.2.0 (#2317)
MilonPL Nov 29, 2024
52d7863
Meatspike nerf (#2319)
Stop-Signs Nov 29, 2024
8be60b0
Automatic changelog update
DeltaV-Bot Nov 29, 2024
a07cb3b
Rolebanlist command UI (#30827)
sativaleanne Sep 20, 2024
26b36db
Integrate Modern HWID into content
PJB3005 Nov 12, 2024
318b052
Fix sandbox error with new HWID code. (#33461)
PJB3005 Nov 22, 2024
c8bd723
Database SnakeCaseNaming fixes
PJB3005 Oct 29, 2024
917c6e2
glacier ai/robotics update (#2058)
deltanedas Nov 29, 2024
37955f5
Buttery recipe changes (#2321)
CheddaCheez Nov 29, 2024
d0f4226
Automatic changelog update
DeltaV-Bot Nov 29, 2024
5790f5d
Shoko AI & Roboticist Update (#2284)
Unkn0wnGh0st333 Nov 29, 2024
f55ae3f
lighthouse botany/ai/robotics update (#2017)
deltanedas Nov 29, 2024
d9b3859
Beam Devastator (RPG Replacement) and Beam Cannon (research) (#2231)
Stop-Signs Nov 29, 2024
e520731
Automatic changelog update
DeltaV-Bot Nov 29, 2024
d1c682b
Add the gas analyzer to the tools module (#2324)
Radezolid Nov 30, 2024
9fb6c66
Automatic changelog update
DeltaV-Bot Nov 30, 2024
66d9012
Buff Aloxadone (#2318)
Kr8art Nov 30, 2024
3282045
Automatic changelog update
DeltaV-Bot Nov 30, 2024
fb05ea9
Updates Micro station (#2181)
Colin-Tel Nov 30, 2024
0da43eb
Edge AI Update (And more!) (#1987)
therealDLondon Nov 30, 2024
9a08d91
Automatic changelog update
DeltaV-Bot Nov 30, 2024
7055c05
Map Updates: Arena (#2138)
IamVelcroboy Nov 30, 2024
4fdf2f5
The hive ai (#2188)
IamVelcroboy Nov 30, 2024
92e837c
Automatic changelog update
DeltaV-Bot Nov 30, 2024
1d38ee6
Asterisk AI Update 2 (#2325)
Colin-Tel Nov 30, 2024
4ab7975
Map Edits: Tortuga (#2296)
IamVelcroboy Nov 30, 2024
7e55241
Map Edits: Hammurabi (#2311)
IamVelcroboy Nov 30, 2024
dc57afd
Automatic changelog update
DeltaV-Bot Nov 30, 2024
0e2bc19
Justice Airlock Changes (#2326)
IAmNotGray Nov 30, 2024
571b132
Update Pebble, including Station AI (#2293)
Samsterious Dec 1, 2024
3ea547b
Automatic changelog update
DeltaV-Bot Dec 1, 2024
facb6c0
enable AI (#2018)
deltanedas Dec 1, 2024
557c3a9
Automatic changelog update
DeltaV-Bot Dec 1, 2024
f8a1cc5
Update Credits (#2328)
github-actions[bot] Dec 1, 2024
a13d423
add the roboticist job (#2029)
deltanedas Dec 1, 2024
0dbbe65
Automatic changelog update
DeltaV-Bot Dec 1, 2024
a42395e
fix arena and hive (#2331)
deltanedas Dec 1, 2024
2080df5
nuke firelock electronics price (#2330)
deltanedas Dec 1, 2024
54bf615
fix edge (#2332)
deltanedas Dec 1, 2024
2c1a061
replace antimov board with overlord for traitors, made it expensive (…
deltanedas Dec 1, 2024
32a9dd4
Automatic changelog update
DeltaV-Bot Dec 1, 2024
935562c
fix factorio test (#2334)
deltanedas Dec 1, 2024
8117ce5
remove invalid from pebble (#2333)
deltanedas Dec 1, 2024
41a70be
add robotics to id card console (#2335)
deltanedas Dec 1, 2024
77c5f01
Automatic changelog update
DeltaV-Bot Dec 1, 2024
bde3c04
something something fix pebble (#2336)
MilonPL Dec 1, 2024
aad9b24
ai law changes + ion storm (#2338)
deltanedas Dec 1, 2024
027df56
borg slavery :fire: :fire: :fire: (#2337)
deltanedas Dec 1, 2024
7c0e5aa
Automatic changelog update
DeltaV-Bot Dec 1, 2024
7f608b6
Superweapon Safe and spawner (#2322)
Stop-Signs Dec 1, 2024
6604ec6
Add mercenary outfit to clothesmate (#2306)
Kr8art Dec 2, 2024
4cc0fca
Automatic changelog update
DeltaV-Bot Dec 2, 2024
6cb9037
DeltaV unique AI Names (#2345)
therealDLondon Dec 2, 2024
70ee6f3
Automatic changelog update
DeltaV-Bot Dec 2, 2024
03f9649
Adds Silicon Rules (#2344)
Colin-Tel Dec 2, 2024
a4cac04
Automatic changelog update
DeltaV-Bot Dec 2, 2024
9ecf70b
Silicon Rule Hotfix (#2350)
Colin-Tel Dec 2, 2024
a0beaf4
Gives AI Delta V radio channels (#2352)
Emily9031 Dec 3, 2024
fd93054
Automatic changelog update
DeltaV-Bot Dec 3, 2024
8c56c60
Update "snipers" to require weilding (#2353)
BlitzTheSquishy Dec 4, 2024
4f00a3c
Automatic changelog update
DeltaV-Bot Dec 4, 2024
04a33dc
dont give AI a fugi report (#2363)
deltanedas Dec 4, 2024
20cb202
Automatic changelog update
DeltaV-Bot Dec 4, 2024
ecc378e
fix tidy_map.py (#2364)
MilonPL Dec 5, 2024
37ee718
Added warp points to shipyard shuttles + removed two invalids (#2360)
Radezolid Dec 5, 2024
ab7a8f0
Adds sprite to superweapon spawner (#2368)
IamVelcroboy Dec 5, 2024
95ea9e2
fix notary stamp objective never happening (#2358)
deltanedas Dec 5, 2024
7c74034
Automatic changelog update
DeltaV-Bot Dec 5, 2024
958808c
Updates Logi and Epi dept signs for server consistency (#2366)
IamVelcroboy Dec 5, 2024
c138f8d
Automatic changelog update
DeltaV-Bot Dec 5, 2024
26201a1
Map Edits: Tortuga (#2365)
IamVelcroboy Dec 5, 2024
fbdc55e
Make medical borgs able to fly in space (#2339)
Emily9031 Dec 6, 2024
60f3949
Automatic changelog update
DeltaV-Bot Dec 6, 2024
868297b
mail carrier hood. AAAAAAAAAAAAH!! (#2113)
Monotheonist Dec 6, 2024
6780806
Observation Bundle Modifications (#2288)
Avalon-Proto Dec 6, 2024
bdc0a52
Automatic changelog update
DeltaV-Bot Dec 6, 2024
2698e89
Add a foam sabre (#2310)
Radezolid Dec 6, 2024
a2c5a83
Automatic changelog update
DeltaV-Bot Dec 6, 2024
cc23335
remove unnecessary migrations (#2386)
MilonPL Dec 7, 2024
2b6243b
Give Central Command more Hallways (#2174)
Lyndomen Dec 7, 2024
764602a
Automatic changelog update
DeltaV-Bot Dec 7, 2024
86b893f
Adds meteor shielding to Asterisk (#2377)
Colin-Tel Dec 7, 2024
c623405
Automatic changelog update
DeltaV-Bot Dec 7, 2024
203ec26
Grey & Wooden Railings (#2379)
rosieposieeee Dec 7, 2024
24cbd06
Automatic changelog update
DeltaV-Bot Dec 7, 2024
1e1b47f
Add Reinforced Directional Tinted Window (#2376)
rosieposieeee Dec 7, 2024
7add23d
Automatic changelog update
DeltaV-Bot Dec 7, 2024
190030e
Update Credits (#2392)
github-actions[bot] Dec 8, 2024
6098390
change up and add ninja objectives (#2359)
deltanedas Dec 8, 2024
fd429b4
Automatic changelog update
DeltaV-Bot Dec 8, 2024
dabe904
Randomizes the appearance of Fugitives (#2383)
Monotheonist Dec 9, 2024
461549c
Automatic changelog update
DeltaV-Bot Dec 9, 2024
bd23e0f
Build Diona Different (#2204)
Lyndomen Dec 9, 2024
6ced034
Automatic changelog update
DeltaV-Bot Dec 9, 2024
13c1e01
aac tablet refactor (#2401)
MilonPL Dec 9, 2024
88b47d2
Derotates Micro (#2402)
Colin-Tel Dec 9, 2024
746b6c8
Automatic changelog update
DeltaV-Bot Dec 9, 2024
b5ee0f4
Automatic ACO procedure (#2351)
ewokswagger Dec 9, 2024
53ebfe8
Automatic changelog update
DeltaV-Bot Dec 9, 2024
28f16b6
make lathe items worthless (#2406)
MilonPL Dec 10, 2024
16c08f8
Automatic changelog update
DeltaV-Bot Dec 10, 2024
3a1c59e
Update CODEOWNERS (#2403)
MilonPL Dec 10, 2024
3fe460c
fix diona speed (#2413)
MilonPL Dec 10, 2024
5d7e6bd
Automatic changelog update
DeltaV-Bot Dec 10, 2024
8829c54
add lavaland real (#2380)
deltanedas Dec 10, 2024
140fc65
Automatic changelog update
DeltaV-Bot Dec 10, 2024
2c65179
pda messaging real (#2362)
MilonPL Dec 10, 2024
31964b6
Automatic changelog update
DeltaV-Bot Dec 10, 2024
9e510f0
Make the shadow cat a ghost role (#2417)
Radezolid Dec 11, 2024
77f96e7
Automatic changelog update
DeltaV-Bot Dec 11, 2024
dd6675d
fix "teach person a lesson" (#2412)
MilonPL Dec 12, 2024
86e6782
Automatic changelog update
DeltaV-Bot Dec 12, 2024
1227893
Allow jetpacks to fit in the suit storage slot (#2400)
Radezolid Dec 12, 2024
2bf19cf
Automatic changelog update
DeltaV-Bot Dec 12, 2024
e1efe46
Map Edits: Arena, Hive, Hammurabi (#2357)
IamVelcroboy Dec 12, 2024
9c3e4f7
Automatic changelog update
DeltaV-Bot Dec 12, 2024
9db6651
Auto ACO Procedure bug fixes (#2424)
ewokswagger Dec 12, 2024
cb8df8c
Modify clown and mime sexy masks and add them to the autodrobe (#2346)
Radezolid Dec 12, 2024
34f47cb
Automatic changelog update
DeltaV-Bot Dec 12, 2024
21dd83c
Make LO know at least the basics of cargo tech. (#2399)
Radezolid Dec 12, 2024
dacfbb7
Automatic changelog update
DeltaV-Bot Dec 12, 2024
fbbb2ad
CentCom Map HotFix (#2396)
Lyndomen Dec 12, 2024
019cc24
fix mining shuttle not docking on small stations (#2430)
deltanedas Dec 12, 2024
45ab87a
Automatic changelog update
DeltaV-Bot Dec 12, 2024
3b9fa30
fix auto aco timing (#2431)
ewokswagger Dec 12, 2024
6879e50
add mining points (#2419)
deltanedas Dec 13, 2024
9ba78c5
Reduce RE time (#2394)
Stop-Signs Dec 13, 2024
d7e3c04
Automatic changelog update
DeltaV-Bot Dec 13, 2024
2b0b875
Change Overlord Law so no RDM (#2375)
Lyndomen Dec 13, 2024
485ecc5
Delta-V Specific Posters! (#2303)
IAmNotGray Dec 13, 2024
50f87d4
fix lavaland shuttle for real (#2434)
deltanedas Dec 13, 2024
9bef33b
Automatic changelog update
DeltaV-Bot Dec 13, 2024
17443d6
glacier surface update (#2414)
deltanedas Dec 13, 2024
3279b3f
Automatic changelog update
DeltaV-Bot Dec 13, 2024
f28dfeb
Asterisk and Chibi updates (#2416)
Colin-Tel Dec 13, 2024
a7678e3
lighthouse lavaland update (#2415)
deltanedas Dec 13, 2024
d41c00a
Modified djstation and added random intercom (#2390)
Radezolid Dec 13, 2024
0ffb2c2
Make space ruins dirty! (#2423)
Radezolid Dec 13, 2024
956eb51
Automatic changelog update
DeltaV-Bot Dec 13, 2024
a1a26c3
Map Edits: X-Mas (#2433)
IamVelcroboy Dec 13, 2024
3a7fc17
Automatic changelog update
DeltaV-Bot Dec 13, 2024
49d6731
Edge Fixes + Minor Updates (#2420)
therealDLondon Dec 13, 2024
f66f410
fixup
Dec 13, 2024
d8c0cfd
Edge Christmas Update, but fixed (#2436)
therealDLondon Dec 13, 2024
296c728
Colin Xmas Map update (#2435)
Colin-Tel Dec 13, 2024
437a9d6
hwidfix
Dec 13, 2024
453be48
yamlfix
Dec 14, 2024
56c810d
Merge branch 'DeltaV-Station:master' into masterBack
GeneralGaws Dec 14, 2024
e0eb768
add automatic panic bunker (#2437)
deltanedas Dec 14, 2024
d6b5a88
Merge branch 'masterBack' of https://github.com/EndrAnimet/DeltaV-Str…
Dec 14, 2024
0f9b47c
Automatic changelog update
DeltaV-Bot Dec 14, 2024
07f57f8
Update Synth Specialist rules (#2391)
Lyndomen Dec 14, 2024
bcc4ea6
fixChangelog
Dec 14, 2024
b66fc91
Update tortuga.yml
GeneralGaws Dec 14, 2024
2e1d6f3
Update edge.yml
GeneralGaws Dec 14, 2024
abda95e
Update play_time_trackers.yml
GeneralGaws Dec 14, 2024
9bad455
Update roboticist.yml
GeneralGaws Dec 14, 2024
086b40a
Update loadout_groups.yml
GeneralGaws Dec 14, 2024
7d727a7
Update role_loadouts.yml
GeneralGaws Dec 14, 2024
4e21385
okam
Dec 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ protected override void Open()
_window.OnNameChanged += OnNameChanged;
_window.OnJobChanged += OnJobChanged;
_window.OnJobIconChanged += OnJobIconChanged;
_window.OnNumberChanged += OnNumberChanged; // DeltaV
}
Comment on lines +29 to +30
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add event handler cleanup

The number change event subscription should be cleaned up when the interface is closed.

protected override void Open()
{
    base.Open();

    _window = this.CreateWindow<AgentIDCardWindow>();

    _window.OnNameChanged += OnNameChanged;
    _window.OnJobChanged += OnJobChanged;
    _window.OnJobIconChanged += OnJobIconChanged;
    _window.OnNumberChanged += OnNumberChanged;
}

+ protected override void Dispose(bool disposing)
+ {
+     base.Dispose(disposing);
+     if (!disposing) return;
+     
+     if (_window != null)
+     {
+         _window.OnNameChanged -= OnNameChanged;
+         _window.OnJobChanged -= OnJobChanged;
+         _window.OnJobIconChanged -= OnJobIconChanged;
+         _window.OnNumberChanged -= OnNumberChanged;
+     }
+ }

Committable suggestion skipped: line range outside the PR's diff.


// DeltaV - Add number change handler
private void OnNumberChanged(uint newNumber)
{
SendMessage(new AgentIDCardNumberChangedMessage(newNumber));
}
Comment on lines +32 to 36
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add input validation for number changes

The OnNumberChanged handler sends the new number directly without validation. Consider adding bounds checking or format validation.

private void OnNumberChanged(uint newNumber)
{
+    // Add validation for acceptable number ranges
+    if (newNumber < MIN_NUMBER || newNumber > MAX_NUMBER)
+    {
+        Logger.Warning($"Invalid number value: {newNumber}");
+        return;
+    }
    SendMessage(new AgentIDCardNumberChangedMessage(newNumber));
}

Committable suggestion skipped: line range outside the PR's diff.


private void OnNameChanged(string newName)
Expand Down Expand Up @@ -56,6 +63,7 @@ protected override void UpdateState(BoundUserInterfaceState state)
_window.SetCurrentName(cast.CurrentName);
_window.SetCurrentJob(cast.CurrentJob);
_window.SetAllowedIcons(cast.CurrentJobIconId);
_window.SetCurrentNumber(cast.CurrentNumber); // DeltaV
}
}
}
4 changes: 4 additions & 0 deletions Content.Client/Access/UI/AgentIDCardWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<LineEdit Name="NameLineEdit" />
<Label Name="CurrentJob" Text="{Loc 'agent-id-card-current-job'}" />
<LineEdit Name="JobLineEdit" />
<!-- DeltaV - Add NanoChat number field -->
<Label Name="CurrentNumber" Text="{Loc 'agent-id-card-current-number'}" />
<LineEdit Name="NumberLineEdit" PlaceHolder="#0000" />
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider adding input validation constraints

The NumberLineEdit control should have input validation to ensure only valid numbers are entered. Consider adding:

  • MaxLength="4"
  • HorizontalAlignment="Left"
  • MinWidth to ensure consistent layout
-<LineEdit Name="NumberLineEdit" PlaceHolder="#0000" />
+<LineEdit Name="NumberLineEdit" PlaceHolder="#0000" MaxLength="4" HorizontalAlignment="Left" MinWidth="60" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<LineEdit Name="NumberLineEdit" PlaceHolder="#0000" />
<LineEdit Name="NumberLineEdit" PlaceHolder="#0000" MaxLength="4" HorizontalAlignment="Left" MinWidth="60" />

<!-- DeltaV end -->
<Label Text="{Loc 'agent-id-card-job-icon-label'}"/>
<GridContainer Name="IconGrid" Columns="10">
<!-- Job icon buttons are generated in the code -->
Expand Down
35 changes: 35 additions & 0 deletions Content.Client/Access/UI/AgentIDCardWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ public sealed partial class AgentIDCardWindow : DefaultWindow

private const int JobIconColumnCount = 10;

private const int MaxNumberLength = 4; // DeltaV - Same as NewChatPopup

public event Action<string>? OnNameChanged;
public event Action<string>? OnJobChanged;

public event Action<uint>? OnNumberChanged; // DeltaV - Add event for number changes

public event Action<ProtoId<JobIconPrototype>>? OnJobIconChanged;

public AgentIDCardWindow()
Expand All @@ -37,6 +41,37 @@ public AgentIDCardWindow()

JobLineEdit.OnTextEntered += e => OnJobChanged?.Invoke(e.Text);
JobLineEdit.OnFocusExit += e => OnJobChanged?.Invoke(e.Text);

// DeltaV - Add handlers for number changes
NumberLineEdit.OnTextEntered += OnNumberEntered;
NumberLineEdit.OnFocusExit += OnNumberEntered;

// DeltaV - Filter to only allow digits
NumberLineEdit.OnTextChanged += args =>
{
if (args.Text.Length > MaxNumberLength)
{
NumberLineEdit.Text = args.Text[..MaxNumberLength];
}

// Filter to digits only
var newText = string.Concat(args.Text.Where(char.IsDigit));
if (newText != args.Text)
NumberLineEdit.Text = newText;
};
}

// DeltaV - Add number validation and event
private void OnNumberEntered(LineEdit.LineEditEventArgs args)
{
if (uint.TryParse(args.Text, out var number) && number > 0)
OnNumberChanged?.Invoke(number);
Comment on lines +67 to +68
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error feedback for invalid input

The validation silently ignores invalid input. Consider adding user feedback for better UX.

- if (uint.TryParse(args.Text, out var number) && number > 0)
-     OnNumberChanged?.Invoke(number);
+ if (uint.TryParse(args.Text, out var number))
+ {
+     if (number > 0)
+         OnNumberChanged?.Invoke(number);
+     else
+         // TODO: Inject IUserInterfaceManager for showing popups
+         Logger.Warning($"Invalid number input: {args.Text} (must be greater than 0)");
+ }

Committable suggestion skipped: line range outside the PR's diff.

}

// DeltaV - Add setter for current number
public void SetCurrentNumber(uint? number)
{
NumberLineEdit.Text = number?.ToString("D4") ?? "";
Comment on lines +71 to +74
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add input validation for SetCurrentNumber

The method should validate the input number to ensure consistency with the UI constraints.

 public void SetCurrentNumber(uint? number)
 {
+    if (number != null && (number.ToString().Length > MaxNumberLength || number == 0))
+    {
+        Logger.Error($"Invalid number value: {number}");
+        return;
+    }
     NumberLineEdit.Text = number?.ToString("D4") ?? "";
 }

Committable suggestion skipped: line range outside the PR's diff.

}

public void SetAllowedIcons(string currentJobIconId)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/CartridgeLoader/Cartridges/LogProbeUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public override void UpdateState(BoundUserInterfaceState state)
if (state is not LogProbeUiState logProbeUiState)
return;

_fragment?.UpdateState(logProbeUiState.PulledLogs);
_fragment?.UpdateState(logProbeUiState); // DeltaV - just take the state
}
}
28 changes: 24 additions & 4 deletions Content.Client/CartridgeLoader/Cartridges/LogProbeUiFragment.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,30 @@
BorderColor="#5a5a5a"
BorderThickness="0 0 0 1"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Horizontal" Margin="4 8">
<Label Align="Right" SetWidth="26" ClipText="True" Text="{Loc 'log-probe-label-number'}"/>
<Label Align="Center" SetWidth="100" ClipText="True" Text="{Loc 'log-probe-label-time'}"/>
<Label Align="Left" SetWidth="390" ClipText="True" Text="{Loc 'log-probe-label-accessor'}"/>
<BoxContainer Orientation="Vertical" Margin="4 8">
<!-- DeltaV begin - Add title label -->
<Label Name="TitleLabel"
Text="{Loc 'log-probe-header-access'}"
StyleClasses="LabelHeading"
HorizontalAlignment="Center"
Margin="0 0 0 8"/>
<!-- DeltaV end -->

<!-- DeltaV begin - Add card number display -->
<Label Name="CardNumberLabel"
StyleClasses="LabelSubText"
HorizontalAlignment="Center"
Margin="0 0 0 8"
Visible="False"/>
<!-- DeltaV end -->

<!-- DeltaV begin - Adjust column headers -->
<BoxContainer Orientation="Horizontal">
<Label Align="Right" SetWidth="26" ClipText="True" Text="{Loc 'log-probe-label-number'}"/>
<Label Align="Center" SetWidth="100" ClipText="True" Text="{Loc 'log-probe-label-time'}"/>
<Label Name="ContentLabel" Align="Left" SetWidth="390" ClipText="True" Text="{Loc 'log-probe-label-accessor'}"/>
</BoxContainer>
<!-- DeltaV end -->
</BoxContainer>
</PanelContainer>
<ScrollContainer VerticalExpand="True" HScrollEnabled="True">
Expand Down
109 changes: 107 additions & 2 deletions Content.Client/CartridgeLoader/Cartridges/LogProbeUiFragment.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Content.Shared.CartridgeLoader.Cartridges;
using System.Linq; // DeltaV
using Content.Client.DeltaV.CartridgeLoader.Cartridges; // DeltaV
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.DeltaV.CartridgeLoader.Cartridges; // DeltaV
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -13,10 +16,112 @@ public LogProbeUiFragment()
RobustXamlLoader.Load(this);
}

public void UpdateState(List<PulledAccessLog> logs)
// DeltaV begin - Update to handle both types of data
public void UpdateState(LogProbeUiState state)
{
ProbedDeviceContainer.RemoveAllChildren();

if (state.NanoChatData != null)
{
SetupNanoChatView(state.NanoChatData.Value);
DisplayNanoChatData(state.NanoChatData.Value);
}
else
{
SetupAccessLogView();
if (state.PulledLogs.Count > 0)
DisplayAccessLogs(state.PulledLogs);
}
}

private void SetupNanoChatView(NanoChatData data)
{
TitleLabel.Text = Loc.GetString("log-probe-header-nanochat");
ContentLabel.Text = Loc.GetString("log-probe-label-message");

// Show card info if available
var cardInfo = new List<string>();
if (data.CardNumber != null)
cardInfo.Add(Loc.GetString("log-probe-card-number", ("number", $"#{data.CardNumber:D4}")));

// Add recipient count
cardInfo.Add(Loc.GetString("log-probe-recipients", ("count", data.Recipients.Count)));

CardNumberLabel.Text = string.Join(" | ", cardInfo);
CardNumberLabel.Visible = true;
}

private void SetupAccessLogView()
{
TitleLabel.Text = Loc.GetString("log-probe-header-access");
ContentLabel.Text = Loc.GetString("log-probe-label-accessor");
CardNumberLabel.Visible = false;
}

private void DisplayNanoChatData(NanoChatData data)
{
// First add a recipient list entry
var recipientsList = Loc.GetString("log-probe-recipient-list") + "\n" + string.Join("\n",
data.Recipients.Values
.OrderBy(r => r.Name)
.Select(r => $" {r.Name}" +
(string.IsNullOrEmpty(r.JobTitle) ? "" : $" ({r.JobTitle})") +
$" | #{r.Number:D4}"));

var recipientsEntry = new LogProbeUiEntry(0, "---", recipientsList);
ProbedDeviceContainer.AddChild(recipientsEntry);

var count = 1;
foreach (var (partnerId, messages) in data.Messages)
{
// Show only successfully delivered incoming messages
var incomingMessages = messages
.Where(msg => msg.SenderId == partnerId && !msg.DeliveryFailed)
.OrderByDescending(msg => msg.Timestamp);

foreach (var msg in incomingMessages)
{
var messageText = Loc.GetString("log-probe-message-format",
("sender", $"#{msg.SenderId:D4}"),
("recipient", $"#{data.CardNumber:D4}"),
("content", msg.Content));

var entry = new NanoChatLogEntry(
count,
TimeSpan.FromSeconds(Math.Truncate(msg.Timestamp.TotalSeconds)).ToString(),
messageText);

ProbedDeviceContainer.AddChild(entry);
count++;
}

// Show only successfully delivered outgoing messages
var outgoingMessages = messages
.Where(msg => msg.SenderId == data.CardNumber && !msg.DeliveryFailed)
.OrderByDescending(msg => msg.Timestamp);

foreach (var msg in outgoingMessages)
{
var messageText = Loc.GetString("log-probe-message-format",
("sender", $"#{msg.SenderId:D4}"),
("recipient", $"#{partnerId:D4}"),
("content", msg.Content));

var entry = new NanoChatLogEntry(
count,
TimeSpan.FromSeconds(Math.Truncate(msg.Timestamp.TotalSeconds)).ToString(),
messageText);

ProbedDeviceContainer.AddChild(entry);
count++;
}
}
}
// DeltaV end

// DeltaV - Handle this in a separate method
private void DisplayAccessLogs(List<PulledAccessLog> logs)
{
//Reverse the list so the oldest entries appear at the bottom
logs.Reverse();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<BoxContainer
xmlns="https://spacestation14.io"
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
HorizontalExpand="True">
<Button Name="ChatButton"
StyleClasses="ButtonSquare"
HorizontalExpand="True"
MaxSize="137 64"
Margin="0 1">
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
VerticalExpand="True"
MinWidth="132"
Margin="6 4"
VerticalAlignment="Center">
<!-- Unread indicator dot -->
<PanelContainer Name="UnreadIndicator"
MinSize="8 8"
MaxSize="8 8"
VerticalAlignment="Center"
Margin="0 0 6 0">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat
BackgroundColor="#17c622"
BorderColor="#0f7a15" />
</PanelContainer.PanelOverride>
</PanelContainer>

<!-- Text container -->
<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True"
VerticalAlignment="Center">
<RichTextLabel Name="NameLabel"
StyleClasses="LabelHeading"
HorizontalExpand="True"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="0 -2 0 0" />
Comment on lines +34 to +39
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Based on the search results, I can now provide a final response. The codebase shows consistent patterns for handling text in UI components:

Add ClipText property to handle text overflow

The RichTextLabel should have ClipText="True" to prevent layout issues with long names. This is a common pattern used throughout the codebase for similar UI components, as evidenced by numerous examples in other XAML files.

  • In Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatEntry.xaml, update the NameLabel:
<RichTextLabel Name="NameLabel"
               StyleClasses="LabelHeading"
               HorizontalExpand="True"
               HorizontalAlignment="Center"
               VerticalAlignment="Center"
               ClipText="True"
               Margin="0 -2 0 0" />
🔗 Analysis chain

Verify text overflow handling for long names

The RichTextLabel for names doesn't have explicit text clipping or wrapping configuration. This could lead to layout issues with very long names.


The previous search failed because the file extension wasn't recognized. Let's try a different approach by using fd to find XAML files and then searching within them, along with looking for similar RichTextLabel usages and the style class being used.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any existing text overflow handling patterns in similar UI components
rg -A 2 "ClipText=\"True\"" --type xaml

Length of output: 68


Script:

#!/bin/bash
# Search for any existing text overflow handling patterns in similar UI components
# Using a more general search since the file extension might be different
fd -e xaml . | xargs cat | grep -A 2 'ClipText='

# Also search for RichTextLabel usage patterns
fd -e xaml . | xargs cat | grep -A 2 'RichTextLabel'

# Search for potential style classes that might handle text overflow
rg -A 2 "LabelHeading" 

Length of output: 34797

<Label Name="JobLabel"
StyleClasses="LabelSubText"
HorizontalExpand="True"
ClipText="False"
HorizontalAlignment="Center" />
</BoxContainer>
</BoxContainer>
</Button>
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Content.Shared.DeltaV.CartridgeLoader.Cartridges;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.DeltaV.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class NanoChatEntry : BoxContainer
{
public event Action<uint>? OnPressed;
private uint _number;
private Action<EventArgs>? _pressHandler;

public NanoChatEntry()
{
RobustXamlLoader.Load(this);
}

public void SetRecipient(NanoChatRecipient recipient, uint number, bool isSelected)
{
// Remove old handler if it exists
if (_pressHandler != null)
ChatButton.OnPressed -= _pressHandler;

_number = number;

// Create and store new handler
_pressHandler = _ => OnPressed?.Invoke(_number);
ChatButton.OnPressed += _pressHandler;

NameLabel.Text = recipient.Name;
JobLabel.Text = recipient.JobTitle ?? "";
JobLabel.Visible = !string.IsNullOrEmpty(recipient.JobTitle);
UnreadIndicator.Visible = recipient.HasUnread;

ChatButton.ModulateSelfOverride = isSelected ? NanoChatMessageBubble.OwnMessageColor : null;
}
Comment on lines +20 to +38
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add parameter validation and cleanup

Several improvements needed for robustness:

  1. Add null check for recipient
  2. Implement IDisposable to clean up event handlers
  3. Simplify event handler creation
+public sealed partial class NanoChatEntry : BoxContainer, IDisposable
 {
     public event Action<uint>? OnPressed;
     private uint _number;
     private Action<EventArgs>? _pressHandler;
 
     public void SetRecipient(NanoChatRecipient recipient, uint number, bool isSelected)
     {
+        ArgumentNullException.ThrowIfNull(recipient);
+
         // Remove old handler if it exists
         if (_pressHandler != null)
             ChatButton.OnPressed -= _pressHandler;
 
         _number = number;
 
         // Create and store new handler
-        _pressHandler = _ => OnPressed?.Invoke(_number);
+        _pressHandler = static (_, n) => OnPressed?.Invoke(n);
         ChatButton.OnPressed += _pressHandler;
 
         NameLabel.Text = recipient.Name;
         JobLabel.Text = recipient.JobTitle ?? "";
         JobLabel.Visible = !string.IsNullOrEmpty(recipient.JobTitle);
         UnreadIndicator.Visible = recipient.HasUnread;
 
         ChatButton.ModulateSelfOverride = isSelected ? NanoChatMessageBubble.OwnMessageColor : null;
     }
+
+    public void Dispose()
+    {
+        if (_pressHandler != null)
+        {
+            ChatButton.OnPressed -= _pressHandler;
+            _pressHandler = null;
+        }
+    }
 }

Committable suggestion skipped: line range outside the PR's diff.

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<BoxContainer xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
Margin="4"
Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Name="NumberLabel"
Align="Right"
SetWidth="26"
ClipText="True" />
<Label Name="TimeLabel"
Align="Center"
SetWidth="100"
ClipText="True" />
<Label Name="MessageLabel"
Align="Left"
MinWidth="390"
HorizontalExpand="True"
ClipText="False" />
</BoxContainer>
<customControls:HSeparator Margin="0 5 0 5" />
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.DeltaV.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class NanoChatLogEntry : BoxContainer
{
public NanoChatLogEntry(int number, string time, string message)
{
RobustXamlLoader.Load(this);
NumberLabel.Text = number.ToString();
TimeLabel.Text = time;
MessageLabel.Text = message;
}
Comment on lines +10 to +16
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add parameter validation and error handling

The constructor should include parameter validation to ensure robustness:

  1. Null checks for string parameters
  2. Number range validation if applicable
  3. Safe string conversion with error handling

Consider applying this improvement:

 public NanoChatLogEntry(int number, string time, string message)
 {
+    ArgumentNullException.ThrowIfNull(time);
+    ArgumentNullException.ThrowIfNull(message);
+
     RobustXamlLoader.Load(this);
-    NumberLabel.Text = number.ToString();
+    NumberLabel.Text = number.ToString(CultureInfo.InvariantCulture);
     TimeLabel.Text = time;
     MessageLabel.Text = message;
 }

Don't forget to add:

+using System;
+using System.Globalization;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public NanoChatLogEntry(int number, string time, string message)
{
RobustXamlLoader.Load(this);
NumberLabel.Text = number.ToString();
TimeLabel.Text = time;
MessageLabel.Text = message;
}
public NanoChatLogEntry(int number, string time, string message)
{
ArgumentNullException.ThrowIfNull(time);
ArgumentNullException.ThrowIfNull(message);
RobustXamlLoader.Load(this);
NumberLabel.Text = number.ToString(CultureInfo.InvariantCulture);
TimeLabel.Text = time;
MessageLabel.Text = message;
}

}
Loading
Loading