Page MenuHomePhabricator

Improve SPARQL error handling for "Title entry and topic matching " step in Article Guidance
Open, LowPublic

Description

As part of Article Guidance (T396029), the initial step of "Title entry and topic matching " requires performing complex Wikidata queries. In some cases, they result in the following error message being shown, which leaves the user to a dead end:

simple.wikipedia.org_wiki_Special_NewArticle(Wiki Tablet).png (1,024×768 px, 60 KB)

This ticket proposes to handle this error in the same way as a similar error was supported in T422841: Improve error handling for "Title entry and topic matching " step in Article Guidance. The proposed approach is the same as in the mentioned ticket (internal logging can identify the specific type of error in each case):

This ticket proposes to:

  • Consider approaches for the error not to happen. For example, automatically retry the first time to make sure it is not just a temporary glitch.
  • Provide a more user-friendly message: users may not know (or need to know) what Wikidta is.
  • Provide an explicit option to retry. To avoid the need to delete and add the last character as a workaround.

UX points

New Article Mockup iPhone SE (2).png (750×1,334 px, 91 KB)

  • Avoid showing technical errors to users. e.g. "SPARQL query failed", "Failed to fetch", etc.
  • Retry once automatically before showing any error state.
  • Allow users to continue to article creation when even retry action fails. The existing "None of these, pick a type instead" affordance in the results list already provides this escape hatch on every search, so the hard-failure state does not need to duplicate it.

Behavior

State 0 - Silent retry
On any failure of any query, retry the failed call once after a short delay. If the retry succeeds, render results normally, no error is shown to the user. Applies to all failure type(search, title existence check, follow-up wikidata queries).

State A - Hard failure
Shown only if the silent retry also fails. Renders inline where the results would be:

  • Message: "Couldn't check this subject."
    • Text color: color-subtle
    • Font size: font-size-medium (body default)
    • Font weight: font-weight-normal
  • Try again action (inline, next to the message)
    • Codex CdxButton with weight="quiet" + action="progressive"
    • Text color: color-progressive
    • Font weight: font-weight-normal (demoted — not bold)
    • Zero padding, baseline-aligned with the message
    • Spacing between message and action: spacing-25 (4px)
  • Layout
    • Inline error block margin-bottom: spacing-50 (8px)
    • Footer margin-top: spacing-150 (24px)

State B - Repeated failure
If "Try again" also fails, stay in State A.