Skip to content

Commit 6696f5a

Browse files
committed
fix: clarify always-on device capability
1 parent e66d158 commit 6696f5a

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/OpenClaw.SetupEngine.UI/Pages/CapabilitiesPage.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@
8484
<!-- Rows added in code-behind -->
8585
</Grid>
8686
</Expander>
87+
<TextBlock Text="Basic device info and status stay available while Node Mode is on."
88+
Style="{StaticResource CaptionTextBlockStyle}"
89+
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
90+
TextWrapping="Wrap" />
8791
</StackPanel>
8892

8993
<StackPanel x:Name="Step2Content" Spacing="8" Visibility="Collapsed">

src/OpenClaw.SetupEngine.UI/Pages/CapabilitiesPage.xaml.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public sealed partial class CapabilitiesPage : Page
2121
private bool _treatBundledAllOnAsPlaceholder;
2222
private int _step = 1;
2323

24-
// Capability profiles just preset the granular toggles below. Keys map 1:1 to
25-
// CapabilitiesConfig — Full = every key on.
26-
private static readonly string[] ProfileReadOnly = ["Canvas", "Screen", "Device"];
27-
private static readonly string[] ProfileStandard = ["System", "Canvas", "Screen", "Device", "Tts", "Stt"];
24+
// Capability profiles preset only runtime-gated settings. Device info/status
25+
// stays available whenever Node Mode is enabled, so it is disclosed but not selectable.
26+
private static readonly string[] ProfileReadOnly = ["Canvas", "Screen"];
27+
private static readonly string[] ProfileStandard = ["System", "Canvas", "Screen", "Tts", "Stt"];
2828

2929
// (config property, display name, description, fluent icon glyph)
3030
private static readonly (string Key, string Name, string Desc, string Glyph)[] Capabilities =
@@ -35,7 +35,6 @@ private static readonly (string Key, string Name, string Desc, string Glyph)[] C
3535
("Camera", "Camera", "Webcam photos and video", "\uE722"),
3636
("Location", "Location", "Share device location", "\uE81D"),
3737
("Browser", "Browser", "Web navigation and automation", "\uE774"),
38-
("Device", "Device", "Volume, brightness, system info", "\uE772"),
3938
("Tts", "Text-to-speech", "Speak text aloud", "\uE767"),
4039
("Stt", "Speech-to-text", "Transcribe spoken audio", "\uE720"),
4140
];
@@ -57,6 +56,9 @@ public CapabilitiesPage()
5756
protected override void OnNavigatedTo(NavigationEventArgs e)
5857
{
5958
_config = e.Parameter as SetupConfig ?? new SetupConfig();
59+
// The tray always registers device.info/status with Node Mode. Keep the
60+
// setup declaration and gateway allowlist aligned with that runtime contract.
61+
_config.Capabilities.Device = true;
6062
_skipPermissions = _config.SkipPermissions;
6163
_treatBundledAllOnAsPlaceholder = _config.UsesBundledDefaultConfig;
6264
BuildToggles();

tests/OpenClaw.Tray.Tests/AppRefactorContractTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,19 @@ public void CapabilitiesPage_ExposesExplicitCustomCapabilitySetsForReview()
496496
"UpdateCapabilityProfilePresentation(profileIndex)");
497497
}
498498

499+
[Fact]
500+
public void CapabilitiesPage_DisclosesAlwaysOnDeviceStatusWithoutOfferingFalseToggle()
501+
{
502+
var root = TestRepositoryPaths.GetRepositoryRoot();
503+
var source = File.ReadAllText(Path.Combine(root, "src", "OpenClaw.SetupEngine.UI", "Pages", "CapabilitiesPage.xaml.cs"));
504+
var xaml = File.ReadAllText(Path.Combine(root, "src", "OpenClaw.SetupEngine.UI", "Pages", "CapabilitiesPage.xaml"));
505+
506+
Assert.DoesNotContain("(\"Device\", \"Device\"", source);
507+
Assert.DoesNotContain("[\"Canvas\", \"Screen\", \"Device\"]", source);
508+
Assert.Contains("_config.Capabilities.Device = true", source);
509+
Assert.Contains("Basic device info and status stay available while Node Mode is on.", xaml);
510+
}
511+
499512
[Fact]
500513
public void WizardSecondaryButton_DoesNotSkipEntireWizardInErrorState()
501514
{

0 commit comments

Comments
 (0)