Page MenuHomePhabricator

[SPIKE] Create scope for Link MVP
Closed, ResolvedPublicSpike

Description

Background/Goal

At 2022-07-19 DST Sprint Planning, we decided to prioritize scoping an MVP for the Link Codex component since it will help with some of our open tasks such as Card component (T278311) and Color tokens (color tokens T296995 and Red links color T305236). The goal is to scope/refine this component for MVP delivery.

User stories

As a contributor interested in the Link Codex component, I want to understand what the scope looks like for an MVP version of this component, so that I can more effectively plan and communicate about our work.

Development considerations
  • Per the outcome of T314332: Distribute design system styles as part of Codex, the Link "component" will be implemented as a LESS mixin as opposed to a Vue.js component. This mixin will be part of the publicly exported code of Codex, but it will not include any hard-coded CSS selectors. Instead, it will be the responsibility of consumers of Codex to determine which elements of a page should receive the Codex link styles.
  • This Link "component" will thus be usable even in situations where JS is not available. In the future we may make other components available in this way as well.
  • Since we are not making any assumptions about CSS selectors, a "red link" mixin can be provided alongside the standard link mixin, to be used where appropriate
Open questions

Link

  • Can link text content be formatted (bold, italics, multiple lines) or is only unformatted text allowed? Text link can be formatted
  • Can a link have different sizes? Will it be possible to add any text size to the link text? Any text size from our text tokens could be used as text link
  • Should disabled state be part of the link component? Disabled will not be implemented as link state since there is no current use cases with disabled links
  • Is the icon-only link possible? Is it needed? Do we have any use case with it? We don't have any use case with icon-only link so it won't be necessary

Red link

  • Can a red link have StartIcon or External Link icon? Red link will not use start or external icons
  • Do we want to name it "Destructive" to follow the same nomenclature as we have in buttons? The nomenclature used for links will be "Link" (base link) and "Red link" (new pages without content) since "Red link" is not destructive and is also a common name within the community
Design spec
Acceptance criteria
  • T309248 has been updated with MVP scope
  • MVP version of the Figma spec sheet is done

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptJul 21 2022, 1:27 PM
egardner updated the task description. (Show Details)
egardner subscribed.

The MVP spec sheet has been created for blue and red links. I've added it in the task description and you can also find it here. I've added some open questions in the task, once they are resolved I will update the spec sheet if needed.

NOTE: Do we want to create both blue and red links in this task or we just going to create the blue one?

I think it would be helpful to understand how folks would use a Link component in Vue-based applications.

Do we need a "component" at all, or could this just be handled with an appropriate set of styles? Maybe the component is only used for a specific kind of link – hyperlink appearing within a paragraph of text for example (as opposed to icons/buttons/menu items that may still end up being <a> elements in the DOM).

Regarding red links, blue links, etc – some of this is MediaWiki-specific behavior. A red link still goes to an empty page on MediaWiki, with a prompt to the user to create the page. These links are used to visually indicate gaps in knowledge and invite contributors to fill them in.

