Add View namespace and storage layer#657
Merged
JeroenDeDauw merged 1 commit intomasterfrom Mar 14, 2026
Merged
Conversation
Introduces the storage infrastructure for Views (ADR 18): - View namespace (NS_NEOWIKI_VIEW = 7476) with neowiki-view-edit permission - ViewContent and ViewContentHandler for JSON storage - viewContentSchema.json and ViewContentValidator for edit-time validation - ViewPersistenceDeserializer to convert stored JSON into domain objects - ViewLookup interface and WikiPageViewLookup implementation - Edit validation hook for the View namespace Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
alistair3149
commented
Mar 6, 2026
| $namespaceNames['en'] = [ | ||
| NeoWikiExtension::NS_SCHEMA => 'Schema' | ||
| NeoWikiExtension::NS_SCHEMA => 'Schema', | ||
| NeoWikiExtension::NS_SCHEMA + 1 => 'Schema_talk', |
Member
Author
There was a problem hiding this comment.
Technically out of scope of this PR, but might as well fix it altogether.
Previously, deleting a schema page will throw an exception because of the lack of talk namespace,
|
|
||
| $contentValidator = ViewContentValidator::newInstance(); | ||
|
|
||
| if ( !$contentValidator->validate( $text ) ) { |
Member
There was a problem hiding this comment.
$text can be null but validate requires string. Or is $text in practice never null?
Member
Author
There was a problem hiding this comment.
$text is ?string and validate() requires string, so this is a real type mismatch. The same issue exists in validateSchemaEdit (line 192) which predates this PR. In practice $text is likely never null in this hook.
alistair3149
added a commit
that referenced
this pull request
Mar 16, 2026
The EditFilter hook provides $text as ?string, but the content validators require string. Guard against null in onEditFilter and narrow the parameter types of the private methods. Follows-up to #657 Co-Authored-By: Claude Opus 4.6 <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.
Went through the browser steps manually and automatically.
Summary
NeoWikiViewcontent model andneowiki-view-editpermissionViewContent/ViewContentHandler(extendsJsonContentHandler, shows JSON on View pages)ViewContentValidator) with edit-time rejectionViewPersistenceDeserializerto convert stored JSON into domainViewobjectsViewLookupinterface andWikiPageViewLookupimplementationPageAssertionExceptionon delete actionsonEditFilter,onContentModelCanBeUsedOn,onCodeEditorGetPageLanguageTest plan
ViewContentValidatorTest(10 tests) passesViewPersistenceDeserializerTest(3 tests) passes{}) rejected with errorPageAssertionException)🤖 Generated with Claude Code