Page MenuHomePhabricator

Show read-mode errors from the Wikifunctions integration inline rather than in a box, so that editors can be less disrupted when something is wrong
Closed, ResolvedPublic

Description

Description

Make function call errors appear inline so that they are not too disruptive to the reading experience, but they can effectively guide editors towards successfully understanding and fixing the issue.

Desired behavior/Acceptance criteria

  • In Read pages:
    • Failing function calls are rendered inline with a minimal text and style according to the specified design.
    • Failing function calls inline blocks can still redirect the relevant error section in the user help page.
  • In Visual Editor article preview:
    • Failing function calls are rendered exactly as in Read pages
    • Click on the failing function call inline block renders the Context popup
  • In Visual Editor context popup:
    • The context popup has a clear error state and message.
    • The "Learn more" link redirects the user to the relevant error section in the user help page.
  • There is continuity with Q3 error detection and reporting (same links for same error cases)

Devices and Design (URLs or screenshots)

https://www.figma.com/design/sMOc0itmJIm6qthj8XKfMd/T363391-Design-prototype-for-WF-use-case-in-WP?node-id=474-11464&p=f&t=00vxBg3FpCCs7jIn-0

1. Read page2. VE Article preview3. VE Context popup
---
read-page.png (512×236 px, 91 KB)
article-preview.png (512×236 px, 93 KB)
context-popup.png (812×375 px, 128 KB)

Subtasks

  • Design clarifications needed: T391117: Design: Revisit the early designs for inline display of Wikifunctions errors in Wikipedia articles
  • ClientHook: Refactor buildErrorDom method so that it produces an inline element with the appropriate style and icons.
    • Element must have specific styling, preceding error icon and must be displayed inline. The message rendered is minimal.
    • There should be continuity from Q3 features: error messages contain a link to the error page and particular section for this error, the new error display should also be able to redirect to the exact help page section.
    • If there's need to share the error key with VE, add the particular error message key (e.g. "wikilambda-functioncall-error-unclear") as a data-* DOM attribute so that it can be extracted and used from the VE context item.

Completion checklist

Event Timeline

DSantamaria triaged this task as Medium priority.Apr 9 2025, 4:59 PM
DSmit-WMF changed the task status from Open to In Progress.May 22 2025, 1:44 PM
DSmit-WMF updated Other Assignee, added: DSmit-WMF.

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

[mediawiki/extensions/WikiLambda@master] Show read-mode errors from the Wikifunctions integration inline

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

DSmit-WMF updated Other Assignee, removed: DSmit-WMF.
DSmit-WMF added a subscriber: gengh.

Change #1137023 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Show read-mode errors from the Wikifunctions integration inline

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

Checked on testwiki wmf.6 (Read mode) and dagwiki wmf.5 (VE mode)

Read modeVE mode
Screenshot 2025-06-17 at 6.45.54 PM.png (1×820 px, 185 KB)
Screenshot 2025-06-17 at 4.56.14 PM.png (878×1 px, 125 KB)
Screenshot 2025-06-17 at 5.03.33 PM.png (1×636 px, 111 KB)

Testing Notes

  • the performance, i.e. loading a page with functions, opening VE, preview - is still problematic both tewtwiki and dagwiki
  • some functions, e.g. Z18453 (centimetre to inch), return nan for the invalid input; nan does not trigger the error message.
Screenshot 2025-06-17 at 7.02.18 PM.png (1×678 px, 78 KB)
Screenshot 2025-06-17 at 4.33.53 PM.png (1×864 px, 146 KB)
Screenshot 2025-06-17 at 6.51.23 PM.png (1×910 px, 97 KB)
  • (mobile) Help button (GrowthExperiment feature) is hiding behind the function dialog box, but it's still functioning. A user clicks on "Delete" button intending to delete a function but, instead, the Help panel will be displayed - see the gif below:

function_help dialog confilict2.gif (784×375 px, 147 KB)

some functions, e.g. Z18453 (centimetre to inch), return nan for the invalid input; nan does not trigger the error message.

Yup, that's up to the Function to decide what is an Error from their POV and to throw.

  • (mobile) Help button (GrowthExperiment feature) is hiding behind the function dialog box, but it's still functioning. A user clicks on "Delete" button intending to delete a function but, instead, the Help panel will be displayed - see the gif below:

function_help dialog confilict2.gif (784×375 px, 147 KB)

The issue is not specific to inserting wikifunctions - filed as T397381: [mobile] Help button is clickable when not visible