Page MenuHomePhabricator

ZCode: On creating converter, show warning if we detect a Z0 is being written to communicate it will be replaced
Closed, ResolvedPublic

Description

Description

On code converter create pages:

The function is initiated with name and arguments set to Z0. The persistence layer replaces these with the newly created Zid.

If the editor adds the substring "Z0" inside the code expecting it to remain that way, this will fail, as every Z0 will be replaced, not only function and argument names.

Desired behavior/Acceptance criteria

  • When the code includes a Z0 inside a string, show a warning message stating that every Z0 substring will be replaced.

Completion checklist

Event Timeline

Change #1064737 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] [WIP] ZSerialiser and ZDeserialiser Validation: Add Warning for Z0 Placeholder in Converter

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

DSmit-WMF changed the task status from Open to In Progress.Aug 22 2024, 2:15 PM
DSmit-WMF claimed this task.

would it be possible to display the warning* more contextually? eg. above or below the code editor

image.png (1×3 px, 281 KB)

or maybe, what if we display this as a temporary inline comment?

CleanShot 2024-09-02 at 16.20.02@2x.png (1×3 px, 326 KB)

*is it correct to consider this as a warning message, or if it's more a FYI type of thing?

image.png (1×3 px, 281 KB)

@AAlhazwani-WMF would it then be okay to display this warning from the start and not after some event? The warning would be always visible in the case of creating a converter.

Regarding the possible designs, I think I like the second and the third more than the warning!!

after chatting with @gengh we landed on

Every 'Z0' occurrence will be replaced with a system-generated ID in your code upon publishing.

image.png (305×729 px, 23 KB)

Change #1064737 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add notice message about Z0 Placeholder in Converter

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