RedHerb integration probes cleanups (PR #781 follow-up)#791
Merged
malberts merged 9 commits intofrontend-extensibilityfrom Apr 29, 2026
Merged
RedHerb integration probes cleanups (PR #781 follow-up)#791malberts merged 9 commits intofrontend-extensibilityfrom
malberts merged 9 commits intofrontend-extensibilityfrom
Conversation
764719e to
59544cd
Compare
85b0092 to
213201d
Compare
Base automatically changed from
redherb-sidebar-panel
to
frontend-extensibility
April 28, 2026 15:13
cf6af02 to
1635dc3
Compare
The module is loaded only by Special:RedHerbSubjectFinder and bundles the finder UI; the old name suggested it was for the wiki sidebar. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
testRegistersResourceLoaderModules called execute() on a SpecialPage without setting a context, falling back to RequestContext::getMain()'s shared OutputPage and making the test order-dependent. Construct a DerivativeContext + OutputPage explicitly, mirroring what SpecialPageExecutor does for the other test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
loadSubjectsAndSchemas had no .catch(); a network failure left the panel half-loaded with no user feedback. Log and notify on failure to match the pattern used in CreateChildDialog's save path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The loadSchema .catch() silently set loadedSchema = null, leaving the dialog open with the editor v-if=false and no user feedback. Log, notify, and close the dialog on failure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The provide/inject string was duplicated between init.js and the dialog component in both createChild and editMainSubject; drift would cause inject to return undefined and silently break the dialog. Move each key to a per-module constants.js required from both sides. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The hook is the single source of truth for which RedHerb dialog modules load on every NeoWiki page; pin the contract so a typo or rename in extension.json fails the test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Neither dialog uses any LESS variable; the *-mount classes only set display: contents. Drop the mediawiki.skin.variables.less imports. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hook handlers should use the context-aware msg() method when a Skin or IContextSource is in scope, rather than the wfMessage() global which resolves through RequestContext::getMain(). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
213201d to
08ce879
Compare
The unprefixed RawMessage class is a class_alias shim; the canonical name in MW 1.43 is MediaWiki\Language\RawMessage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Follows-up to #781
Targets
redherb-sidebar-panelso this lands as a stacked review fix into #781 once approved.Addressed
Eight commits, one per finding (read in branch order):
ext.redherb-sidebar→ext.redherb-subject-finder— only loaded bySpecial:RedHerbSubjectFinder; old name was misleading.DerivativeContext + OutputPageintestRegistersResourceLoaderModules— was order-dependent onRequestContext::getMain().SubjectFinderPanel.onSelected— add.catch()so a load failure logs and notifies instead of silently half-loading.CreateChildDialog.loadSchema—.catch()now logs / notifies / closes instead of silently nulling state.DIALOG_OPEN_KEY/DIALOG_STATE_KEYinto per-moduleconstants.js; init.js and .vue share viarequire()instead of duplicated string literals.RedHerbFrontendModulesHookTestto pin the module-name contract.mediawiki.skin.variables.lessimports from both dialog components.wfMessage(...)with$skin->msg(...)inRedHerbSidebarHook(context-aware lookup instead ofRequestContext::getMain()); test stubs updated to mockSkin::msg()via a sharednewSkinStub( Title $title )helper that also dedupes the previous inline stubs.Not addressed
MAIN_SUBJECT_SELECTORmatches any rendered view, not specifically the main subject — needs either a public PHP API or a DOM marker, both intersecting with Establish public PHP API surface for extensions consuming NeoWiki services #789.RedHerbSidebarHookTestcases (testOnlyAddsSubjectFinderLinkOnNonExistentPagesandtestDoesNotCheckMainSubjectForNonExistingTitles) cover the same$title->exists() === falsepath; not collapsed in this PR — judgment call left for the next pass.Manual Browser Check
Special:RedHerbSubjectFinder. Type a schema name, select a subject from the lookup, confirm the infobox renders.?action=subjects.ext.redherb-subject-finder(renamed), notext.redherb-sidebar.Verification
Local run on this branch (NeoWiki dev container, MW REL1_43, PHP 8.3):
make phpunit—OK, 858 tests, 1636 assertions, 7 skipped(28s)vendor/bin/phpcs— clean, 328 files (5s)vendor/bin/phpstan—[OK] No errors, 150 filesBrowser pass (Chrome DevTools, against the running dev wiki on this branch):
Special:RedHerbSubjectFinderwithSchema = Company, pickedACME Inc., theInfoboxrenders all properties (Founded at, Websites, Products, Status, World domination progress).Create child Companyopens theSubjectEditor-backed dialog;Status = Active, labelTest Subsidiary,Createreturns201fromPOST /rest.php/neowiki/v0/page/24/childSubjects; dialog auto-closes;?action=subjectsshowsTest Subsidiary Company • 1 statement.Edit main subjectopens pre-populated with allACME Inc.statements (label, founded, websites, products, status, progress). Changed label toACME Incorporated; on save the page-sideInfobox<h2>reactively updates fromACME Inc.→ACME Incorporatedwith no reload, andUpdated main subject.mw-notify fires. This is the cross-app shared-Pinia path Add frontend-extensibility probes to RedHerb #781 is meant to prove out.load.php?...modules=ext.redherb-create-child,redherb-edit-main-subject,redherb-subject-finder...; no staleext.redherb-sidebarreference..catch()handlers in commits 3 and 4 cover the same code path.