Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the TokenPicker component #1203

Closed
six7 opened this issue Aug 19, 2022 · 0 comments
Closed

Refactor the TokenPicker component #1203

six7 opened this issue Aug 19, 2022 · 0 comments
Assignees

Comments

@six7
Copy link
Collaborator

six7 commented Aug 19, 2022

Our current TokenPicker component is quite poor when it comes to UX.

It wasn't implemented correctly as it's not using a Portal, and as such is always bound by to the constraints of the parent.

We worked around this by increasing the parent's height (as can be seen in the Inspect/Remap modal), but ideally this should just use a Portal and live outside of the parent container.

What I'd like us to do is refactor this so it can use a Portal and split up the uses in two different ones:

Requirements:

  • The dropdown should be able to go beyond the bounds of the parent div (implement as Portal)
  • We implement { typesuggestions in its own way, it becomes its own component only appearing on typing {.
  • We refactor the way we show the TokenPicker

Image

Suggestions

  • Suggestions should appear once I type { and should react to text changes.
  • I should be able to use arrow up / down to navigate up / down
  • Pressing Enter should insert the selected token (with {}) in the position where I was typing
  • Pressing Esc should close the suggestions overlay

Image

Dropdown picker

  • The picker only appears when I click the dropdown icon
  • After opening, the picker moves focus to the input
  • After opening, we show suggestions based on the search (like today)
  • Entering in the search changes suggestions
  • Pressing arrow up / down navigates the list of suggestions
  • Pressing Escape closes the picker
  • Searching is done in a way where we can do fuzzy search: typing ba se pr ho should show base.selectable.primary.bg-hover

Image

Dropdown picker with value suggestions

  • For fontFamily we should show available fonts (from Figma) in the picker, in a second tab
  • We can show this both in fontFamily tokens as well as typography tokens in the fontFamily field
  • For typography tokens in the fontWeights field we should also show available weights for that specific fontFamily (if a fontFamily has been chosen)

Image

Image

@swordEdge swordEdge assigned swordEdge and unassigned swordEdge Nov 15, 2022
@six7 six7 moved this to 🔜 Next up in Tokens Studio for Figma Roadmap Dec 10, 2022
@swordEdge swordEdge moved this from 🔜 Next up to 🕜 In Progress in Tokens Studio for Figma Roadmap Jan 18, 2023
@swordEdge swordEdge self-assigned this Jan 18, 2023
@swordEdge swordEdge moved this from 🕜 In Progress to 👀 Needs review in Tokens Studio for Figma Roadmap Feb 2, 2023
@six7 six7 moved this from 👀 Needs review to 🕜 In Progress in Tokens Studio for Figma Roadmap Feb 27, 2023
@swordEdge swordEdge moved this from 🕜 In Progress to 👀 Needs review in Tokens Studio for Figma Roadmap Feb 28, 2023
@six7 six7 moved this from 👀 Needs review to 🤞 To be released in Tokens Studio for Figma Roadmap Mar 3, 2023
@six7 six7 closed this as completed Jun 10, 2023
@github-project-automation github-project-automation bot moved this from 🤞 To be released to ✅ Done in Tokens Studio for Figma Roadmap Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants