feat: Variable Font Size for Flex Nodes#1832
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d320bde to
fabafff
Compare
1a7771b to
8e50ac2
Compare
fabafff to
21c4bc8
Compare
| "@radix-ui/react-scroll-area": "^1.2.10", | ||
| "@radix-ui/react-select": "^2.2.6", | ||
| "@radix-ui/react-separator": "^1.1.8", | ||
| "@radix-ui/react-slider": "^1.3.6", |
There was a problem hiding this comment.
Thinking outloud - if we need to add one more package for this, or can we just use a drop-down with predefined sizes?
There was a problem hiding this comment.
I did originally just offer our standard Text component sizes (xs, sm, md etc). But then we're limited by our Text component. I can very easily see a world where more granularity is desired and hence I went for a slider
src/components/shared/ReactFlow/FlowCanvas/FlexNode/FlexNodeEditor.tsx
Outdated
Show resolved
Hide resolved
src/components/shared/ReactFlow/FlowCanvas/FlexNode/FlexNodeEditor.tsx
Outdated
Show resolved
Hide resolved
src/components/shared/ReactFlow/FlowCanvas/FlexNode/TextSizeSelector.tsx
Outdated
Show resolved
Hide resolved
| <Slider | ||
| value={[value]} | ||
| onValueChange={([newValue]) => onChange(newValue)} | ||
| min={TEXT_SIZE_MIN} | ||
| max={TEXT_SIZE_MAX} | ||
| step={1} | ||
| /> |
There was a problem hiding this comment.
Ultimately it comes down to how much granularity & control we want to give users over the font size. I agree a nice, small, compact dropdown is preferred. I guess, arguably we could include an input box to allow any value, rather than a slider. Maybe something to explore as a follow-up
There was a problem hiding this comment.
Issue to track: https://github.com/Shopify/oasis-frontend/issues/493
| <div | ||
| className={cn( | ||
| "cursor-pointer border border-muted rounded-sm p-1 bg-background h-fit aspect-square hover:bg-secondary flex items-center justify-center", | ||
| className, | ||
| )} | ||
| > | ||
| <Icon name="Type" /> | ||
| </div> |
There was a problem hiding this comment.
It should be a \<Button variant="ghost" > I believe?
There was a problem hiding this comment.
We can't use Button here - I already tried. PopoverTrigger is already a button component and we get warnings and issues if we try to render a button inside a button
There was a problem hiding this comment.
(we could update our shadcn Popover code though)
maxy-shpfy
left a comment
There was a problem hiding this comment.
Approving this - considering we can think about comments I left.
|
I think you have a fair suggestion with the dropdown - provided we include an input box for custom sizing. I have marked it for follow up. Issue to track is here: https://github.com/Shopify/oasis-frontend/issues/493 |
21c4bc8 to
e600c32
Compare
8e50ac2 to
1c44d77
Compare
e600c32 to
e1855fb
Compare
1c44d77 to
3e4049f
Compare
e1855fb to
b1ddeb7
Compare
3e4049f to
31283cc
Compare
b1ddeb7 to
a5fa3d7
Compare
31283cc to
da9c615
Compare
a5fa3d7 to
7c9fade
Compare
7c9fade to
4b867ec
Compare


Description
Allows both the title and body text of a Flex Node to be customizable via a slider in the context panel.
Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
Additional Comments