Skip to content
Closed
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
7 changes: 7 additions & 0 deletions assets/css/desktop.css
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,13 @@ body.os-active #wpcontent {
pointer-events: auto;
}

.os-mio-panel__intro {
margin: 0 0 16px;
color: var( --os-ui-fg-muted, #646970 );
font-size: 12px;
line-height: 1.5;
}

/*
* Overview (Exposé) hides the desk furniture so the window grid
* reads cleanly — Mio goes with the widgets and the notes.
Expand Down
18 changes: 18 additions & 0 deletions assets/css/os-settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,19 @@

.os-settings__footer {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 16px;
margin-top: 12px;
}

.os-settings__reset-note {
flex: 1;
margin: 0;
color: var( --os-ui-fg-muted, #646970 );
font-size: 12px;
}

/* Top-level tab strip separating Appearance from AI Settings.
* Don't add a `display` rule for `os-tabpanel` here — the component's
* shadow-DOM `:host([hidden]) { display: none }` has lower specificity
Expand Down Expand Up @@ -1398,9 +1407,18 @@
*/
.os-settings__theme-recommendation {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-block: 16px;
}

.os-settings__theme-recommendation-note {
margin: 0;
color: var( --os-ui-fg-muted, #646970 );
font-size: 12px;
}

.os-settings__theme-upload {
display: block;
border: 2px dashed var( --os-ui-border, #c3c4c7 );
Expand Down
6 changes: 3 additions & 3 deletions docs/desktop-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ activates it — and never again.**
dock back to compact, re-pick the theme — it stays compact.

The way back is the user's to take: **OpenStation Preferences → Themes** shows an
**Apply <theme>'s recommended layout and effects** button for the
**Apply <theme>'s recommended preferences** button for the
active theme when it recommends something, and that is the only path
that applies a recommendation a second time. It sets the settings and
nothing else — the dock resizing under the cursor is the feedback.
Expand Down Expand Up @@ -1499,7 +1499,7 @@ The first card in the grid is **OpenStation** — the shell's own look,
stored as the empty string. It is not a theme in the registry (its
palette is `assets/css/variables.css`, not a manifest), but the picker
treats it as a peer of everything beside it: it carries the same
"Apply …'s recommended layout and effects" button, and what it
"Apply …'s recommended preferences" button, and what it
recommends is the accent its palette was drawn against (Pulse) and the
layout it was drawn for (`classic`).

Expand All @@ -1512,7 +1512,7 @@ flash of the default palette.
If the theme ships
[`recommendedOsSettings`](#recommended-os-settings), the user's first
activation of it also seeds those preferences — once — and the tab
grows an **Apply <theme>'s recommended layout** button for going
grows an **Apply <theme>'s recommended preferences** button for going
back to them later.

### From JavaScript
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/native-posts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example: native Posts window

A `<os-table>`-driven replacement for the chromeless `edit.php` iframe. Server-paginated, sortable, filterable, multi-select bulk-trash, sub-row excerpt + featured image. **Opt-in Beta** — fresh installs use the classic iframe; users turn it on via **OpenStation Preferences → Features → Beta features → Use the native Posts window**. The dock tile stays where it is; only the destination changes.
A `<os-table>`-driven replacement for the chromeless `edit.php` iframe. Server-paginated, sortable, filterable, multi-select bulk-trash, sub-row excerpt + featured image. **Opt-in Beta** — fresh installs use the classic iframe; users turn it on via **OpenStation Preferences → Features → Beta features → Open Posts in the native window**. The dock tile stays where it is; only the destination changes.

> Status: **Experimental**. Hook names are stable; the JS column-filter shape may grow.

Expand Down
4 changes: 2 additions & 2 deletions docs/hooks-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2654,7 +2654,7 @@ See [`docs/examples/recycle-bin.md`](./examples/recycle-bin.md) for end-to-end r

## Native Posts window

`<os-table>`-driven native window that replaces the chromeless `edit.php` iframe. **Opt-in Beta** — fresh installs land on the classic iframe; users turn it on via **OpenStation Preferences → Features → Beta features → Use the native Posts window** (persisted as `OsSettingsState.nativePostsEnabled`, default `false`). The dock tile that points at `edit.php` is unchanged — every click path consults the URL → native-window remap registry first and falls back to the iframe on no-match. See [`examples/native-posts.md`](./examples/native-posts.md) for end-to-end recipes.
`<os-table>`-driven native window that replaces the chromeless `edit.php` iframe. **Opt-in Beta** — fresh installs land on the classic iframe; users turn it on via **OpenStation Preferences → Features → Beta features → Open Posts in the native window** (persisted as `OsSettingsState.nativePostsEnabled`, default `false`). The dock tile that points at `edit.php` is unchanged — every click path consults the URL → native-window remap registry first and falls back to the iframe on no-match. See [`examples/native-posts.md`](./examples/native-posts.md) for end-to-end recipes.

### `openstation_posts_window_user_can_register` — Stable *(filter)*

Expand Down Expand Up @@ -2820,7 +2820,7 @@ The `{ slug: label }` map for the active theme's registered page templates, used

## Native Plugins window

A two-tab native window that replaces the chromeless `plugins.php` (Installed list) and `plugin-install.php` (Browse the .org repo) iframes. **Opt-in Beta** — fresh installs land on the classic iframe; users turn it on via **OpenStation Preferences → Features → Beta features → Use the native Plugins window** (persisted as `OsSettingsState.nativePluginsEnabled`, default `false`). `plugin-editor.php` is intentionally NOT claimed; that surface stays on the existing iframe.
A two-tab native window that replaces the chromeless `plugins.php` (Installed list) and `plugin-install.php` (Browse the .org repo) iframes. **Opt-in Beta** — fresh installs land on the classic iframe; users turn it on via **OpenStation Preferences → Features → Beta features → Open Plugins in the native window** (persisted as `OsSettingsState.nativePluginsEnabled`, default `false`). `plugin-editor.php` is intentionally NOT claimed; that surface stays on the existing iframe.

Architecture summary: read paths use Core REST (`/wp/v2/plugins`); admin-only paths (browse / info / reviews / .zip upload) live on `admin-ajax.php` (`wp_ajax_openstation_plugins_*`) so we never need to `require_once ABSPATH . 'wp-admin/…'`. Install-by-slug delegates to Core's existing `wp_ajax_install_plugin` handler. Mutations are followed by `wp.os.refreshMenu()` so the dock repaints live.

Expand Down
2 changes: 1 addition & 1 deletion docs/javascript-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ Whatever wins, `edgeLag` is scaled by the same ratio, so the edge band keeps its
- **It replays on every load edge** the spinner replays on — a reload, an in-window navigation, a tab switch — not only on first open.
- **`prefers-reduced-motion` skips the animation** and uncovers the content directly. Same for environments without the Web Animations API.
- **The colours are theme tokens**: `--os-window-reveal-surface` (white) and `--os-window-reveal-edge` (`transparent` — no edge). A def can override them with `surfaceColor` / `edgeColor`, or per layer with `layers[].color`, but should not unless the paint is the point. `obturator` is the only built-in that does, and only per layer: its six leaves have to differ from one another or the mechanism reads as a single shape.
- **A desktop theme can recommend a reveal**, via `recommendedOsSettings.windowReveal` and `recommendedOsSettings.windowRevealDuration` — applied once on first activation, or on demand from the Themes tab's "Apply recommended layout and effects" button.
- **A desktop theme can recommend a reveal**, via `recommendedOsSettings.windowReveal` and `recommendedOsSettings.windowRevealDuration` — applied once on first activation, or on demand from the Themes tab's "Apply recommended preferences" button.
- **Registration is JS-only.** Unlike unfocus effects, there is no `openstation_register_window_reveal_script()` PHP companion yet, so a reveal registered by a plugin activated mid-session appears in the selector only after a reload — and a deactivated plugin's reveal stays listed until a reload too (`owner` is recorded, but nothing sweeps by it on deactivation yet). Same known gap as palettes.

The raw `os.window-reveals` JS filter receives the registry array on every read, mirroring `os.unfocus-effects` — use it to reorder, remove, or conditionally swap reveals. The user's selection persists in the `windowReveal` OS-settings key (reveal id or `'none'`, the default — reveals are opt-in), readable via `getOsSettings().windowReveal`. An unknown id (a deactivated plugin's reveal still named in user meta) resolves to no reveal rather than to a substitute, and starts working again the moment that plugin re-registers it.
Expand Down
8 changes: 4 additions & 4 deletions docs/mio.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Right-click is bound to the **handle**, the only part of the layer that takes po

**Change shape on its own** is `shapeShuffle`: ticked, Mio picks a new stock silhouette about every minute and eases into it; unticked, it settles back into whichever shape the picker says and stays there. Unticking mid-shuffle eases home rather than snapping — a companion that jumps when you untick a box reads as a glitch.

**Wobble when idle** is `idleWobble`: unticked, Mio holds a still silhouette instead of breathing. Ticking it back on returns to the shipped strength, and the two sliders beneath tune amplitude and rate. Unticking repaints the section, because sliders that no longer do anything should not sit there implying they do.
**Use idle wobble** is `idleWobble`: unticked, Mio holds a still silhouette instead of breathing. Ticking it back on returns to the shipped strength, and the two sliders beneath tune amplitude and rate. Unticking repaints the section, because sliders that no longer do anything should not sit there implying they do.

The **Corners** slider appears only for `Polygon` (`custom`), the one preset that reads `shapeLobes`. A control that does nothing for ten of the eleven shapes teaches people to ignore it.

Expand All @@ -295,9 +295,9 @@ The **Corners** slider appears only for `Polygon` (`custom`), the one preset tha

**Every readout is fixed to two decimals and a fixed width.** The numbers sit on the same row as their tracks, so a readout that grows with its contents shoves the slider sideways *under the thumb the user is dragging*. `<os-range-field>` sizes the box from the range's own bounds rather than from the value it happens to be showing (see its `decimals` prop), which fixes the shift for every slider in the shell, not just Mio's.

### Surprise me
### Try a random look

A randomizer, next to Restore. It writes both halves of a look at once and repaints the panel from what it applied.
A randomizer, next to **Reset Mio's look**. It writes both halves of a look at once and repaints the panel from what it applied.

**A randomizer is a taste filter, not a dice roll.** Uniform noise across every slider produces a grey, dim, seam-ridden thing about nine times in ten, and a user who presses the button twice and gets two of those concludes the feature is broken rather than that they were unlucky. So `randomMioLook()` narrows every range to the part of the space that still reads as Mio:

Expand Down Expand Up @@ -358,7 +358,7 @@ The look merges **last**, after server config and the JS filter. Everything befo

**`setStyle` persists; `setConfig` does not.** That split is deliberate: `setConfig` is the programmatic surface, and a plugin nudging Mio for a moment shouldn't silently become the user's saved look.

**Restore Mio** clears the saved look and repaints the panel from the restored config — every control's value is stale after a reset, so the panel is rebuilt rather than just the config being reset. The cleared look is *written*, not merely forgotten: an empty look is a statement ("I want the site's Mio"), and only a save carries it to the user's other devices.
**Reset Mio's look** clears the saved look and repaints the panel from the restored config — every control's value is stale after a reset, so the panel is rebuilt rather than just the config being reset. The cleared look is *written*, not merely forgotten: an empty look is a statement ("I want the site's Mio"), and only a save carries it to the user's other devices.

---

Expand Down
10 changes: 7 additions & 3 deletions src/desktop-files/settings-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function renderTab( body: HTMLElement ): void {
const intro = document.createElement( 'p' );
intro.className = 'os-file-associations__intro';
intro.textContent =
'Pick which app opens each kind of file when you double-click it on the desktop.';
'Choose the default app for each kind of desktop file. These choices apply to your account and are used the next time you open a file.';
body.appendChild( intro );

const associations = getUserAssociations();
Expand All @@ -77,7 +77,7 @@ function buildRow(

const label = document.createElement( 'label' );
label.className = 'os-file-associations__label';
label.textContent = typeLabel;
label.textContent = `Default app for ${ typeLabel }`;
row.appendChild( label );

const candidates = getOpenersForType( typeSlug );
Expand All @@ -100,7 +100,11 @@ function buildRow(
value?: string;
};
select.setAttribute( 'value', currentId );
select.setAttribute( 'aria-label', `Default app for ${ typeLabel }` );
// `<os-select>` forwards its `label` property to the native
// `<select>` inside the shadow root. An `aria-label` on the host is
// not enough: the component removes it when no `label` property is
// present, leaving the real keyboard target unnamed.
select.setAttribute( 'label', `Default app for ${ typeLabel }` );
select.className = 'os-file-associations__select';
label.htmlFor = `assoc-${ typeSlug }`;
select.id = `assoc-${ typeSlug }`;
Expand Down
33 changes: 20 additions & 13 deletions src/mio/style-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,14 @@ function openMioStylePanelImmediate(): void {
]
: [];

const intro = document.createElement( 'p' );
intro.className = 'os-mio-panel__intro';
intro.textContent = __(
'Changes preview immediately and are saved to your WordPress account as you make them. Reset Mio’s look returns every control in this panel to the look chosen by this site.',
);

body.replaceChildren(
intro,
section( __( 'Shape' ), [
shapePicker( physics.shapePreset, ( preset ) => {
set( { shapePreset: preset } );
Expand All @@ -346,7 +353,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'shapeAmount',
label: __( 'Shape strength' ),
label: __( 'Shape definition (0 is a circle)' ),
min: 0,
max: 1.4,
step: 0.05,
Expand Down Expand Up @@ -380,9 +387,9 @@ function openMioStylePanelImmediate(): void {
},
),
] ),
section( __( 'Idle' ), [
section( __( 'Idle movement' ), [
toggle(
__( 'Wobble when idle' ),
__( 'Use idle wobble' ),
physics.idleWobble > 0,
( next ) => {
// Unticked, Mio holds a still silhouette instead of
Expand All @@ -400,7 +407,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'idleWobble',
label: __( 'Wobble strength' ),
label: __( 'Idle wobble strength (0 is off)' ),
min: 0,
max: 0.4,
step: 0.005,
Expand All @@ -411,7 +418,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'idleWobbleSpeed',
label: __( 'Wobble speed' ),
label: __( 'Idle wobble speed' ),
min: 0,
max: 4,
step: 0.05,
Expand All @@ -435,7 +442,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'hueSpan',
label: __( 'Hue spread' ),
label: __( 'Colour range' ),
min: -360,
max: 360,
step: 1,
Expand All @@ -457,7 +464,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'lightness',
label: __( 'Brightness' ),
label: __( 'Colour brightness' ),
min: 0.15,
max: 1,
step: 0.01,
Expand Down Expand Up @@ -529,7 +536,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'hueSpin',
label: __( 'Spin the gradient' ),
label: __( 'Move gradient around ring' ),
min: -60,
max: 60,
step: 1,
Expand All @@ -540,7 +547,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'hueDrift',
label: __( 'Cycle the colours' ),
label: __( 'Shift colours over time' ),
min: -60,
max: 60,
step: 1,
Expand All @@ -551,7 +558,7 @@ function openMioStylePanelImmediate(): void {
] ),
section( __( 'Hologram' ), [
toggle(
__( 'Holographic' ),
__( 'Use holographic effect' ),
appearance.iridescence > 0,
( next ) => {
// Coming back on lands at the strength the
Expand All @@ -566,7 +573,7 @@ function openMioStylePanelImmediate(): void {
slider(
{
key: 'iridescence',
label: __( 'Iridescence' ),
label: __( 'Holographic strength (0 is off)' ),
min: 0,
max: 2,
step: 0.05,
Expand Down Expand Up @@ -618,7 +625,7 @@ function openMioStylePanelImmediate(): void {
const surprise = document.createElement( 'os-button' );
surprise.setAttribute( 'slot', 'footer' );
surprise.setAttribute( 'variant', 'secondary' );
surprise.textContent = __( 'Surprise me' );
surprise.textContent = __( 'Try a random look' );
surprise.addEventListener( 'click', () => {
const look = randomMioLook();
mio.setStyle( { ...look.appearance, ...look.physics } );
Expand All @@ -628,7 +635,7 @@ function openMioStylePanelImmediate(): void {
const restore = document.createElement( 'os-button' );
restore.setAttribute( 'slot', 'footer' );
restore.setAttribute( 'variant', 'secondary' );
restore.textContent = __( 'Restore Mio' );
restore.textContent = __( 'Reset Mio’s look' );
restore.addEventListener( 'click', () => {
mio.resetStyle();
paint();
Expand Down
18 changes: 15 additions & 3 deletions src/posts-window/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,12 @@ function mountKebabColumnToggles(
const sectionLabel = document.createElement( 'div' );
sectionLabel.className = SECTION_CLASS;
sectionLabel.setAttribute( 'role', 'presentation' );
sectionLabel.textContent = __( 'Show columns' );
const modeLabel = windowMode( client ) === 'pages' ? __( 'Pages' ) : __( 'Posts' );
sectionLabel.textContent = sprintf(
/* translators: %s: Posts or Pages. */
__( 'Show columns in %s' ),
modeLabel,
);
panel.appendChild( sectionLabel );

const itemEls = new Map< string, HTMLElement >();
Expand All @@ -995,7 +1000,15 @@ function mountKebabColumnToggles(
item.setAttribute( 'value', VALUE_PREFIX + col.key );
item.classList.add( 'os-window__menu-item' );
item.classList.add( ITEM_CLASS );
item.textContent = col.label || col.key;
const label = col.label || col.key;
item.textContent =
col.key === 'author' || col.key === 'date'
? sprintf(
/* translators: %s: column name shared by Posts and Pages. */
__( '%s (shared by Posts and Pages)' ),
label,
)
: label;
panel.appendChild( item );
itemEls.set( col.key, item );
}
Expand Down Expand Up @@ -3160,4 +3173,3 @@ registry[ 'desktop-mode-user-edit' ] = (
} );
} );
};

9 changes: 7 additions & 2 deletions src/settings/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export function renderOsSettingsPanel(
<os-panel>
<p class="os-settings__intro">
${ __(
'Personalize your desktop. Changes apply instantly and are saved to this browser.',
'Personalize your desktop. Most changes appear immediately and are saved to your WordPress account. The dot in the title bar shows when saving finishes.',
) }
</p>
${ buildWallpaperSection( ctx, body ) }
Expand Down Expand Up @@ -334,8 +334,13 @@ export function renderOsSettingsPanel(
html`
${ rows.map( ( r ) => r.panel ) }
<os-panel class="os-settings__footer">
<p class="os-settings__reset-note">
${ __(
'Resets every OpenStation Preferences tab for your account. Your uploaded wallpaper file stays in Media Library, but the saved custom-image choice is cleared. This cannot be undone.',
) }
</p>
<os-button variant="ghost" @click=${ onReset }
>${ __( 'Reset to defaults' ) }</os-button
>${ __( 'Reset all OpenStation preferences' ) }</os-button
>
</os-panel>
`,
Expand Down
Loading
Loading