Page MenuHomePhabricator

Investigate bootstrapping VE tools on Parsoid read mode HTML
Open, Needs TriagePublic

Description

This task involves the work of investigating how we might leverage Parsoid read mode HTML to offer VE tools within read mode.

The value and need for this exploration emerged during the 24 September 2024 Growth <> Editing Team meeting wherein we converged on thinking:

  1. Surfacing the "Add a link" Suggested Edit in read mode shows the most promise
  2. The underlying tools necessary to offer the UX we imagine for "1." depends on VE tools like text highlighting to be available which, in turn, depends on:
    • Having the VE data model available and by extension, having the full Parsoid HTML available. See more details in the discussion between @DLynch and @Sgs.

Open questions

@DLynch can you please populate this section with the questions we'd be seeking to answer through this investigation?

Done

  • Answers to all Open questions are documented

Event Timeline

There's sub-questions here:

  1. Can we activate VE from a pristine Parsoid read view?
  2. How often do we actually have a pristine Parsoid read view? (DiscussionTools adjusts HTML, MobileFrontend does wild things to headings and sections, gadgets sometimes add/remove things, browser extensions can meddle, etc.)

There's possibly a subset of functionality that we might want to prioritize: can we extract enough data from the read mode Parsoid HTML that we can reliably translate a selection from the read view into a selection on the edit mode HTML that we fetch as-normal? It'd be slower than being able to fully rely on the read mode HTML, but it'd unlock much of the functionality we want.

Follow-up from yesterday's meeting: I was wondering if we can do this simpler. My thought was along the following lines:

  • to use the existing edit-check logic on the server side to determine whether a page has a peacock word (and maybe store that info somewhere),
  • then use the simple GrowthExperiments logic to highlight that word in the reading mode,
  • and ultimately forward the user to Visual Editor where the existing edit-check could take over.

That would work around the existing issue of "activate VE on a pristine Parsoid read view".

Follow-up from yesterday's meeting: I was wondering if we can do this simpler. My thought was along the following lines:

  • to use the existing edit-check logic on the server side to determine whether a page has a peacock word (and maybe store that info somewhere),

I'd like to understand better about this, what's the source of truth for "edit checks"? Are they available in the server?

  • then use the simple GrowthExperiments logic to highlight that word in the reading mode,
  • and ultimately forward the user to Visual Editor where the existing edit-check could take over.

That would work around the existing issue of "activate VE on a pristine Parsoid read view".

Generally speaking, I'm unsure on how worth it is to tackle the complexities of highlighting specific words and manipulate the HTML article in read mode in general vs simpler existing metaphors, eg: a template at the top of the article. Specially since the "forward the user to VE" seems unavoidable.