Skip to content

Add a window corner-radius setting (Sharp / Default / Round) - #422

Merged
AllTerrainDeveloper merged 1 commit into
WordPress:trunkfrom
Alexismlg:feat/window-corner-radius-setting
Jul 27, 2026
Merged

Add a window corner-radius setting (Sharp / Default / Round)#422
AllTerrainDeveloper merged 1 commit into
WordPress:trunkfrom
Alexismlg:feat/window-corner-radius-setting

Conversation

@Alexismlg

Copy link
Copy Markdown
Contributor

Summary

Adds an OS Settings → Appearance control, "Window corners", that lets the user choose how rounded window corners are:

  • Sharp — 0px
  • Default — 8px (current behaviour, unchanged for existing users)
  • Round — 16px

The choice writes the existing --desktop-mode-window-radius custom property on the shell root during the settings apply pass, so every open window reflows its corners live (no reload). It persists per user like the other appearance settings.

Why

Corner radius was a fixed token (--desktop-mode-window-radius: 8px) with no way to change it short of custom CSS. Exposing it as a segmented control is a small, self-contained personalisation that fits alongside Accent color / Dock size.

Implementation

Follows the Dock size section pattern exactly:

  • src/settings/constants.tsWINDOW_RADII presets + windowRadius default.
  • src/settings/types.tsWindowRadiusId type + windowRadius on OsSettingsState.
  • src/settings/state.ts — default + validated coercion on load.
  • src/settings/labels.tstranslateWindowRadiusLabel.
  • src/settings/sections/window-radius.ts — new <wpd-segmented> section (mirrors dock-size.ts).
  • src/settings/panel.ts — mounts the section under the Appearance tab (after Dock size).
  • src/settings/index.ts — apply pass sets --desktop-mode-window-radius on <html> (next to the dock-size / accent vars).
  • includes/os-settings.php — server-side default, sanitise (allow-list of the three ids), and output, mirroring dockSize.

Only affects windows — widgets and the dock keep their own radii.

Testing

  • npm run typecheck, npm run lint, php -l on the PHP file, and builds of the desktop + os-settings-panel targets all pass.
  • Verified in wp-env: the control renders in Appearance; picking Sharp/Default/Round changes --desktop-mode-window-radius to 0/8/16px live; the choice survives a page reload (persisted server-side).

Adds an OS Settings → Appearance control ("Window corners") that lets the
user choose how rounded window corners are: Sharp (0px) / Default (8px) /
Round (16px). The choice writes the existing `--desktop-mode-window-radius`
custom property on the shell root via the settings apply pass, so every
open window reflows its corners live.

Follows the Dock size section pattern exactly: a `<wpd-segmented>` bound
to a new `windowRadius` state field, persisted + validated server-side in
includes/os-settings.php alongside the other appearance settings.

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thank you!

Screen.Recording.2026-07-27.at.13.19.24.mov

@AllTerrainDeveloper
AllTerrainDeveloper merged commit eff1690 into WordPress:trunk Jul 27, 2026
6 checks passed
epeicher added a commit that referenced this pull request Jul 27, 2026
Resolves conflicts from the editor-preview (#398) and corner-radius
(#422) features by keeping trunk's new content with its version
stamps stripped, per the new AGENTS.md rule: new @SInCE tags in
window-links.php, editor-preview/*, types.ts, window/index.ts,
hooks.ts, and the new hooks-reference / javascript-reference /
bridge-protocol / api-index sections all land clean.

Also repairs three headings in bridge-protocol.md that the original
cleanup had accidentally glued to their following paragraph, and the
one cross-reference that pointed at a glued slug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants