==== 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.
===== Considerations
[to come]
===== Development considerations
- If a link component is created at runtime (by the user / dynamically on the client side),* Per the outcome of {T314332}, the Link "component" will be implemented as a LESS mixin as opposed to a Vue.js component. we may not know in advance whether the page exists or not.This mixin will be part of the publicly exported code of Codex, Is it okay for the Link component to make a client-side API request at runtime to determine whether it is a "red link" or a "blue link"?but it will not include any hard-coded CSS selectors. Should this feature be limited to internal-links only?Instead, (probably yes)it will be the responsibility of consumers of Codex to determine which elements of a page should receive the Codex link styles.
- If so, do we need to handle the "undetermined state" of a link, while the request is pending?* This Link "component" will thus be usable even in situations where JS is not available. Or should links be blue by default and become red when it is discovered that the linked page does not exist?
- Are there performance or security concerns to doing this?In the future we may make other components available in this way as well.
===== Open questions
**Link**
- Can a link component contain only text, or can other elements (images, etc) be provided as content?
- ~~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
- Do we need to visually distinguish internal links (to other pages on the same wiki, whether they exist or not) from external links to other websites?
- Do we need any special handling for non-web-page URLs (`mailto` links, etc)
- Would we ever want to handle link preview functionality similar to the link preview feature in Vector?
**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 [[ https://www.figma.com/file/KoDuJMadWBXtsOtzGS4134/%E2%9D%96-Codex-components?node-id=4903%3A52965 | 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
| [[ https://www.figma.com/file/ZKM3aDh9mqnpioOeSG3arg/Link-component---T309248?node-id=483%3A6692 | Figma MVP spec sheet here ]] |
===== Acceptance criteria
[] T309248 has been updated with MVP scope
[-] MVP version of the Figma spec sheet is done