# UX guidelines

> How an extension feels like part of Songstress, in every app and every theme, after VS Code's guidelines for its own extensions.

Page: https://songstress.app/docs/develop/guidelines/

An extension lives inside someone's music. People open Songstress to listen, and every place an extension draws in
takes a little of their attention. These guidelines say how to spend it well. They follow
[VS Code's UX guidelines](https://code.visualstudio.com/api/ux-guidelines/overview), which solve the same problem for
an editor, and the places Songstress gives an extension.

## Use the fewest places that do the job [#use-the-fewest-places-that-do-the-job]

- **Contribute only what a person will use.** One sidebar entry is usually enough; five is the most an extension
  gets, and a crowded sidebar pushes Songstress's own places down. Two status items and two overlays at most, for the
  same reason.
- **Prefer what Songstress already has.** A command in a song's menu beats a page of buttons. A
  [panel](/docs/develop/interface/#panels) on an album's page beats a page of its own that repeats the album. A
  setting beats a form that does the same.
- **Hide what does not apply.** Give a menu item, an entry, a panel or an overlay a
  [`when`](/docs/develop/interface/#conditions) (`signedIn`, `platform`, your own `ctx.<key>`) rather than showing it
  and saying "not now" when it is used.

## Draw with Songstress's parts first [#draw-with-songstresss-parts-first]

- **A declared page before components, components before a canvas, a canvas before a view.** A
  [list, grid, tree, detail or form page](/docs/develop/interface/#pages) is drawn by every app natively and works on
  every phone build. [Components](/docs/develop/components/) give you state and layout. Reach for
  [a canvas](/docs/develop/canvas/) for pixels of your own, and for [a view](/docs/develop/views/) only when the thing
  is a document of its own: a game, a visualiser, an editor.
- **Never a colour, a font or a pixel.** Say what you mean with tokens: `tone` for colour (`accent`, `success`,
  `warning`, `danger`, `muted`), `emphasis` for a button's weight, the six steps from `none` to `xlarge` for room.
  Every theme a person picks then fits, and so do dark and light. A view gets the same as CSS variables:
  `var(--songstress-text)`, never a hex value.
- **Name things as Songstress does.** A song, an album, an artist, a playlist: use the library's own items
  (`SongItem`, `AlbumItem`, a `song` row) and they come with their own menus, covers and Play.

## Say little, and say it plainly [#say-little-and-say-it-plainly]

- **Status text is a word or two.** "Sent", "Syncing", "3 new". A status item holds 24 characters; its tooltip is
  where a longer line goes. Use `busy` or `progress` for work under way rather than a counting word.
- **One notice at a time, and only for what a person must hear.** A `toast` for "done", a notice with buttons only
  when there is a decision to make. Ten an hour for one member is the limit, not a target. What must not be missed
  belongs on a page, where it stays.
- **A badge is a count of something waiting for the person.** Clear it when they have seen it. A dot that never goes
  away teaches people to ignore it.
- **Write as Songstress writes.** Plain, warm and direct: "Send your plays to Tunelog", never "Enable telemetry
  integration". A permission's `reason` is read by the person deciding: say what you do with it.

## Respect the music and the person [#respect-the-music-and-the-person]

- **Never interrupt what is playing.** The player is asked, not commanded. Pause, skip and seek are yours on this
  device's own player; anything that replaces or reorders what plays waits for a person to press something of yours
  ([the press rule](/docs/develop/data/#the-player-asked)).
- **The person places and hides an overlay, not your code.** Code may show and hide its overlays, never over a
  person's own hide. Make a decorative overlay small, quiet, and still under reduced motion.
- **Ask for the least you need.** Each permission is a question someone answers. A scrobbler needs what a member
  plays as it happens, not their whole history; a tool that tidies playlists needs to change them, not to hear what
  plays.
- **Honour reduced motion.** A canvas stops by itself unless its `motion` is `essential`; a sprite shows one frame; a
  view gets a `reduced-motion` class, and its frame holds its animations still. Keep it that way in your own code.

## Check it everywhere it shows [#check-it-everywhere-it-shows]

- **Read `client` before you draw.** A phone draws no canvas, no overlay and no in-app view yet; a store build runs no
  client code. Answer what that app draws: `client.capabilities` and `client.ui` say
  ([Where each part works](/docs/develop/#where-each-part-works)).
- **Try it in dark and light, and in a theme.** `songstress dev` puts it on your own server; switch Settings ▸
  Appearance while it shows.
- **Keep it narrow-friendly.** A page is drawn at a phone's width too: short titles, no table wider than a few
  columns, a `Shelf` for what scrolls sideways.
