Page MenuHomePhabricator

Inconsistencies around the highlight of the default comment summary
Closed, ResolvedPublic

Description

Right now, the default comment summary gets highlighted only when the "Advanced" option is opened for the first time since loading/switching to any Reply mode (Visual/Source).

It does not get highlighted in the following scenarios:

Scenario 1:

  1. Open the Reply tool.
  2. Click on "Advanced" link.
  3. Close the "Advanced" option.
  4. Draft a comment.
  5. Open the "Advanced" option again.

Scenario 2:

  1. Open the Reply tool.
  2. Click on "Advanced" link.
  3. Close the "Advanced" option.
  4. Open the "Advanced" option again.
  5. Now switch the Reply mode.
  6. Close the "Advanced" option.
  7. Open the "Advanced" option again.

Scenario 3: (which might not be an issue if T263061 gets fixed)

  1. Open the Reply tool.
  2. Open the Advanced option.
  3. Switch to the other Reply mode (for example: Source mode).
  4. Click on "Cancel" to close the Reply tool.
  5. Open the Reply tool again.

Observe that, the Advanced option is still open but the comment summary is not highlighted.

Browser: Chrome

Wiki: English

Environment: Beta

Page: https://en.wikipedia.beta.wmflabs.org/wiki/User_talk:RYasmeen_(WMF)/sandbox

Event Timeline

The purpose of selecting the summary after the section comment is to give you quick way to delete it without removing the section comment. As soon as it has been modified we revert to putting the cursor at the end so it can be modified some more.

This logic broke slightly when fixing the auto-save behaviour.

Change 628920 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] Only reset summaryPrefixLength on user event

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

Change 628920 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Only reset summaryPrefixLength on user event

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

Scenario 2
This is not behaving as I'd expect ("Observed behavior" below). @Esanders, does this look expected to you?

Observed behavior

  1. Click any [ reply ] link in this section to open the Reply Tool: https://en.wikipedia.beta.wmflabs.org/wiki/Talk:Cats#Testing_T257651
  2. Click on "Advanced" link.
  3. Close the "Advanced" option.
  4. Open the "Advanced" option again.
  5. Now switch the Reply mode.
  6. Close the "Advanced" option.
  7. Open the "Advanced" option again.

Actual

  1. ❗️Notice the following text is highlighted: /* Testing T257651 */ Reply [i]

Expected

  1. ✅Notice the following text is highlighted: Reply

i.

Change 632768 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] Simplify edit summary selection logic

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

Change 632768 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Simplify edit summary selection logic

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