Skip to content

Commit 9de9b5b

Browse files
authored
Revamp config page editor
Polish the WinUI config editor with permission-aware state, live validation, persistent JSON diff preview, full-width layout, safer read-only/no-read handling, and maintainer fixes for stale-base retry and sensitive field detection.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6bd9885 commit 9de9b5b

22 files changed

Lines changed: 3036 additions & 786 deletions

scripts/Test-Localization.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,24 @@ function Test-IsLocalizableValue {
5959
return $true
6060
}
6161

62+
function Test-IsSourceXaml {
63+
param([System.IO.FileInfo]$File)
64+
65+
$relativePath = Get-RelativePath $winUiRoot $File.FullName
66+
$segments = $relativePath -split '[\\/]'
67+
# Build output can contain generated/copied XAML; only source XAML should drive localization findings.
68+
return $segments -notcontains 'bin' -and $segments -notcontains 'obj'
69+
}
70+
6271
function Get-XamlLocalizationFindings {
6372
$resourceKeys = Get-ResourceKeys
6473
$missingResources = [System.Collections.Generic.List[string]]::new()
6574
$hardcodedValues = [System.Collections.Generic.List[string]]::new()
6675

67-
Get-ChildItem -LiteralPath $winUiRoot -Recurse -Filter *.xaml | Sort-Object FullName | ForEach-Object {
76+
Get-ChildItem -LiteralPath $winUiRoot -Recurse -Filter *.xaml -File |
77+
Where-Object { Test-IsSourceXaml $_ } |
78+
Sort-Object FullName |
79+
ForEach-Object {
6880
$xamlPath = $_.FullName
6981
$relativePath = Get-RelativePath $repoRoot $xamlPath
7082
[xml]$xml = Get-Content -LiteralPath $xamlPath -Raw -Encoding UTF8

src/OpenClaw.Connection/OperatorScopeHelper.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,15 @@ public static bool CanApproveDevices(IReadOnlyList<string> grantedScopes) =>
66
grantedScopes.Any(s =>
77
s.Equals("operator.admin", StringComparison.OrdinalIgnoreCase) ||
88
s.Equals("operator.pairing", StringComparison.OrdinalIgnoreCase));
9+
10+
public static bool CanReadConfig(IReadOnlyList<string> grantedScopes) =>
11+
HasScope(grantedScopes, "operator.admin") ||
12+
HasScope(grantedScopes, "operator.read");
13+
14+
public static bool CanWriteConfig(IReadOnlyList<string> grantedScopes) =>
15+
HasScope(grantedScopes, "operator.admin") ||
16+
HasScope(grantedScopes, "operator.write");
17+
18+
private static bool HasScope(IReadOnlyList<string> grantedScopes, string scope) =>
19+
grantedScopes.Any(s => s.Equals(scope, StringComparison.OrdinalIgnoreCase));
920
}

0 commit comments

Comments
 (0)