Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 1 addition & 8 deletions src/Capacitor.App/Views/SessionRailView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
Foreground="{StaticResource KcapTextBrush}"
TextTrimming="CharacterEllipsis"
ToolTip.Tip="{Binding Primary}" />
<!-- The age sits on the right. Vendor, status and chips stay on the left
<!-- The age sits on the right. Vendor, status and machine stay on the left

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Expose the model from the keyboard-focusable row

For users navigating the rail by keyboard, focus lands on the outer session Button, not the nested non-focusable vendor Border, so the only remaining model tooltip cannot be opened without pointer hover; its automation name also contains only the vendor. The updated test masks this by calling ToolTip.SetIsOpen programmatically. Attach the model help text to the focusable row or include it in the row's accessible name so removing the visible chip does not make the model inaccessible.

Useful? React with 👍 / 👎.

and wrap rather than overflow the 330px rail. A WrapPanel measures
each child unconstrained, and the age column is measured first, so
each has a cap. The tips keep the full text. -->
Expand All @@ -349,13 +349,6 @@
</Border>
<views:AgentStatusMark DataContext="{Binding Status}" MaxWidth="160"
Margin="0,0,6,0" VerticalAlignment="Center" />
<Border Classes="railChip" IsVisible="{Binding HasModel}" CornerRadius="999" MaxWidth="150"
Padding="6,2" Margin="0,0,6,0"
Background="{StaticResource KcapInfoDimBrush}">
<TextBlock Text="{Binding ModelLabel}" Classes="railChipLabel"
Foreground="{StaticResource KcapInfoBrush}"
TextTrimming="CharacterEllipsis" />
</Border>
<Border Classes="railChip" IsVisible="{Binding MachineBadge, Converter={x:Static ObjectConverters.IsNotNull}}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve model details for vendorless remote rows

When a remote AgentInstanceDto supplies Model but omits its nullable Vendor, AgentRow.FromRemote preserves the model while converting the vendor to an empty string, making HasModel true and HasVendor false. Removing this chip leaves the model only inside the now-hidden vendorMark tooltip, so the known model disappears completely for that valid wire shape; retain a model fallback when no vendor mark is rendered.

Useful? React with 👍 / 👎.

Background="{StaticResource KcapSurfaceRaisedBrush}" MaxWidth="100"
CornerRadius="3" Padding="4,2" Margin="0,0,6,0">
Expand Down
14 changes: 4 additions & 10 deletions test/Capacitor.App.Tests.Unit/MainWindowSmokeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,10 @@ await AvaloniaSession.WithImmediateRxScheduler(async () => {
}

/// The vendor mark, the status word, and the age share one baseline. The age has no extra
/// padding, or it sits below that line.
/// padding, or it sits below that line. The model is named only in the vendor mark's tip.
[Test]
[NotInParallel("AvaloniaSession")]
public async Task Vendor_mark_model_chip_and_running_time_share_the_status_line() {
public async Task Vendor_mark_and_running_time_share_the_status_line() {
await AvaloniaSession.WithImmediateRxScheduler(async () => {
var seen = await AvaloniaSession.DispatchAsync(() => {
var (_, window) = RailWindow(model: "opus");
Expand All @@ -722,8 +722,6 @@ await AvaloniaSession.WithImmediateRxScheduler(async () => {
var mark = row.GetVisualDescendants().OfType<AgentStatusMark>().First();
var word = mark.FindControl<TextBlock>("StatusWord")!;
var vendor = row.GetVisualDescendants().OfType<Border>().First(b => b.Classes.Contains("vendorMark"));
var chip = row.GetVisualDescendants().OfType<Border>().First(b => b.Classes.Contains("railChip"));
var label = chip.GetVisualDescendants().OfType<TextBlock>().First(t => t.Classes.Contains("railChipLabel"));
var meta = row.GetVisualDescendants().OfType<TextBlock>().First(t => t.Classes.Contains("railMeta"));
ToolTip.SetIsOpen(vendor, true);
Dispatcher.UIThread.RunJobs();
Expand All @@ -743,17 +741,15 @@ double Baseline(TextBlock text) =>
MetaBaseline: Baseline(meta),
Vendor: Center(vendor),
Glyph: Center(glyph),
Model: Center(label),
Meta: Center(meta),
VendorName: AutomationProperties.GetName(vendor),
VendorLeft: Left(vendor),
MarkLeft: Left(mark),
MetaGap: row.Bounds.Width - Right(meta),
ChipToMeta: Left(meta) - Right(chip),
ModelInRow: row.GetVisualDescendants().OfType<TextBlock>().Any(t => t.IsEffectivelyVisible && t.Text == "opus"),
TipVendor: tipLines[0],
TipModel: tipLines[1],
HasMark: vendor.GetVisualDescendants().OfType<Avalonia.Controls.Shapes.Path>().Any(),
ChipAlign: chip.VerticalAlignment,
MetaAlign: meta.VerticalAlignment);
window.Close();
Dispatcher.UIThread.RunJobs();
Expand All @@ -764,14 +760,12 @@ double Baseline(TextBlock text) =>
await Assert.That(seen.TipModel).IsEqualTo("opus");
await Assert.That(seen.VendorLeft).IsLessThan(seen.MarkLeft);
await Assert.That(seen.MetaGap).IsLessThan(16);
await Assert.That(seen.ChipToMeta).IsGreaterThan(24);
await Assert.That(seen.ModelInRow).IsFalse();
await Assert.That(seen.HasMark).IsTrue();
await Assert.That(Math.Abs(seen.WordBaseline - seen.MetaBaseline)).IsLessThan(1);
await Assert.That(Math.Abs(seen.Word - seen.Vendor)).IsLessThan(2);
await Assert.That(Math.Abs(seen.Word - seen.Glyph)).IsLessThan(2);
await Assert.That(Math.Abs(seen.Word - seen.Model)).IsLessThan(2);
await Assert.That(Math.Abs(seen.Word - seen.Meta)).IsLessThan(2);
await Assert.That(seen.ChipAlign).IsEqualTo(VerticalAlignment.Center);
await Assert.That(seen.MetaAlign).IsEqualTo(VerticalAlignment.Center);
});
}
Expand Down
Loading