Airshift is personal web radio in the tab. The hour is a YouTube iframe, a cued next iframe, and an HTML audio bed. I wrote about keeping that board live and about browsing the dial without killing the hour. This is the other navigation: leaving the board for Yours while the song is still playing.

Yours is where saved tracks live. Taste is the skip and ban list next to it. Both need a URL you can refresh, share, and hit Back on. A real navigation would throw the document away. The YouTube player objects go with it. The hour dies so you can edit a list.

So /, /yours, and /taste are views of one document. history.pushState changes the path. popstate paints the view that path already names. Nothing fetches a new page.

export function appViewFromPath(pathname: string): AppView {
  const path = normalizeAppPath(pathname);
  if (path === "/yours") return "yours";
  if (path === "/taste") return "taste";
  return "board";
}

The share query and hash ride along. Opening Yours from /?s=blues lands on /yours?s=blues. Back returns to the board you were already hearing.

hidden is display: none

The board and the manage pages are both in the first paint. The one you are not looking at gets the hidden attribute. That is display: none on a whole tree.

YouTube will not keep a buried iframe honest. display: none on the player, or on an ancestor, is how you lose the buffer. The cued next mount already avoids that trick: it sits at opacity: 0 with a real box, which is the same rule from the board-live post. Hiding #board-view while #air-stage is still inside it would pause the hour for the same reason.

The stage is not a child of the view. It is one node — live player, next player, cover, bed — and the view only borrows it.

Park the stage, then hide the board

parkAirStage picks a host and appends the same node there. Same element, same iframe, same player instance.

function parkAirStage(): void {
  const host = !isManageView() ? monitorSlotEl : live ? manageMiniSlot() : airParkEl;
  if (airStageEl.parentElement !== host) host.append(airStageEl);
}

Three hosts:

  • Board. The stage sits in the monitor, where the hour already was.
  • Yours or Taste, and the hour is live. The stage moves into that page’s mini slot. The mini is a sticky bar: a 72px screen, the current line, pause, and skip. Those buttons call the same hour the board does. They are not a second player.
  • Yours or Taste, and nothing is On Air. The mini stays hidden. Parking into a hidden bar would put the iframe back under display: none. Standby uses #air-park instead: fixed, 2×2 pixels, opacity: 0.01, pointer-events: none. It is on screen as far as the iframe is concerned, and invisible as far as you are.

syncAppView runs on the click, on Back, and once at startup. The transport paint calls parkAirStage again whenever live flips, so going On Air from the Yours page pulls the stage out of the park and into the mini without a reload.

What a full load would have cost

A new document means a new YT.Player, a cold loadVideoById, and a bed element that has never been ducked. The queue might still be in localStorage. The speakers would not be. Pushing a path and moving a node is the whole trick: the hour does not know the page changed.

What it feels like

On Air. Open Yours. The board is gone, the list is there, and the song is a small screen at the bottom of the page. Back to the board and the monitor has the same player it started with. Refresh on /yours is a real URL. It is not a remount.

Try it on airshift.fly.dev — go On Air, open Yours, and leave the song where it is.