Page MenuHomePhabricator

Evaluate plans for the Cite backlink marker setting via CommunityConfiguration
Closed, ResolvedPublic

Description

Lets try to figure out how we can best integrate a community configuration for the backlink marker symbols.

There's currently a WIP where we played with the genral idea and looks of such a setting. The challenges are, that we'll have a long list of alphabets and users could have different approaches on what keyword they would want to filter this to get to their results.

See T377575: [POC] Initial community configuration page for Cite: reflist backlink label symbol selection

Outcome

Update: we are currently implementing an alternative of option 1: we are using the extension but are adding a subpage for cite.

We'll go with option (2) in which we create a new Codex page based on our proof of concept. Our extension will be the first production integration of a custom Community Configuration page, but this should already be supported by the code. The Growth team is actively helping us fine-tune this integration, and some notes from our discussion are copied below:

Implement the page following the basic structure of https://github.com/wikimedia/mediawiki-extensions-CommunityConfiguration/blob/master/src/EditorCapabilities/GenericFormEditorCapability.php and implement a new subclass of AbstractEditorCapability. Register in extension.json using code like this,

"attributes": {
	"CommunityConfiguration": {
		"EditorCapabilities": {
			"citeEditor": {
				// must be an implementation of IEditorCapability; AbstractEditorCapability is provided as an optional (but recommended) helper
				"class": "MediaWiki\\Extension\\Cite\\CiteEditorCapability" 
				"services": [...]
			}
		},
		"Providers": {
			"cite": {
				"store": {
					"type": "wikipage",
					"args": [ "MediaWiki:CiteConfig.json" ]
				},
				"validator": {
					"type": "jsonschema",
					"args": [...]
				},
				"type": "mw-config" // or "data",
				"options": {
					"editorCapability": "citeEditor" // or whatever the capability was registered as in the above
				}
			}
		}
	}
}

Save the configuration using the action API from the client, or by using $provider->storeValidConfiguration() on the backend.

Options to implement backlink marker settings

1) Add to community configuration extension

Description: We can use the existing extension community configuration (see epic).

  • Pro: Central place for users
  • Pro: Easy to integrate
  • Con: No preview possible

2) Create own special page for cite configs

Description: We can create a new special page for this and other settings for Cite.

  • Pro: Full control of the interface
  • Con: Would need to manage the integration

3) JS module loaded in community configuration

Description: We can add to the community configuration extension.

  • Pro: Add features we need to the default settings page
  • Pro: Preview in community config
  • Con: Would need a hook
  • Is it acceptable? We will talk to the extension maintainers.

Mockup of progressive enhancement button:

image.png (83×262 px, 9 KB)

Event Timeline

WMDE-Fisch renamed this task from Evaluate plans for the backlink Cite Communit Configuration to Evaluate plans for the Cite backlink marker setting via CommunityConfiguration.Jan 8 2025, 12:55 PM

Some feedback from @Michael: the Growth team has gotten multiple requests for a live preview element, our requirements are a good fit for potential improvements there. The interface would be something like:

  • Empty div with a known ID, where the preview can be injected.
  • Hook will fire when input values change (and on initial load).
  • Customizing extension will supply a ResourceLoader module to include on the page.

We're still discussing the per-field customization, but we agree that the ideal is a slightly bigger change which offers full UI customization per field. It's unclear whether patching the DOM structure from a custom RL module will be too hacky.

Ticket will be concluded when we're clear on the plan :-)

awight updated the task description. (Show Details)
awight moved this task from Doing to Tech Review on the WMDE-TechWish-Sprint-2025-01-22 board.
awight added a subscriber: Urbanecm.
awight subscribed.