Skip to content

Commit e701cb0

Browse files
committed
feat(Compat): Add BuildInlineUiText method for improved UI text formatting
- Introduced BuildInlineUiText method in RuntimeFrameworkVersionSummary to format version information for inline display. - Updated JoinFailureDiagnosticsPanel and StateDivergenceDiagnosticsPanel to utilize the new method, enhancing the presentation of runtime framework details in the UI. - Removed deprecated calls to BuildUiText, streamlining the code and improving maintainability.
1 parent 8c26578 commit e701cb0

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

Compat/RuntimeFrameworkVersionSummary.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ internal static string BuildUiText(bool includeMissingBaseLib)
3030
return string.Join("\n", lines);
3131
}
3232

33+
internal static string BuildInlineUiText(bool includeMissingBaseLib)
34+
{
35+
var lines = BuildDisplayLines(includeMissingBaseLib);
36+
return string.Join(" | ", lines);
37+
}
38+
3339
internal static IReadOnlyList<string> BuildDisplayLines(bool includeMissingBaseLib)
3440
{
3541
var lines = new List<string> { BuildRitsuLibDisplayLine() };

Networking/JoinDiagnostics/JoinFailureDiagnosticsPanel.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ private Control BuildSummaryBody()
203203
};
204204
box.AddThemeConstantOverride("separation", 8);
205205
box.AddChild(CreateInfoCard(_report.Summary, RitsuShellTheme.Current.Text.RichBody));
206-
box.AddChild(CreateInfoCard(RuntimeFrameworkVersionSummary.BuildUiText(false),
207-
RitsuShellTheme.Current.Text.RichMuted));
208206

209207
if (_report.Host != null)
210208
box.AddChild(BuildPeerSnapshotRow());
@@ -554,11 +552,8 @@ private Control BuildFooter()
554552
};
555553
row.AddThemeConstantOverride("separation", 10);
556554

557-
var reason = F("footer.networkReason", "Network reason: {0}", _report.NetworkReason);
558-
if (!string.IsNullOrWhiteSpace(_report.NetworkInfo))
559-
reason += " " + F("footer.networkInfo", "Info: {0}", _report.NetworkInfo);
560-
561-
var label = CreateLabel(reason, 14, RitsuShellTheme.Current.Text.LabelSecondary);
555+
var label = CreateLabel(RuntimeFrameworkVersionSummary.BuildInlineUiText(false), 14,
556+
RitsuShellTheme.Current.Text.LabelSecondary);
562557
label.SizeFlagsHorizontal = SizeFlags.ExpandFill;
563558
row.AddChild(label);
564559
return row;

Networking/StateDivergence/StateDivergenceDiagnosticsPanel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ private Control BuildSummaryBody()
201201
};
202202
box.AddThemeConstantOverride("separation", 8);
203203
box.AddChild(CreateInfoCard(_report.Summary, RitsuShellTheme.Current.Text.RichBody));
204-
box.AddChild(CreateInfoCard(RuntimeFrameworkVersionSummary.BuildUiText(false),
205-
RitsuShellTheme.Current.Text.RichMuted));
206204
box.AddChild(BuildChecksumCards());
207205
return box;
208206
}
@@ -532,7 +530,7 @@ private Control BuildFooter()
532530
};
533531
row.AddThemeConstantOverride("separation", 10);
534532
var label = CreateLabel(
535-
F("footer.context", "Role: {0} Remote peer: {1}", _report.Role, _report.RemotePeerId),
533+
RuntimeFrameworkVersionSummary.BuildInlineUiText(false),
536534
14,
537535
RitsuShellTheme.Current.Text.LabelSecondary);
538536
label.SizeFlagsHorizontal = SizeFlags.ExpandFill;

0 commit comments

Comments
 (0)