Page MenuHomePhabricator

No-JS page
Closed, ResolvedPublic

Description

As an editor using a browser without JS support I want to be able to use a minimal version of the Special:NewLexeme page in order to still be able to contribute new Lexemes.

Problem:
We need to provide a minimal Lexeme creation experience for editors with browsers without JS support.

Screenshots/mockups:
https://www.figma.com/file/XoYktoKEBnC0VIf1SRuxJK/Lexicographical-Data-UI?node-id=905%3A2604

BDD
GIVEN an editor using a browser with no JS support
WHEN opening Special:NewLexeme
THEN a minimal input page is shown without suggesters for input fields etc.

Acceptance criteria:

  • editors with browsers without JS support get a basic input page for creating Lexemes

Notes:

  • We accept that in this mode you’ll need to enter Q-IDs etc without suggesters
  • In general we want the infobox to be the same in the non-JS and JS version of the page.
  • Errors are shown post-submit in an error box above the Create Lexeme button like on the JS version. All errors are shown in the same way and we don't have individual field errors.

Event Timeline

@Erdinc_Ciftci_WMDE Can you please adjust the mockup to also include an input field for the spelling variant? Thanks!

Errors are shown post-submit in an error box above the Create Lexeme button like on the JS version. All errors are shown in the same way and we don't have individual field errors.

Here’s what we currently get, more or less out of the box:

Screenshot 2022-04-29 at 16-32-43 Create a new Lexeme (experimental) - wiki1.png (475×1 px, 89 KB)

This order is encoded in HTMLForm::getHTML():

		$html = ''
			. $this->getErrorsOrWarnings( $submitResult, 'error' )
			. $this->getErrorsOrWarnings( $submitResult, 'warning' )
			. $this->getHeaderText()
			. $this->getBody()
			. $this->getHiddenFields()
			. $this->getButtons()
			. $this->getFooterText();

Changing it is going to be fairly painful, I think… the best way is probably to override getHTML() (it is @stable to override), but I’m worried that we might miss out on future changes made to that method (e.g. if another “segment” gets added to this $html).

Apart from the placement and appearance of errors, I think this task is basically done already – it’s possible to create lexemes, the info panel is rendered independent of JS already, and the spelling variant selector even includes language names.

One possible further improvement would be to provide <datalist>s for the language and lexical category, which would then be presented as suggestions on those inputs (while still letting users enter other item IDs – see https://wdmm.toolforge.org/ for an example of this technique). But I’m not convinced that would be worth the effort (for the lexical category, this could be the same list of item IDs as in T298150, but for the language it would have to be a new thing).

One thing I just noticed is that the Figma mockup for the non-JS design includes the “You can check whether a Lexeme already exists…” message. Currently, the no-JS form doesn’t have that – should we add it? (This could also avoid the problem of the form “jumping down” on the page once JS initializes.)

One possible further improvement would be to provide <datalist>s for the language and lexical category, which would then be presented as suggestions on those inputs (while still letting users enter other item IDs – see https://wdmm.toolforge.org/ for an example of this technique). But I’m not convinced that would be worth the effort (for the lexical category, this could be the same list of item IDs as in T298150, but for the language it would have to be a new thing).

I assume they would see the IDs only in the suggestions, not the label of those suggestions in the UI language? If that's correct then I agree it doesn't seem worth it at this point.

One thing I just noticed is that the Figma mockup for the non-JS design includes the “You can check whether a Lexeme already exists…” message. Currently, the no-JS form doesn’t have that – should we add it? (This could also avoid the problem of the form “jumping down” on the page once JS initializes.)

That sounds good to me, yes.

One possible further improvement would be to provide <datalist>s for the language and lexical category, which would then be presented as suggestions on those inputs (while still letting users enter other item IDs – see https://wdmm.toolforge.org/ for an example of this technique). But I’m not convinced that would be worth the effort (for the lexical category, this could be the same list of item IDs as in T298150, but for the language it would have to be a new thing).

I assume they would see the IDs only in the suggestions, not the label of those suggestions in the UI language? If that's correct then I agree it doesn't seem worth it at this point.

No, we could show labels as well, which would be separate from the item ID value that gets submitted with the form. WDMM example:

Screenshot from 2022-05-03 10-58-19.png (158×435 px, 20 KB)

One possible further improvement would be to provide <datalist>s for the language and lexical category, which would then be presented as suggestions on those inputs (while still letting users enter other item IDs – see https://wdmm.toolforge.org/ for an example of this technique). But I’m not convinced that would be worth the effort (for the lexical category, this could be the same list of item IDs as in T298150, but for the language it would have to be a new thing).

I assume they would see the IDs only in the suggestions, not the label of those suggestions in the UI language? If that's correct then I agree it doesn't seem worth it at this point.

No, we could show labels as well, which would be separate from the item ID value that gets submitted with the form. WDMM example:

Screenshot from 2022-05-03 10-58-19.png (158×435 px, 20 KB)

Ah great. Ok. Then let's keep it in mind as something that's possible if there are requests but not do it for now.

One thing I just realized is that this is strictly a no-JS page. Users who have JS, but in a browser that doesn’t support Vue 3 (like IE11), get nothing:

image.png (701×820 px, 99 KB)

(Usually, the form should be between the intro paragraph and the info panel.)

😬 Is there anything we can do about that?

I think it’s solvable, but should probably have its own Phabricator task.