Skip to content

Commit 565b6f5

Browse files
authored
Follow-up to #76: block-inspector precedence test, ROADMAP truth-up (#78)
Lands the two follow-ups from the #76 review, plus one piece of local-tooling hygiene. ## Regression test for the precedence fix #76's change to `loadBlockInspectorPref` shipped with no coverage; the review verified empirically that reintroducing the exact bug the new guard prevents (explicit per-origin `false` falling through to a `_global` `true`) passed the whole suite. New content-lifecycle block [41] closes that: it stubs `WPDBlockInspector` on the harness context and asserts all four precedence outcomes through the real content script. The suite is now 286 assertions; the injected-regression check fails as intended with the new block in place. ## ROADMAP accuracy Store states an external contributor cannot see from the repo: - v0.11.x status now reads "readiness complete; CWS submission approved, publication pending" — the unlisted Chrome Web Store submission is approved but has not been published, so "shipped" overstated it. - The Safari row moves the App Store Connect record, listing assets, and the submitted 1.0.0 build into Done, with App Review outcome as the remaining gate; status is now "in review". The store-readiness checklist ticks the bundle-identifier rename (#72) and the publisher account to match. ## eslint ignore for build/ `build/` (gitignored since #75) holds the App Store archive and exported installer. The archived `.app` contains copies of the shipped bundles, so a local archive breaks `npm run lint` with ~175 errors on files that are not lintable source. Added to the eslint ignores alongside `safari-build/`. No runtime changes; `dist/` untouched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents a2b5824 + 2abece8 commit 565b6f5

3 files changed

Lines changed: 48 additions & 5 deletions

File tree

