chromaui / addon-visual-tests

Visual Tests addon for Storybook
MIT License
36 stars 2 forks source link

Don't show menu when there's only one viewport or browser #72

Closed ghengeveld closed 1 year ago

ghengeveld commented 1 year ago

This yields a more minimalist UI if there is only one viewport and/or browser:

Screenshot 2023-09-04 at 17 02 56

(here we have one viewport, one browser)

Compare to the UI when we do have multiple viewports / browsers:

Screenshot 2023-09-04 at 17 03 18

I also renamed "viewport" to "mode" and updated the icon.

With tooltips:

Screen Recording 2023-09-04 at 19.20.25
📦 Published PR as canary version: 0.0.55--canary.72.51f5eed.0
:sparkles: Test out this PR locally via: ```bash npm install @chromaui/addon-visual-tests@0.0.55--canary.72.51f5eed.0 # or yarn add @chromaui/addon-visual-tests@0.0.55--canary.72.51f5eed.0 ```
linear[bot] commented 1 year ago
AP-3554 When only a single item in a dropdown, convert to presentational version

## What I am seeing: [image.png](https://uploads.linear.app/cfa7d1b1-ff77-4dbe-ae92-8cf23f92a7a9/5e3b9cc9-2385-4dfc-b99a-0e150ed14a4d/39925937-bb11-4ef5-97bb-358fce6dfffc) ## What I expect: I would expect to see something like what we do with the browser select: [image.png](https://uploads.linear.app/cfa7d1b1-ff77-4dbe-ae92-8cf23f92a7a9/ed3fc2be-2f2c-41bd-9d2d-9004ea4b264f/ebca0b24-5bd2-446e-b660-8ab5c35db3e4) 1. Remove the arrow 2. Only have a hover state (no click) that shows "View mode: 1200px"