UI: add corner radius slider and appearance polish#49436
Conversation
…accent colors and optimize spacing rules in layout files.
…djust focus states for chat components and layout elements.
…x-shadow effects for improved accessibility and visual consistency.
…n user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities.
…roundness, update CSS styles for sliders, and integrate border radius adjustments across components.
…to simplify configuration and enhance consistency across components.
…, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens.
Greptile SummaryThis PR delivers three related improvements to the Control UI: (1) a new Roundness slider in Appearance settings that scales all Key points:
Confidence Score: 3/5
|
|
Landed via temp rebase onto main.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e04853efd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var keys = Object.keys(localStorage); | ||
| var raw; | ||
| for (var i = 0; i < keys.length; i++) { | ||
| if (keys[i].indexOf("openclaw.control.settings.v1") === 0) { | ||
| raw = localStorage.getItem(keys[i]); | ||
| if (raw) break; |
There was a problem hiding this comment.
Load the current gateway’s settings for prepaint theme
The new prepaint script selects the first openclaw.control.settings.v1* entry from localStorage, which is not guaranteed to be the active gateway’s scoped key. When users have settings saved for multiple gateways, this can apply the wrong theme/mode on initial paint (before app hydration), causing visible flash/inconsistent appearance until loadSettings() corrects it. The lookup should resolve the current gateway scope and read that specific key first, matching runtime settings resolution.
Useful? React with 👍 / 👎.
🔒 Aisle Security AnalysisWe found 2 potential security issue(s) in this PR:
1. 🟡 Prototype pollution via config map key rename bypasses FORBIDDEN_KEYS path checks
DescriptionThe config form UI allows renaming keys for
Vulnerable code: const nextKey = (e.target as HTMLInputElement).value.trim();
...
const next = { ...value };
...
next[nextKey] = next[key];
delete next[key];
onPatch(path, next);Impact:
RecommendationBlock forbidden keys at the point they are accepted and avoid the Suggested fix (minimal):
Example: const FORBIDDEN_KEYS = new Set(["__proto__", "prototype", "constructor"]);
...
const nextKey = (e.target as HTMLInputElement).value.trim();
if (!nextKey || nextKey === key) return;
if (FORBIDDEN_KEYS.has(nextKey)) return;
const next: Record<string, unknown> = { ...value };
if (Object.hasOwn(next, nextKey)) return;
Object.defineProperty(next, nextKey, {
value: next[key],
enumerable: true,
writable: true,
configurable: true,
});
delete next[key];
onPatch(path, next);For stronger hardening, consider using 2. 🔵 Unbounded localStorage/sessionStorage key growth from user-controlled gatewayUrl (client-side storage exhaustion DoS)
DescriptionThe UI now persists settings under a gateway-scoped key derived from Impact:
Key code paths:
Vulnerable code excerpt: const scope = normalizeGatewayTokenScope(next.gatewayUrl);
const scopedKey = settingsKeyForGateway(next.gatewayUrl);
...
const serialized = JSON.stringify(persisted);
storage?.setItem(scopedKey, serialized);
storage?.setItem(LEGACY_SETTINGS_KEY, serialized);RecommendationMitigate storage-exhaustion and key-injection risks by making persisted key space bounded and robust:
Example approach (hash + bounded index): const SETTINGS_KEY_PREFIX = "openclaw.control.settings.v1:";
async function gatewayScopeKey(gatewayUrl: string) {
const normalized = normalizeGatewayTokenScope(gatewayUrl).slice(0, 2048); // also cap input
const bytes = new TextEncoder().encode(normalized);
const digest = await crypto.subtle.digest("SHA-256", bytes);
const hex = [...new Uint8Array(digest)].map(b => b.toString(16).padStart(2,"0")).join("");
return `${SETTINGS_KEY_PREFIX}${hex}`;
}
function safeSet(storage: Storage, key: string, value: string) {
try {
storage.setItem(key, value);
} catch (e) {
// handle QuotaExceededError: evict old keys and retry, or disable persistence
}
}Analyzed PR: #49436 at commit Last updated on: 2026-03-18T05:02:10Z |
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
* Refactor CSS styles: replace hardcoded colors with CSS variables for accent colors and optimize spacing rules in layout files. * Update CSS styles: streamline selectors, enhance hover effects, and adjust focus states for chat components and layout elements. * Enhance focus styles for chat components: update border colors and box-shadow effects for improved accessibility and visual consistency. * Implement theme management in UI: add dynamic theme switching based on user settings, update CSS variables for new themes, and enhance security by preventing prototype pollution in form utilities. * Implement border radius customization in UI: add settings for corner roundness, update CSS styles for sliders, and integrate border radius adjustments across components. * Remove border radius property from UI settings and related functions to simplify configuration and enhance consistency across components. * Enhance responsive design in UI: add media queries for mobile layouts, adjust padding and grid structures, and implement bottom navigation for improved usability on smaller screens. * UI: add corner radius slider to Appearance settings
Corner radius is owned by themes; drop the browser-local multiplier that scaled all --radius-* variables (added in #49436). Stale borderRadius localStorage keys are ignored and dropped on next settings write.
Corner radius is owned by themes; drop the browser-local multiplier that scaled all --radius-* variables (added in openclaw#49436). Stale borderRadius localStorage keys are ignored and dropped on next settings write.
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
Expected
--radius-*CSS custom properties in real timeActual
Evidence
Human Verification (required)
Review Conversations
Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
Risks and Mitigations
Made with Cursor