Page MenuHomePhabricator

As a user of syntax highlighting I would like the toggle behavior to feel natural and be useful to me
Closed, ResolvedPublic

Description

Why are we doing this?

We have the ability to tell if text in the editor has Wikitext syntax applied to it, so we would like to be able to give users the ability to toggle syntax on and off.

User story

As a user of syntax highlighting I would like the toggle behavior to feel natural and be useful to me

Questions

Do we want special cases for Headers and Indentations?


Scenarios

User has text highlighted

Scenario 1A: No syntax applied

  1. The user highlights a string that does not have any Wikisyntax applied to it
  2. The user taps on an option from the toolbar to apply Wikisyntax to the highlighted string

Expected result: the appropriate syntax is applied to the highlighted text

Scenario 1B: Syntax applied (full string)

  1. The user highlights a string that has Wikisyntax applied to it (eg. they have highlighted the entirety of '''this is a bolded string''')
  2. The associated toolbar icon is toggled to active (in this case Bold)
  3. The user taps on the active icon

Expected result: the appropriate syntax is removed from the highlighted text

Scenario 1C: Syntax applied (partial string)

  1. The user highlights a portion of a string that has Wikisyntax applied to it (eg. they have highlighted just the word bolded in the string '''this is a bolded string''')
  2. The associated toolbar icon is toggled to active (in this case Bold)
  3. The user taps on the active icon

Expected result: Just the word bolded is unbolded
(eg. the output is now '''this is a''' bolded '''string''')

Scenario 1D: Applying additional syntax

  1. The user highlights a string that has Wikisyntax applied to it (eg. they have highlighted part of or the entirety of '''this is a bolded string''')
  2. The associated toolbar icon is toggled to active (in this case Bold)
  3. The user taps on the toolbar icon of a non-active syntax toggle (eg. Italics)

Expected result: The string or portion of the string they highlighted is now both bold and italicized

User placed their cursor in the editing view but has not highlighted any text

Scenario 2A: User places cursor in an area that has no syntax applied to it

  1. User places their cursor in the editing view (either inside of a string or a space)
  2. User taps on a syntax button from the toolbar

Expected result: The appropriate syntax is input and the cursor is placed in the middle of the syntax (eg. for bold the result would be ''' [CURSOR PLACED HERE]'''

Scenario 2B: User places cursor in an area that has syntax applied to it, but doesn't highlight any text and taps the same syntax element

  1. User places their cursor in the editing view any where within the following string '''This is example text'''
  2. The associated toolbar icon is toggled to active (in this case Bold)
  3. The user taps on the Bold icon again

Expected result: The Bold icon is deactivated in that space and the bold syntax is closed only for the area where the cursor is placed.
(eg. the output could not be '''This is''' [CURSOR PLACED HERE] '''example text''')

Scenario 2C: User places cursor in an area that has syntax applied to it, but doesn't highlight any text and taps a different syntax element

  1. User places their cursor in the editing view any where within the following string '''This is example text'''
  2. The associated toolbar icon is toggled to active (in this case Bold)
  3. The user taps on the Italic icon

Expected result: The Bold icon is still active, the Italic icon is now active and the italics syntax is applied within the bold syntax
(eg. the output could not be '''This is ''[CURSOR PLACED HERE]'' example text''')

Scenario 2D: Deselecting after applying by any of the scenarios outlined in this section

  1. Pre-requisite of user following Scenario 2A, 2B, or 2C
  2. User taps on the syntax button they just applied again

Expected result: Syntax around the cursor is removed.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@JMinor we're having some different behaviors occurring depending on the icon/syntax so we might want to bring this back to Pogo as a QA ticket?

Summary of bugs to be fixed in 6.2:

  • Formatting in template not changing button state
  • Underline and other HTML tag formatting is not behaving as expected (should work the same as bold and italic as defined in this ticket)

Fix edit anchor button state when selection is nested inside template:
https://phabricator.wikimedia.org/T216176

Fix edit bold and italic button state when selection is nested inside template:
https://phabricator.wikimedia.org/T216215 (blocked on upstream ticket: https://phabricator.wikimedia.org/T216210)

Mhurd removed Mhurd as the assignee of this task.Feb 25 2019, 7:13 PM
Mhurd moved this task from Doing to Blocked or Waiting on the iOS-app-v6.2.1-Beluga-On-Stilts board.

Per Josh parking this in blocked until we chat about it at grooming later today.

Currently the section User placed their cursor in the editing view but has not highlighted any text is not behaving as expected for 'Bold'. Instead of inserting the Syntax it is turning the whole paragraph bold.

I'm still seeing the same issue with Scenario 2A as described above, but it only occurs the first time that I select bold from the text formatting sub menu, and not subsequent times

Currently the section User placed their cursor in the editing view but has not highlighted any text is not behaving as expected for 'Bold'. Instead of inserting the Syntax it is turning the whole paragraph bold.

Otherwise this is looking and behaving well!

@cmadeo I'm not able to repro this, but maybe I'm missing something. I'm fully quitting > opening an article (Space X) > tapping edit (history section) > tapping anywhere in the article to move the cursor > tapping "A" menu > Tapping "Bold"

cmadeo added a project: Product-QA.

@JoeWalsh I can't repro this again so I'm going to move it over to needs QA.

ABorbaWMF subscribed.

This one looks good to me on 6.2.1 (1593)