‎ROADMAP.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ A milestone-level view of where this project is heading. Day-to-day work is trac
99
| **v0.8.x** | Public scaffold under the WordPress org. React popup architecture, Site Information panel, Block Inspector, host detection, developer tools. | shipped |
1010
| **v0.9.x** | **Features:** account menu in the popup header (display name, role, profile / Gravatar); extension options page with browser-wide preferences (admin bar default, Site Information opt-in, clear-data); toolbar icon redesigned for contrast on any browser chrome; admin bar attribution comment when the extension is hiding it. **Build:** popup bundle migrated from `10up-toolkit` to `@wordpress/scripts`. **Security:** REST root and profile URL validated against same-origin so a hostile page can't redirect the extension's authenticated calls. (The Xcode project / display-name rename to "WordPress Browser Extension" shipped in v0.8.3.) | shipped |
1111
| **v0.10.x** | **Features:** "My Sites" launcher, a global popup section listing the WordPress sites you are signed in to, with site icons, rename, and remove ([#43](https://github.com/WordPress/browser-extension/pull/43)); Edit button for template-backed pages on block themes, such as the blog index and archives, deep-linked into the site editor ([#22](https://github.com/WordPress/browser-extension/issues/22)); Chrome i18n localization scaffold via `_locales` ([#28](https://github.com/WordPress/browser-extension/issues/28)); toolbar icon redesigned into a solid three-state mark shared by Chrome and Safari, improving contrast on any browser chrome ([#15](https://github.com/WordPress/browser-extension/issues/15), [#31](https://github.com/WordPress/browser-extension/issues/31)); Edit and WordPress Admin actions gated by the signed-in user's capabilities ([#34](https://github.com/WordPress/browser-extension/issues/34)); modifier-click and middle-click open links in a new tab ([#29](https://github.com/WordPress/browser-extension/issues/29)). **Fixes:** admin and login links on subdirectory installs ([#33](https://github.com/WordPress/browser-extension/issues/33)); service-worker `runtime.lastError` noise that lit the extension Errors badge ([#37](https://github.com/WordPress/browser-extension/issues/37)). **Hardening:** a packaging integrity check, stricter admin-bar URL validation, and a degradation / security / accessibility pass ([#45](https://github.com/WordPress/browser-extension/pull/45), [#46](https://github.com/WordPress/browser-extension/pull/46)). | shipped |
12-
| **v0.11.x** | **Chrome store-readiness phase. No new features.** Permissions audit with per-permission rationale in `SECURITY.md`; the packaged Chrome build drops the redundant `activeTab` permission ([#61](https://github.com/WordPress/browser-extension/issues/61)). Privacy policy published via GitHub Pages. Chrome Web Store listing copy and promotional images. Chrome publisher account resolved (WordPress Foundation). Correctness linting wired into CI. Ships as the unlisted Chrome Web Store release-candidate submission. | shipped |
13-
| **Safari store readiness** | Safari / Mac App Store submission prep, decoupled from the Chrome track so neither gates the other. Done: bundle identifiers moved to `org.wordpress.browserextension` under the WordPress Foundation Apple Developer account. Remaining: App Store Connect app record and submission; re-evaluation of the `activeTab` removal on Safari ([#61](https://github.com/WordPress/browser-extension/issues/61)); per-store listing assets. Safari mobile preview window sizing in fullscreen Spaces ([#13](https://github.com/WordPress/browser-extension/issues/13)) remains tracked. | in progress |
12+
| **v0.11.x** | **Chrome store-readiness phase. No new features.** Permissions audit with per-permission rationale in `SECURITY.md`; the packaged Chrome build drops the redundant `activeTab` permission ([#61](https://github.com/WordPress/browser-extension/issues/61)). Privacy policy published via GitHub Pages. Chrome Web Store listing copy and promotional images. Chrome publisher account resolved (WordPress Foundation). Correctness linting wired into CI. Ships as the unlisted Chrome Web Store release-candidate submission. | readiness complete; CWS submission approved, publication pending |
13+
| **Safari store readiness** | Safari / Mac App Store submission prep, decoupled from the Chrome track so neither gates the other. Done: bundle identifiers moved to `org.wordpress.browserextension` under the WordPress Foundation Apple Developer account; App Store Connect record, listing assets, and the 1.0.0 build submitted for App Review. Remaining: App Review outcome; re-evaluation of the `activeTab` removal on Safari ([#61](https://github.com/WordPress/browser-extension/issues/61)). Safari mobile preview window sizing in fullscreen Spaces ([#13](https://github.com/WordPress/browser-extension/issues/13)) remains tracked. | in review |
1414
| **v1.0** | Initial official directory releases under the WordPress publisher account: **Chrome Web Store** and **Safari / Mac App Store** (the two surfaces this codebase already ships). API and permissions surface frozen; deprecation policy locked. | release candidate ([v1.0.0-rc1](https://github.com/WordPress/browser-extension/releases/tag/v1.0.0-rc1)) — gated on Safari store-readiness |
1515
| **post-1.0** | Expansion to additional browser directories — **Firefox Add-ons (AMO)** (requires a manifest v2/v3 compatibility audit; Firefox's WebExtension surface diverges from Chromium in a few places) and **Edge Add-ons** (typically rides the Chrome Web Store submission, but the WordPress publisher-account question may differ). Ongoing host-detection additions as managed-WordPress platforms ship new signatures. | gated by 1.0 launch signal |
1616

@@ -26,10 +26,10 @@ The Chrome store-readiness gates, all landing with the v0.11.0 release:
2626

2727
## Safari store-readiness checklist (follows v0.11.x)
2828

29-
- [ ] Xcode project rename: project paths, scheme name, bundle identifier prefix. Tracked in [`SAFARI.md`](SAFARI.md). Requires the Apple Developer account holder's coordination.
30-
- [ ] Apple App Store Connect publisher account. Requires WordPress Foundation alignment — see [`MAINTAINERS.md`](MAINTAINERS.md#project-governance-for-non-maintainer-decisions). Firefox / Edge publisher questions remain deferred to post-1.0.
29+
- [x] Xcode project rename: project paths, scheme name, bundle identifier prefix (`org.wordpress.browserextension`, [#72](https://github.com/WordPress/browser-extension/pull/72)). Tracked in [`SAFARI.md`](SAFARI.md).
30+
- [x] Apple App Store Connect publisher account (WordPress Foundation). Firefox / Edge publisher questions remain deferred to post-1.0.
3131
- [ ] Re-evaluate removing `activeTab` from the shared manifest on Safari ([#61](https://github.com/WordPress/browser-extension/issues/61)).
32-
- [ ] Safari / Mac App Store listing assets.
32+
- [x] Safari / Mac App Store listing assets.
3333

3434
## Intentionally out of scope (for now)
3535

‎eslint.config.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = [
1818
'release/**',
1919
'safari/**',
2020
'safari-build/**',
21+
// App Store archive/export output (gitignored); the archived .app
22+
// carries copies of the bundles that are not lintable source.
23+
'build/**',
2124
'test/node_modules/**',
2225
],
2326
},

‎test/content-lifecycle.js‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,46 @@ async function main() {
225225
assert(hintsIn(anon).length === 0, 'no hint without a cached logged-in claim');
226226
}
227227

228+
// --- 41. Block inspector pref precedence (per-origin, then _global) ------
229+
{
230+
console.log('\n[41] block inspector honours per-origin over _global (#76)');
231+
232+
// Observes enable/disable instead of loading the real inspector: the
233+
// harness ctx is content.js's globalThis, so a stub installed before
234+
// runContent() receives exactly the calls the page would.
235+
const inspect = (storageData) => {
236+
const page = makePage(WP_LOGGED_IN_PAGE, { storageData });
237+
const calls = { enabled: 0, disabled: 0 };
238+
page.ctx.WPDBlockInspector = {
239+
enable: () => { calls.enabled++; },
240+
disable: () => { calls.disabled++; },
241+
};
242+
page.runContent();
243+
return settle().then(() => calls);
244+
};
245+
246+
const viaGlobal = await inspect({
247+
wp_preferences_v1: { _global: { blockInspectorEnabled: true } },
248+
});
249+
assert(viaGlobal.enabled === 1, 'a _global default alone enables the inspector');
250+
251+
const originWins = await inspect({
252+
wp_preferences_v1: {
253+
'https://example.com': { blockInspectorEnabled: false },
254+
_global: { blockInspectorEnabled: true },
255+
},
256+
});
257+
assert(originWins.enabled === 0, 'explicit per-origin false beats a _global true');
258+
259+
const viaOrigin = await inspect({
260+
wp_preferences_v1: { 'https://example.com': { blockInspectorEnabled: true } },
261+
});
262+
assert(viaOrigin.enabled === 1, 'per-origin true enables with no _global set');
263+
264+
const unset = await inspect({ wp_preferences_v1: {} });
265+
assert(unset.enabled === 0, 'nothing set leaves the inspector off');
266+
}
267+
228268
console.log(`\n${failures === 0 ? 'Content lifecycle tests passed.' : failures + ' failure(s).'}`);
229269
process.exit(failures === 0 ? 0 : 1);
230270
}

0 commit comments

Comments
 (0)