In order to gain a better understanding of the level of effort and impact each option would have, we will create a prototype of the solution.
Timebox: 8 hrs?
From T403149: [MEX] M3.1.2 - Investigate options for improving information saved while publishing
Option 1: Statement-Specific Summary Detection (Recommended)
Level of Effort: Medium (2-3 weeks)
Create a new StatementChangesAnalyzer class (or whatever the the name you see fitting the most) to detect when multiple statements with the same property are being added and generate specific summaries.
Technical Implementation:
// New class: StatementChangesAnalyzer.php class StatementChangesAnalyzer { public function analyzeStatementChanges(ChangeOpResult $changeOpResult): array { // Analyze ChangeOpResult to detect: // - Number of statements added per property // - Whether all changes are to the same property // - Types of changes (add/remove/modify) } public function isSinglePropertyMultipleStatements(array $changes): ?array { // Check if multiple statements are being added to a single property } }
Code Changes Required:
- New Class: StatementChangesAnalyzer.php
- Modified Class: EditSummaryHelper.php - Add statement analysis logic
- New i18n Messages: Add messages for new summary actions
- Tests: Comprehensive test coverage for new functionality
Expected Result:
This will create a new comment value in the comment table in the database.
The used key wbeditentity-batch-single-property can be changed as well, this is just an exanple.
comment_text: /* wbeditentity-batch-single-property:4|P31|3|0|0 */ Added 3 statements for P31
Benefits:
- ✅ Provides specific information about property changes.
- ✅ Maintains consistency with existing Wikibase patterns.
- ✅ Extensible for future enhancements.
- ✅ Doesn't break existing functionality.
Disadvantage:
- ❌ Requires new analysis logic.
- ❌ Medium complexity implementation.