feat(settings): Experimental Tools framework (NPPM-2692)#4591
Open
feat(settings): Experimental Tools framework (NPPM-2692)#4591
Conversation
3cc63bd to
2f6d120
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a new “Experimental Tools” framework to Newspack Settings: external plugins can register tools via a filter, Newspack persists per-tool state in an option, exposes REST endpoints for toggling/saving settings, and adds a new Settings tab with a CardFeature-based UI and configuration view.
Changes:
- Added
Experimental_ToolsPHP manager (filter registration, option storage, REST API, usage tracking) and wired it into plugin includes + Newspack Settings tab data. - Added a new Settings UI section (
experimental-tools) with enable modal + per-tool configure form, plus supporting TS types and styles. - Updated CardFeature styling to better support equal-height cards / action row placement; added unit tests for the new PHP framework.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
includes/experimental-tools/class-experimental-tools.php |
Core framework: registration, persistence, REST routes, accessors, usage tracking. |
includes/class-newspack.php |
Loads the new Experimental Tools class. |
includes/wizards/newspack/class-newspack-settings.php |
Adds “Experimental tools” settings tab when tools are registered. |
src/wizards/newspack/views/settings/sections.tsx |
Lazily loads the new experimental-tools settings section. |
src/wizards/newspack/views/settings/experimental-tools/index.tsx |
Main UI list + configure route switching and REST interactions. |
src/wizards/newspack/views/settings/experimental-tools/configure-view.tsx |
Per-tool configuration form and client-side validation. |
src/wizards/newspack/views/settings/experimental-tools/enable-modal.tsx |
Enable confirmation modal for tools. |
src/wizards/newspack/views/settings/experimental-tools/types.ts |
Type definitions for tool + field schema. |
src/wizards/newspack/views/settings/experimental-tools/style.scss |
Styles for the configure view / display fields. |
packages/components/src/card-feature/style.scss |
Layout adjustments for CardFeature. |
tests/unit-tests/experimental-tools.php |
Unit tests for registration, toggling, metadata, field saving, and usage tracking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/wizards/newspack/views/settings/experimental-tools/configure-view.tsx
Outdated
Show resolved
Hide resolved
src/wizards/newspack/views/settings/experimental-tools/configure-view.tsx
Show resolved
Hide resolved
src/wizards/newspack/views/settings/experimental-tools/configure-view.tsx
Show resolved
Hide resolved
64eeccc to
6dc7841
Compare
6dc7841 to
72109e8
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the generic Experimental Tools framework to newspack-plugin: a filter-based tool registration system, REST API, and a new Settings tab with CardFeature-based UI.
Full details, video walkthroughs, and test plan in the companion PR:
https://github.com/Automattic/newspack-manager/pull/529
🤖 Generated with Claude Code