Page MenuHomePhabricator

(MS 5) expose visual query sharing via URL in the UI
Open, HighPublic8 Estimated Story Points

Description

As an editor I want to share my visual query via URL in order to make bug reporting easier and to share my query with other editors.

Problem:
T271820 implements URL sharing but doesn't yet expose it in the UI.

Screenshots/mockups:
Desktop (Layout 1-3)


Mobile (Layout 4)

Tooltip

BDD
GIVEN a visual query
AND
WHEN
AND
THEN
AND

Acceptance criteria:

  • UI has functionality to generate and copy a link to the current visual query
  • url is automatically copied to clipboard

Notes:

  • needs button with icon only component
  • use native element as a placeholder for now until the popover component is there: T273041
  • responsive behavior is handled in a separate ticket
  • for now we show the full URL - URL shortening will be handled in a separate ticket

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptJan 25 2021, 6:04 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Charlie_WMDE updated the task description. (Show Details)Jan 26 2021, 5:12 PM
Charlie_WMDE updated the task description. (Show Details)Jan 27 2021, 9:26 AM
Charlie_WMDE updated the task description. (Show Details)Jan 27 2021, 9:53 AM
Lydia_Pintscher renamed this task from (MS 5) expose query sharing via URL in the UI to (MS 5) expose visual query sharing via URL in the UI.Jan 27 2021, 10:21 AM
Lydia_Pintscher updated the task description. (Show Details)
Lydia_Pintscher set the point value for this task to 8.
Lydia_Pintscher moved this task from Backlog to Ready to pick up on the Wikidata Query Builder board.
Sarai-WMDE updated the task description. (Show Details)Jan 27 2021, 3:39 PM
Sarai-WMDE updated the task description. (Show Details)Jan 27 2021, 3:44 PM
Sarai-WMDE updated the task description. (Show Details)Jan 28 2021, 12:58 PM
Charlie_WMDE changed the task status from Open to Stalled.Mon, Feb 1, 3:51 PM

stalled while i figure some things out

Lydia_Pintscher raised the priority of this task from Medium to High.Mon, Feb 8, 9:20 AM
Charlie_WMDE changed the task status from Stalled to Open.Tue, Feb 9, 2:38 PM
Charlie_WMDE removed Charlie_WMDE as the assignee of this task.
Charlie_WMDE updated the task description. (Show Details)
Charlie_WMDE added a subscriber: Charlie_WMDE.

The link icon type is not yet released. I'll do a pre-release for this.

I made a very WIP PR on this but some notes I figured during the work:

  • While still w3c says you need to show the text through input to able to copy to clipboard (and ooui is the same too) but the new API for copying to clipboad is usable for us because we don't support IE11 anyway (https://caniuse.com/?search=writeText) so in my PR I stopped showing the url altogether.

  • OTOH, I think we should not show it on hover. Not just it's complicated to combine with focus state (e.g. user on mouse enter, set it to active, then click on the button and make it focused, it's active again but on mouse leave should trigger hiding it...) and it'll also cause issues in matter of producing short urls all the time, it'll quickly get rate limited if let it generate one per hover. Maybe, we copy the long one on hover but with a different button we copy the short url on click?

The new kibana (logstash frontend) has this:

Also for firefox:

Writing to the clipboard is available without permission in secure contexts and browser extensions, but only from user-initiated event callbacks. Browser extensions with the "clipboardWrite" permission can write to the clipboard at any time.