So far we have been designing Codex to be independent of MW (Components/styles to not rely on or assume the presence of skins for example). Does it make sense to talk about a "red link" outside of a MediaWiki context? There may be non-wiki sites that eventually use Codex (like the Foundation's Toolhub app) – would such a site ever need to display red links?

If "red link" behavior is specific to MediaWiki (and I think maybe it is), we should proceed carefully here. Maybe a consumer of these components would need to provide their own way of determining whether or not a given Wiki page exists (which probably involves making a client-side API request if the link was not generated server-side; this has performance implications if there are a ton of links on a page). In that case, we should design the Link component so that the red link functionality is optional and not active by default.

For internal/external links the situation is a little bit simpler; it would be easy enough for a Link component to perform an automatic check to determine if the target URL had a different hostname than that of the current page, and show the external link icon if so. But this is probably something we'd want to allow the user to enable/disable via prop.

TLDR; links are a very fundamental part of web UIs and we should think carefully about where/how a Link component would be used. Maybe we just want styles instead.

Another thing regarding "red links":

Do we want to name it "Destructive" to follow the same nomenclature as we have in buttons?

I think red links need to be clearly differentiated from "destructive" styling. Clicking on a red link does not delete a page; instead it takes the user to a placeholder page for a given title and prompts them to start editing. So the meaning is totally different

The use of red to indicate "missing content" is a historical thing in MediaWiki that long predates our design system.

Another thing regarding "red links":

Do we want to name it "Destructive" to follow the same nomenclature as we have in buttons?

I think red links need to be clearly differentiated from "destructive" styling. Clicking on a red link does not delete a page; instead it takes the user to a placeholder page for a given title and prompts them to start editing. So the meaning is totally different

The use of red to indicate "missing content" is a historical thing in MediaWiki that long predates our design system.

@egardner I know Red links are not for destructive actions as destructive buttons are. I think we should always define the same names for all our set of intents/flavors components and we have some options to follow this:

  1. Progressive/ Destructive: it's the name we have in other components as buttons and also the ones defined in our new color tokens, so the logical thing would be to follow this nomenclature (although I know destructive for these Red links is not the best name)
  2. Progressive/ Danger: what if we replace destructive name with danger in all our components and color tokens in order to use it for more destructive elements, error elements and red links? I know destructive is common and well know in our system but doesn't work for all red cases we have (e.g. currently we need two different color tokens for destructive and error)

@bmartinezcalvo @egardner Adding on to a question by Bárbara on Slack about possible icons on Red Links:
Red links are a MediaWiki/Wiki project speciality and, because of their solely use as links to not yet filled articles, will never carry icons start or end.

I would suggest to continue using “Red link” as label as it's the chosen label from the community and it isn't sufficiently described with destructive or danger. It's a special feature, that needs special handling and would otherwise be more confusing by either vague thematic grouping (red link becoming part of danger group) and separation from a long established label.
For Codex outside of wiki projects Red Links are also a component type that is highly probable fully ignored.

I would suggest to continue using “Red link” as label as it's the chosen label from the community and it isn't sufficiently described with destructive or danger.

@Volker_E if we use the name Red link then the logical solution to be consistent with the nomenclature would be to name the other as Blue link. Apart from the blue link, we need to think in possible future names in case we want to introduce a new dark/subtle link in our system in some moment. So we have 3 options with the names:

  1. Name the links with the same flavors of our tokens: Progressive/ Destructive/ Neutral (in case we would introduce a new dark link)
  2. Name the links with the name of the color used: Blue link/ Red links/ Black link (I don't agree with these names since we only use the global names of colors in the primitive colors but never in the decisions)
  3. Find new names that match with the use of each link: Base link (blue)/ New link (red)/ Subtle link

@bmartinezcalvo @egardner Adding on to a question by Bárbara on Slack about possible icons on Red Links:
Red links are a MediaWiki/Wiki project speciality and, because of their solely use as links to not yet filled articles, will never carry icons start or end.

@Volker_E regarding icons I think we should create the Link component with the configurable properties Red/Blue and Icon/noIcon (as we have in button component with its flavors) and explain to use red links for new pages without icon (as I explained in the recommendations in the Figma spec sheet). One thing are the props of the component and other how we want to use this component according to each case.

Captura de Pantalla 2022-08-03 a las 11.34.17.png (428×2 px, 250 KB)

In terms of usage, I'd consider the "blue" links to be the default; dark/subtle links and redlinks would be alternate styles.

What about non-text links (link tags that wrap other elements)? Is that a part of this work? Or does Link Component/Link Style only apply to text links?

After a design sync with @Volker_E and @Sarai-WMDE I've created this new version of the Link specs with the following:

  • Separated blue link and red link in different specs since they have different props:
    • Link (blue) will have start and external link icon props while
    • Red link will not have any icon props and it will not use color tokens since our text color tokens are reserved for destructive elements, so Red link will use component tokens instead
  • We commented to use the following names:
    • Link: this will be our base link, in this case the link is blue but in the future it could be expanded to a new dark variant so this link could be blue or black in case we add it)
    • Red link: we used this name for links used for [new] pages without content since it's so common in our community
  • Icon-only link will not be implemented since we don't have any use case with this props
  • Disabled state won't be added as state since we don't have any use case with disabled links
  • Underlined will be implement as component prop but we will use the not underlined link by default
  • Any text size and format from our text tokens could be used as link text

The task is ready to be implemented since the Figma spec was added in the task and almost all open questions were solved.

@DAbad I unassign myself from the task since the design parte was done. This task should be assigned now to the developer that will implement the component in Codex.

@DAbad we should update the Design Style Guide since the type of links and names don't match with the ones defined in the Figma spec. Should the DSG update be part of this MVP task or the Epic T309248

Captura de Pantalla 2022-08-17 a las 17.13.27.png (910×1 px, 484 KB)

egardner updated the task description. (Show Details)
egardner updated the task description. (Show Details)

I believe the work on this scope MVP is done (it is heavily informed by the outcome of another spike, T314332). We can move on to implementation now (which I guess will be handled in a separate ticket yet to be created?).

As an aside, our proposed solution to T314332: Distribute design system styles as part of Codex should clear up any confusion around how "red links" (which are MW-specific) should get handled in Codex (which exists outside of MW): we will provide a "red link" LESS mixin alongside the standard link mixin so that consumers can apply it where appropriate. Users of Codex who are not working in a MediaWiki environment can simply ignore this.

I believe the work on this scope MVP is done (it is heavily informed by the outcome of another spike, T314332). We can move on to implementation now (which I guess will be handled in a separate ticket yet to be created?).

@egardner to finish this task we need to update T309248 with the MVP scope (as it's specified in the acceptance criteria). To complete this we need to:

  • Determine what MVP includes for this component and document this in a subtask. Assign task to designer.
  • Design MVP. Once complete, assign task to developer.
  • Implement MVP

Captura de Pantalla 2022-09-01 a las 16.24.17.png (478×2 px, 314 KB)

So we need to assign a developer for this task (will you be the developer for this?) and then implement it. Then I think this will be done in this task and we don't need to create another ticket for the implementation, right?

Implementation will be done in https://phabricator.wikimedia.org/T309248.

As per team discussion, implementation will be determined after our review of: https://phabricator.wikimedia.org/T314332 which is scheduled for Sept 1, 2022.

DAbad changed the task status from Open to In Progress.Sep 1 2022, 2:58 PM
DAbad closed this task as Resolved.
DAbad triaged this task as High priority.

MVP scope has been finalized and we can close this ticket. Product sign-off complete