Page MenuHomePhabricator

[Share Highlights] Only show FAB when 2+ words are selected
Closed, ResolvedPublic2 Estimated Story Points

Description

Current: Floating Action Button for Share Excerpt shows when only one word is selected
Expected: FAB shows only when 2+ words are selected since sharing intent is unlikely for selecting one word

Recommend using Intl.Segmenter to detect "word" count to handle zh text (needed for the experiment) and other languages that don't use regular word spacing.

Event Timeline

HSwan-WMF set the point value for this task to 2.Apr 28 2026, 4:35 PM
mfossati changed the task status from Open to In Progress.Apr 29 2026, 2:10 PM

Change #1278492 had a related patch set uploaded (by Marco Fossati; author: Marco Fossati):

[mediawiki/extensions/ReaderExperiments@master] ShareHighlight: text selection edge cases & word-based activation

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

Change #1278492 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] ShareHighlight: text selection edge cases & word-based activation

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

Etonkovidova subscribed.

Checked on enwiki beta - the gif is below:

two_words highlighting2.gif (421×835 px, 214 KB)

**//Note://**
There are plenty of cases where the rule - " Only show FAB when 2+ words are selected" is not followed, but for the first iteration of share highlight functionality the happy path for two-word only highlight limitation should suffice.

Cases where the two-word highlight rule might is "broken"

  • when a picture is involved in highlighting:

(1) Only picture is selected

Screenshot 2026-05-07 at 10.12.45 AM.png (786×1,210 px, 609 KB)

(2) one word from a heading and a picture are selected
Screenshot 2026-05-07 at 10.24.59 AM.png (760×1,302 px, 368 KB)

(3) a picture and a word from caption is selected

Screenshot 2026-05-07 at 10.25.15 AM.png (796×1,340 px, 378 KB)

Thanks for spotting these edge cases. I've pasted them in T425716: [Share Highlights] FAB display edge cases. Not an experiment's blocker.