# Tabs and panes

> How objects open beside a conversation as tabs in panes — one shell for every kind of object, its tab bar and width rule, its two menus, dragging, maximizing, narrow windows, Escape and the keyboard.

Source: https://raft-design.botiverse.build/patterns/tabs-and-panes. Generated from the current release; where it differs from what you remember, this page is right.

Beside a conversation, the objects people work on (a document, a task, a file, an App, a web page) open as tabs in panes, as in a browser or an editor. One shell does everything that is the same for every object: the panes and their tab bars, the tabs' widths, the tab's menu, dragging, maximizing and Escape. Each kind of object is a module that answers the same nine questions (what its tab says, its row of buttons, its ⋯, what counts as new, what shows when it can't open, where it opens, how it lives in the background, Escape inside it, and its narrow layout), so a new kind of object adds a module and never changes the shell.

raft-ui carries the shell's parts, from `@botiverse/raft-ui/wip` until the app has moved onto them: [Tab](https://raft-design.botiverse.build/components/tab.md), [TabBar](https://raft-design.botiverse.build/components/tab-bar.md), [Pane](https://raft-design.botiverse.build/components/pane.md), [PaneGrid](https://raft-design.botiverse.build/components/pane-grid.md) and [PaneDropOverlay](https://raft-design.botiverse.build/components/pane-drop-overlay.md). The app owns the state (which tabs are open, which pane is focused, the saved sizes) and the shortcuts; the parts show it and report what people did. The modules' tables, one per kind of object, are in the prototype for now (v9, [the rules page](https://app.raft.build/artifacts/JAb4a8LuG9Hw8aw9Ezv1Xz)) and move to the app's product docs.

Each rule below is marked with where it comes from, as the prototype marks it:

| Mark | Meaning |
| --- | --- |
| Convention | What browsers and editors do. Follow it; it isn't up for discussion. |
| Our problem | A problem only our setting has, which we had to decide ourselves. |
| Our idea | A choice of our own, worth discussing and worth keeping. |

## When it applies

Every object opened beside a conversation or a main-area list, on desktop and the web. A phone has no panes and no tabs: an object opens full screen, as today ([Phone](#phone)). An object glanced at is not a tab: a person's name opens their profile card, and an image, a video or a sound opens in the [Lightbox](https://raft-design.botiverse.build/components/lightbox.md).

On the web an App is never a tab. An App on the rail, or a link to an installed App's address, opens in a new browser tab, as today; only the desktop app has App tabs. On the web a page in a tab is an iframe without the person's cookies (`credentialless`), and Apps send `frame-ancestors 'none'`, so Sign in with Raft can't work inside one.

## Structure

A pane is its tab bar, the front object's row of buttons (only where the object has buttons of its own), and its content:

```tsx
import { useCallback, useState } from "react";
import type { MouseEvent } from "react";
import { ArrowLeft, ArrowRight, FileText, Globe, Hash, MessageSquare } from "lucide-react";
import { DropdownMenuItem, DropdownMenuSeparator } from "@botiverse/raft-ui";
import {
  FitToolbarButton,
  PaneBody,
  PaneRoot,
  PaneToolRow,
  SiteDomain,
  Tab,
  TabBar,
} from "@botiverse/raft-ui/wip";
import { TabMenuItems } from "../../tab/tab-menu.tsx";
import { useExampleTabs } from "../../tab/use-example-tabs.ts";

const TABS = ["notes", "vite"];

/**
 * One pane: its tab bar, the front object's row, and its content. A document
 * has its own buttons and a ⋯ with its actions at the row's end; a web page's
 * row is its navigation and its domain, and its ⋯ at the end holds the page's
 * actions, as every kind of object's does.
 */
export function PanePreviewContent() {
  const tabs = useExampleTabs(TABS, "notes");
  // What the last button did, shown in the pane's content.
  const [done, setDone] = useState<string | null>(null);
  const report = useCallback(
    (event: MouseEvent<HTMLElement>) => setDone(event.currentTarget.dataset.done ?? null),
    [],
  );
  return (
    <div className="flex h-72 w-full max-w-3xl flex-col overflow-hidden rounded-container border border-line-hairline">
      <PaneRoot focused>
        <TabBar
          label="Tabs"
          value={tabs.front}
          onValueChange={tabs.setFront}
          onNewTab={tabs.newTab}
          maximized={tabs.maximized}
          onToggleMaximize={tabs.toggleMaximized}
        >
          {tabs.isOpen("notes") ? (
            <Tab
              value="notes"
              source="object"
              icon={<FileText />}
              title="Launch notes"
              onClose={tabs.close}
              menu={
                <TabMenuItems value="notes" onClose={tabs.close} onCloseOthers={tabs.closeOthers} />
              }
            />
          ) : null}
          {tabs.isOpen("vite") ? (
            <Tab
              value="vite"
              source="site"
              icon={<Globe />}
              title="vite.dev"
              pageTitle="Getting started"
              onClose={tabs.close}
              menu={
                <TabMenuItems value="vite" onClose={tabs.close} onCloseOthers={tabs.closeOthers} />
              }
            />
          ) : null}
          {tabs.added.map((value) => (
            <Tab
              key={value}
              value={value}
              source="object"
              icon={<FileText />}
              title="New tab"
              onClose={tabs.close}
            />
          ))}
        </TabBar>
        {tabs.front === "notes" ? (
          <PaneToolRow
            label="Document tools"
            menu={
              <>
                <DropdownMenuItem data-done="Renaming Launch notes" onClick={report}>
                  Rename
                </DropdownMenuItem>
                <DropdownMenuItem data-done="Link to Launch notes copied" onClick={report}>
                  Copy link
                </DropdownMenuItem>
                <DropdownMenuItem data-done="Launch notes: 4 versions" onClick={report}>
                  Version history
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem data-done="Delete Launch notes?" onClick={report}>
                  Delete
                </DropdownMenuItem>
              </>
            }
          >
            <div className="flex-1" />
            <FitToolbarButton
              variant="ghost"
              icon={<MessageSquare />}
              labelOrder={10}
              data-done="Comments on Launch notes"
              onClick={report}
            >
              Comments
            </FitToolbarButton>
            <FitToolbarButton
              variant="ghost"
              icon={<Hash />}
              labelOrder={20}
              data-done="Shared with #launch-week"
              onClick={report}
            >
              Share
            </FitToolbarButton>
          </PaneToolRow>
        ) : tabs.front === "vite" ? (
          <PaneToolRow
            label="Page tools"
            menu={
              <>
                <DropdownMenuItem data-done="Link to vite.dev copied" onClick={report}>
                  Copy link address
                </DropdownMenuItem>
                <DropdownMenuItem data-done="vite.dev opened in the browser" onClick={report}>
                  Open in browser
                </DropdownMenuItem>
                <DropdownMenuItem data-done="vite.dev reloaded" onClick={report}>
                  Reload
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem data-done="vite.dev muted" onClick={report}>
                  Mute
                </DropdownMenuItem>
              </>
            }
          >
            <FitToolbarButton variant="ghost" icon={<ArrowLeft />} labelOrder={1} disabled>
              Back
            </FitToolbarButton>
            <FitToolbarButton variant="ghost" icon={<ArrowRight />} labelOrder={1} disabled>
              Forward
            </FitToolbarButton>
            <SiteDomain host="vite.dev" className="mx-2 flex-1" />
          </PaneToolRow>
        ) : null}
        <PaneBody>
          <div className="flex size-full items-center justify-center bg-fill-muted text-callout text-foreground-muted">
            {done ??
              (tabs.front === "notes"
                ? "Launch notes"
                : tabs.front === "vite"
                  ? "vite.dev"
                  : "New tab")}
          </div>
        </PaneBody>
      </PaneRoot>
    </div>
  );
}
```

For now every kind of object's row is its head bar as it is today, without its title, its Expand and ×, and the control that moves its column (the pane has those now). That leaves fewer decisions while the shell is tried out; rows designed for tabs come later.

Panes sit side by side in columns, and a column can be split top and bottom:

```tsx
import { useCallback, useMemo, useState } from "react";
import { Globe } from "lucide-react";
import { PaneGrid, Tab, TabBar } from "@botiverse/raft-ui/wip";
import type { PaneGridCell } from "@botiverse/raft-ui/wip";

function keepFront() {}

/** A pane folded to its tab bar: only its tabs show. */
const FOLDED_PANE = (
  <TabBar label="Tabs" value="vite" onValueChange={keepFront}>
    <Tab value="vite" source="site" icon={<Globe />} title="vite.dev" pageTitle="Getting started" />
  </TabBar>
);

const SPLIT: PaneGridCell[] = [
  {
    id: "top",
    size: 180,
    min: 60,
    content: (
      <div className="flex size-full items-center justify-center bg-layer-canvas text-callout">
        Launch notes
      </div>
    ),
  },
  { id: "folded", size: 44, fixed: true, content: FOLDED_PANE },
];

/**
 * The conversation and two columns of panes; the first column is split top
 * and bottom, its lower pane folded to its tab bar. Drag a seam, or focus it
 * and use the arrow keys; the sizes are the caller's, in px.
 */
export function PaneGridPreviewContent() {
  const [sizes, setSizes] = useState<Record<string, number>>({ chat: 280, left: 260, right: 240 });
  const resize = useCallback(
    (next: Record<string, number>) => setSizes((current) => ({ ...current, ...next })),
    [],
  );
  const cells = useMemo<PaneGridCell[]>(
    () => [
      {
        id: "chat",
        size: sizes.chat!,
        min: 160,
        content: (
          <div className="flex size-full items-center justify-center bg-layer-canvas text-callout">
            #launch-week
          </div>
        ),
      },
      {
        id: "left",
        size: sizes.left!,
        min: 160,
        content: <PaneGrid orientation="vertical" layoutKey="left-split" cells={SPLIT} />,
      },
      {
        id: "right",
        size: sizes.right!,
        min: 160,
        content: (
          <div className="flex size-full items-center justify-center bg-layer-canvas text-callout">
            #25 Ship the tab bar
          </div>
        ),
      },
    ],
    [sizes],
  );
  return (
    <div className="h-64 w-full max-w-3xl overflow-hidden rounded-container border border-line-hairline">
      <PaneGrid layoutKey="chat-left-right" onResize={resize} cells={cells} />
    </div>
  );
}
```

## Panes and columns

Our problem.

- Right of the conversation there are panes, each with its own tab bar. Split them side by side, up to 4 columns, or top and bottom, each pane at least 200px tall. A stacked block that holds one object, as a channel's side sections do, isn't kept.
- Tabs and panes belong to the channel (the main anchor): switching channels swaps the whole set, as today. The Tasks page, Activity, an App on the rail (in the desktop app) and the Members page are main anchors too, each with its own set.
- Beside the conversation or a main-area list there is always "the pane beside it": the thread column, or what was opened from a list worked through one item at a time. A new item replaces the last one.

## The tab bar

Convention.

- A tab bar has its tabs, then at its end only + and Maximize (pressed, as Restore, while maximized), with All tabs before them while the tabs don't fit. It has no ⋯.
- A tab says what the object is: its icon and its title. The front tab's × always shows; a background tab's shows on hover. A tab has no button for its menu, as in a browser: it opens on a right-click, a touch hold lifted, or Shift+F10 or the context-menu key on a focused tab ([Two menus](#two-menus)).
- A web page's tab is named by its page title, as in a browser; only while the page has no title does it show its domain, drawn with [SiteDomain](https://raft-design.botiverse.build/components/site-domain.md) and cut at its start. The full address never shows in a tab: it is in the page's address row, where SiteDomain says which site the page is on, and that row, not the tab, is what keeps a page from passing for another site. On http, Not secure goes before whichever the tab shows; a title-only tab in a narrow pane leaves it to the address row.
- There is no limit on the number of tabs. Extra tabs go into All tabs, and none is closed for the person: a tab that disappears on its own is harder to understand than a few more tabs. Close others and Close pane clear them.

### Width

Convention. One rule, the same for every tab, which [TabBar](https://raft-design.botiverse.build/components/tab-bar.md#width) carries. Choosing or hovering a tab never changes a width, as in a browser: a tab that grows when it is clicked moves every tab beside it out from under the pointer (xxchan, #proj-workspace:#479). So a tab looks the same in front or not but for its colours: the same things in it, the same weight, and the ×'s room kept in every tab, where a background tab's × shows on hover.

1. Names in full first.
2. Only when they don't fit do tabs get narrower, and the longest give way first (the water level falls; short names stay whole). Every tab is at most 200px and goes down to 80px, 48px title-only, in front or not.
3. Only when every tab is at its least width and they still don't fit do tabs move into All tabs: its button's room is kept first, then the tabs in order, each kept at a readable width (up to 120px, never squeezed to its least); the rest move into the list whole, never half shown. The front tab is never in the list: chosen from it, it takes the place of the last tab in the bar, at the width any tab has there.
4. A task's tab gives up its place first (`#launch-week:`, `dm:@Martin:`), and keeps its number and the start of its title.

### All tabs

Convention.

- It shows only when every tab is at its least width and they still don't fit. It lists every tab of the pane with the front one checked; choosing one brings it to the front, back into the bar.
- A hidden tab with something new puts one attention dot on the button, and its own count or dot on its item. In a narrow pane the button shows only the count and its chevron; its name stays in its tooltip and is what a screen reader hears.

## One kind of tab

Convention, and our idea for now.

- Every tab is the same kind. There is no preview tab, no italic, no Keep, and no rule that makes a tab permanent once something was done in it.
- There is no Pin for now: no workspace tab is pinned, and the tab's menu has no Pin tab (xxchan, #proj-workspace:#479). [Tab](https://raft-design.botiverse.build/components/tab.md)'s `pinned` stays in raft-ui, unused by the workspace tabs.

## Two menus

Convention, and our idea.

The object's actions and the tab's are apart. The object's own actions are in the ⋯ at the end of its row, for every kind of object: a document, a task or a file (the same ⋯ the object has today), and a page too, an App or a web page, whose ⋯ ends its address row with Copy link address, Open in browser, Reload, and Mute or Unmute. What is done to the tab and its pane is in the tab's menu, as in a browser, and nothing else. A pane has at most one ⋯.

| Menu | Opens from | Holds |
| --- | --- | --- |
| The row's ⋯ | The ⋯ at the end of the front object's row (Tab to it, then Enter or ArrowDown) | The object's own actions, every kind's: a page's (an App's or a web page's) at the end of its address row. An object with none (a panel) has no ⋯. |
| The tab's menu | A right-click on any tab (at the pointer); Shift+F10 or the context-menu key while a tab has focus (under the tab, the first item highlighted); a 500ms touch hold lifted without moving (under the tab). No button opens it, on any tab, as in a browser. | Move to another pane (Move to the left pane, Move to the right pane, Split right, Split down) · Maximize or Restore · Close · Close others · Close to the right · Close pane · Reopen closed tab |

- An item the tab can't do stays in its place, disabled: Close others with no other tab to close; Close to the right with no tab to close after it; Close pane, Split right and Split down with one tab; Move to the left pane in the first column, and Move to the right pane in the last (a new column is Split right); Split right with 4 columns; Move to another pane while maximized; Reopen closed tab when none was closed.
- The arrow keys move through the items and wrap, ArrowRight opens a submenu and ArrowLeft closes it, Enter chooses, Escape closes. Focus goes back to the tab or the ⋯ it opened from, or to what the item opened: a dialog, a panel, a find bar, a comment box.
- Every menu and its submenus are 240px to 320px wide; a long item is cut, never widening the menu.
- A middle click on a tab closes it.
- There is no Duplicate: an object has one tab in a set of tabs (a web page, one per address), so a copy would be the same tab twice. Close to the right is there because browsers have it.

## Opening an object

Our idea. Two rules, and each module's exceptions:

1. **From a list worked through one item at a time** (Activity, the Tasks page, search results): in the pane beside it; the next item replaces it, as in a mail client. To keep it: drag it into a pane, Open as tab in that pane's head, or ⌘ click in the list.
2. **From anywhere else** (a card or a link in a message, a channel panel, a new tab): as a tab, one per object. Opening it again brings that tab to the front, once marked with the located highlight ([States](https://raft-design.botiverse.build/foundations/states.md#located)).

- What needs only a glance isn't a tab: a profile card, the Lightbox.
- What takes the main area is a main anchor, not a tab: an App on the rail in the desktop app, a person on the Members page.

## Dragging

Convention. A tab is dragged as everything is ([Drag and drop](https://raft-design.botiverse.build/patterns/drag-and-drop.md)), and where it will land is shaded as the area the new pane would take ([PaneDropOverlay](https://raft-design.botiverse.build/components/pane-drop-overlay.md)):

```tsx
import { PaneDropOverlay } from "@botiverse/raft-ui/wip";

const RECT = { left: 0, top: 0, width: 200, height: 120 };

/**
 * Where a dragged tab will land: an edge of a pane shades the half the new
 * pane will take, the middle shades the whole pane. Over the conversation it
 * says so in its own words.
 */
export function PaneDropOverlayZonesContent() {
  return (
    <div className="grid w-full max-w-3xl grid-cols-[repeat(auto-fill,200px)] gap-3">
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="top" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="bottom" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="left" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="right" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="center" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay
          rect={RECT}
          zone="right"
          label="Split right of the conversation"
          portal={false}
        />
      </div>
    </div>
  );
}
```

- **To a pane's edge** (25% of its width or height on each side, the tab bar included): that half of the pane is shaded, with Split up, Split down, Split left or Split right.
- **To a pane's middle**: the whole pane, Move to this pane. **Onto a tab bar**: a line between the tabs where it will land, and the tabs after it slide apart; in its own bar, that reorders.
- **Onto the conversation or the thread column**: its right half, Split right of the conversation.
- A place that won't take it (a fifth column; anywhere but the pane itself while maximized) is not shaded; it shows the refusal hint by the pointer.
- Dropped where it already is (its own pane's middle, or its own pane's edges when it is that pane's only tab), a tab changes nothing: no shade shows there, and the drop puts it back.
- The tab itself is the handle: a mouse picks it up after 6px, a finger after a 500ms hold. The keyboard and screen-reader path is Move to another pane in the tab's menu.
- One touch rule for a tab and rows like the rail's: hold 500ms then move = a drag; hold 500ms and lift = the menu; move before 500ms = a scroll. A hold never opens the menu and starts a drag at once.

### From a message

Our idea. What a message holds that opens as a tab can be dragged into the panes too: a link, an Artifact card, a file, an image, a task reference and a message's task line.

- It lands exactly as a tab does: a pane's edge splits it, a pane's middle opens it as a tab of that pane, a tab bar inserts it where the line shows, and the conversation's right half splits right of the conversation.
- An object already open goes to its tab, wherever that is, instead of opening a second: one tab per object ([Opening an object](#opening-an-object)).
- Dragging never replaces what the message does already: a click still opens, text can still be selected, and a hold still opens the message's menu. There is no drag from a message on the phone, which has no panes.

## Maximize

Convention.

- A pane's Maximize replaces each column's Expand and the thread column's focus mode. It is the ⤢ at the end of the tab bar, Maximize in the tab's menu, or a double click on the bar's empty part.
- The maximized pane and its page grow together. The other panes are hidden, their pages kept in the fixed layer, and their tabs are dimmed after a divider in its tab bar; choosing one restores the layout and shows it.
- While maximized, tabs still switch, and a tab can be dragged into the pane; splitting needs a restore first. Maximize stays in its place, pressed and named Restore (`minimize-2`), as a panel's Expand does; it, or Escape with nothing else to close, brings the layout back. It has no label: the dimmed tabs after the divider already show the layout is maximized.

## Squeezed panes keep their titles

Our idea. A pane that doesn't fit shrinks to its titles, which are always visible. A row too narrow for its panes gives way as a conversation's row does ([Responsive layout](https://raft-design.botiverse.build/patterns/responsive.md#the-channels-side-columns)), with panes for columns; at the last step the rightmost column's tabs join its left neighbour's tab bar after a divider, and choosing one shows it there. A wider window brings the column back, at its saved width.

- Split top and bottom, a pane too short for its content folds to its tab bar; choosing a tab unfolds it and folds the pane used longest ago. Opening the tab's menu never folds or unfolds a pane.
- In a pane under 280px every tab keeps only its title (no icon), the front one too; its × is laid over the title's end (the front tab's always, another's on hover). All tabs shows only its count, and + and Maximize stay.

## New things

Convention.

- Something the person hasn't seen yet on an object shows after its tab's title: an unread count for what can be counted (new replies, new comments), an attention dot for what can't (a new version). It goes once the tab is in front.
- Hidden in All tabs, the button has one dot, and each item its own count or dot.
- The module answers only what counts as new; the shell never knows one object's unread from another's.

## Can't open

Our problem.

- By default there is one look, and it reveals neither the title nor the reason: This task isn't available, Can't open this document, Can't open this file, with Close tab. A deleted object and one in a private channel look the same, so a link can't tell what is behind it.
- Only where the person can do something is there another look: read only (a shared channel's task), install or ask to install (an App not installed here), close (an App removed or no longer allowed, its content cleared at once), retry (no response), open elsewhere (a request the built-in browser stopped, with Open in browser), or wait (a page unloaded in the background reloads when shown).

## Titles follow the object

Convention. A tab's title, channel and icon come from the object live, never as they were when it opened: a renamed task, channel or document, a renamed App, a task's new status (its icon is its status) all show in its open tabs.

## Moving never reloads

Our idea. Pages live in one fixed layer and never change parent: a web page's iframe on the web, an App's or a web page's native view in the desktop app, and everywhere a document shown in an iframe (HTML, Markdown, PDF). Panes, tabs and maximize only work out where each one goes and how big it is, and lay it over that place, so dragging, splitting, maximizing and going to the background never reload a page: a half-filled form, a sign-in, a scroll position and a comment draft all stay. [PaneBody](https://raft-design.botiverse.build/components/pane.md) is the box a page is laid over.

- At most 8 hidden iframes are kept. Past that the one seen longest ago is unloaded and reloads when shown again. An iframe its module asks to keep (one still on its first load, a sign-in under way, a document being reviewed) is never unloaded.
- A native view isn't the shell's to unload: the desktop app's browser owns it, and an App's view is the same one the App shows in the main area. The shell only shows, hides and places it, so a sign-in in it is never cut off and the App in the main area never reloads because of a tab. A native view's tab keeps its content mounted while the view is hidden.

## Switching tabs

Convention. Switching tabs keeps what lasts in a tab: its scroll position, what was left open in it (its comments, a list) and a draft being typed. A temporary layer (a menu, a popover, a task's pulled-down header) closes on a click outside it, and a click on another tab is a click outside, so it closes when the person switches. That is intended, as a menu closes in any app.

## New tab

Our idea. A new tab answers "what does this pane want to show next": a field that opens an address or searches documents, tasks (by their references too), files, members and Apps; the channel's latest documents and its panels; what the person saw recently, closed tabs included; and the Apps they can open. A part with nothing in it isn't shown.

- **Opening it:** + at the end of the tab bar, or ⌘T in the desktop app. It is added at the end of the focused pane's bar, in front, with its field focused. Its tab is New tab with the `search` icon, and closing it is not remembered as a closed tab.
- **The page, top to bottom:** the field; This channel (This conversation in a DM; its 3 latest documents, so Recently seen still shows without scrolling in a pane of common height, with the rest one step away in the channel's panels, which follow); Recently seen; Apps. Recently seen holds the closed tabs too, newest first, at most 6, so Apps still shows without scrolling in a pane of common height, and leaves out what is open in this set; there is no separate Recently closed. ⌘⇧T still reopens the last closed tab (xxchan, 2026-11-30, #proj-workspace:#490).
- **Typing:** the results are grouped by kind (an address, documents, tasks, files, members, Apps, the channel's panels); a task's reference finds it (`#7`, `launch-week:#25`). The first result is highlighted, so ↩ needs no arrow; ↑↓ move through everything shown, the App tiles included, and wrap. Focus stays in the field.
- **Choosing a result:** ↩ or a click turns this tab into the object's tab, in place. ⌥↩, a ⌘ click or a middle click opens it as another tab right after this one, in the background, and this tab stays with its query: ⌘↩ is Maximize ([Keyboard](#keyboard)), and ⌥↩ is a browser address bar's own key for it (xxchan). With ↩ or a click, something already open goes to its tab, one per object ([Opening an object](#opening-an-object)), and the New tab, holding nothing, closes; with ⌥↩, a ⌘ click or a middle click it stays in the background, marked once with the located highlight, and the New tab keeps its query: ⌥↩ means the person is still looking here (Jasper).
- **A person** opens their profile card over the row, not a tab: a person is a glance (xxchan).
- **Escape** does what it does in a browser's address bar (xxchan): with text in the field, it clears the text and closes the results; with the field empty, it does nothing of its own, so it never closes the tab (⌘W does) and falls through to the rest of [Escape](#escape), a maximized pane last.
- **Something that can no longer open** is left out of the page, so it never shows a title the person can't see any more.
- **The layout follows the pane's width,** not the window's: a narrow pane drops each row's place, then its time; a maximized pane keeps the content to a readable width, centred.

## Escape

Convention. Escape closes the innermost thing, one layer per press, in the tab the person last interacted with; with nothing left, it restores a maximized pane.

- In order: an open menu, picker, completion or lightbox; a title being edited or a field with a draft (Escape cancels the edit or leaves the field, and never clears a draft); the object's own inner layers (each module lists them); then the maximized pane. A drag in progress takes Escape first.
- An Escape that something already handled, or one that is part of an IME composition, closes nothing more.
- An App or a web page is another site: while focus is in it, Raft doesn't hear the key. An iframe that reports its Escape (a document shown in an iframe does) passes it to its tab, and it does exactly what the key pressed in the pane does: that tab's own layers first, then a maximized pane.

## Keyboard

Convention, and our problem: the browser and the desktop app already own some keys. The parts expose what they need (`onNewTab`, `onToggleMaximize`, `onClose`, a pane's `focused`) and register no shortcut of their own; the app binds the keys.

| Key (Ctrl for ⌘ on Windows) | Desktop app | Web |
| --- | --- | --- |
| ⌘T new tab, ⌘W close the tab, ⌘⇧T reopen a closed tab | Yes | No: the browser's own (they open and close browser tabs) |
| ⌃Tab and ⌃⇧Tab, on a Mac also ⌘⌥→ and ⌘⌥←: the next and previous tab | Yes | No: the browser's own |
| ⇧⌘W close the window (File › Close Window) | Yes | No: the browser's own |
| ⌘↩ maximize or restore | Yes | Yes |
| F6 and ⇧F6: the next and previous pane | Yes | No: the browser's own (it moves to the address bar) |
| ⌘1 to ⌘9 | Switch workspace, as today | The browser's own |

- There is no shortcut for a tab by its place. ⌘1 to ⌘9 already switch workspaces in the desktop app, and people know them; tabs are reached with ⌃Tab, the tab bar's arrows and All tabs.
- The tab keys act on the pane the person last interacted with. ⌘W closes its front tab, but only when nothing smaller is open: a lightbox, a preview or a dialog closes first, as ⌘W does today. With no tab left, ⌘W does nothing more: it never closes the window. Close Window moves to ⇧⌘W while the tabs are on, as in a browser, so the window still has a key that closes it.
- While focus is in a page (an App or a web page in the desktop app), the page's own keys (⌘T, ⌘W, ⌃Tab and the rest of the built-in browser's) act on the tabs here, because a page tab holds one page.
- A tab bar is one Tab stop: ArrowLeft and ArrowRight move between its tabs, Enter or Space brings one to the front, Delete or Backspace closes the focused one. The × isn't in the Tab order. On the web these keys and the tab's menu are how the keyboard opens, closes and moves tabs.
- Moving to another pane with F6 marks it once. A pointer press anywhere in a pane focuses it; a right-click only opens a menu and doesn't move focus.

## Phone

Our problem. The phone has no tabs and keeps today's behaviour: an object opens full screen, and Back returns to where the person was. There is no tab list and no tab menu on the phone (xxchan, #proj-workspace:#479).

## Rules

- Open an object from a list worked through one item at a time in the pane beside it, and from anywhere else as a tab, one per object.
- On the web, open an App in a new browser tab; only the desktop app has App tabs.
- Keep an object's row as today's head bar, without its title, its Expand and ×, and the control that moves its column.
- Put the object's actions in its row's ⋯, every kind's, a web page's and an App's too, and only the tab's and pane's in the tab's menu. Never a ⋯ on the tab bar, and never a button for the tab's menu.
- Name a web page's tab by its page title, the domain only until it has one; the URL only in the address row.
- Keep a tab bar's end to +, Maximize and, only when needed, All tabs.
- Fit tabs by one rule, the same for every tab: names in full, then the longest give way, then All tabs with its room kept first. Choosing or hovering a tab never changes a width. Never a limit on the number of tabs.
- Show what is new on a tab as an unread count or an attention dot; hidden, as one dot on All tabs.
- Show one look for an object that can't open, and another only where the person can do something.
- Keep a tab's lasting state when switching tabs; let its temporary layers close.
- Close one layer per Escape; restore a maximized pane last; never clear a draft.
- Bind no tab shortcut the browser or the desktop app already owns: no ⌘T, ⌘W or ⌃Tab on the web, and no ⌘1 to ⌘9 for tabs anywhere.
- Hold then move is a drag, hold then lift is the menu, move first is a scroll.
- Draw a domain only with [SiteDomain](https://raft-design.botiverse.build/components/site-domain.md).
- Keep a squeezed pane's titles visible.

## Related

- [Tab](https://raft-design.botiverse.build/components/tab.md), [TabBar](https://raft-design.botiverse.build/components/tab-bar.md), [Pane](https://raft-design.botiverse.build/components/pane.md), [PaneGrid](https://raft-design.botiverse.build/components/pane-grid.md), [PaneDropOverlay](https://raft-design.botiverse.build/components/pane-drop-overlay.md)
- [Drag and drop](https://raft-design.botiverse.build/patterns/drag-and-drop.md), [Responsive layout](https://raft-design.botiverse.build/patterns/responsive.md), [Navigation](https://raft-design.botiverse.build/patterns/navigation.md)
- [Tabs](https://raft-design.botiverse.build/components/tabs.md): the sections of one page, not objects
