Page MenuHomePhabricator

[MEX] Format simple references
Closed, ResolvedPublic

Description

Update the formatting of references in the MEX view to match the prototype

Current display:

image.png (127×344 px, 6 KB)

Expected formatting
Expanded

image.png (576×318 px, 83 KB)

Unexpanded

image.png (456×318 px, 74 KB)

Figma file

Acceptance Criteria

  • References should appear with the same formatting as the prototype

Notes
This is a read only so no edit links need to be cliackable.

Event Timeline

karapayneWMDE renamed this task from [MEX] Format a simple reference to [MEX] Format simple references.

Change #1169030 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Wikibase@master] Add Vue template for displaying references

https://gerrit.wikimedia.org/r/1169030

Change #1170299 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/vendor@master] Bump wmde/php-vuejs-templating to 2.2.0-beta.7

https://gerrit.wikimedia.org/r/1170299

Change #1170299 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wmde/php-vuejs-templating to 2.2.0-beta.7

https://gerrit.wikimedia.org/r/1170299

Change #1169030 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add Vue template for displaying references

https://gerrit.wikimedia.org/r/1169030

Something’s not right here, I’m getting console warnings like this:

Inconsistent server-rendered HTML for snak with hash 3f38564928b806427a6b5654a9008e93cb73f39a:
<div class="wikibase-snakview wikibase-snakview-3f38564928b806427a6b5654a9008e93cb73f39a">
<div class="wikibase-snakview-property-container">
<div class="wikibase-snakview-property" dir="auto"><a title="Property:P280" href="/wiki1/index.php/Property:P280">lexeme property</a></div>
</div>
<div class="wikibase-snakview-value-container" dir="auto">
<div class="wikibase-snakview-typeselector"></div>
<div class="wikibase-snakview-body">
<div class="wikibase-snakview-value wikibase-snakview-variation-valuesnak"><a href="/wiki1/index.php/Lexeme:L1" title="L1: English, noun"><span lang="en">Lucas</span><span>/</span><span lang="de">Lucas</span><span>/</span><span lang="pt">Lucas</span><span>/</span><span lang="rm-puter">Lucas</span></a></div>
<div class="wikibase-snakview-indicators"></div>
</div>
</div>
</div> != <a href="/wiki1/index.php/Lexeme:L1" title="L1: English, noun"><span lang="en">Lucas</span><span>/</span><span lang="de">Lucas</span><span>/</span><span lang="pt">Lucas</span><span>/</span><span lang="rm-puter">Lucas</span></a>

As far as I can tell, the former HTML comes from the use of that snak in the reference, while the latter comes from its use in the main snak of a later statement.

Ah, in this change the snak HTML store contains, well, snak HTML. Whereas in my earlier change, I used the snak hash as the index, but the HTML is just that of the data value inside. That’s probably on me for making the names so confusing, sorry.

I think we’ll probably have a better time if we only take over the data value HTML from Wikibase and format the rest of the snaks ourselves…

Hmm. Yeah - would be good to be consistent there. It seems like we get a bunch of things 'for free' with the snak HTML (like the property formatting, LTR and some CSS) but of course that makes the whole thing less flexible. I guess we can address that in a follow-up change.