Skip to content
Merged
6 changes: 1 addition & 5 deletions apps/desktop/src/design.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const SHAPED = /(?<![\w-])rounded-(?:md|lg|full)(?![\w-])/;
*/
const PILL_ALLOWED: [file: string, part: string, why: string][] = [
["ui/AttentionCards.tsx", "send([o])", "the answers are choice rows"],
["ui/ChatView.tsx", "data-panel-toggle", "the side panel's toggle: its fill marks the panel open"],
["ui/Board.tsx", "Unsettle", "a 24px icon button"],
["ui/ChatView.tsx", "px-2 font-medium", "the plan pill is a popover trigger"],
["ui/ComposerFooter.tsx", "aria-pressed={wt.on}", "a worktree toggle; its fill is its state"],
Expand All @@ -69,11 +70,6 @@ const PILL_ALLOWED: [file: string, part: string, why: string][] = [
"a glyph in the machine icon picker; its fill marks the one chosen",
],
["ui/ShortcutSettings.tsx", "recording ?", "the keycap button; its fill marks recording"],
[
"ui/settingsKit.tsx",
"enabled:hover:bg-fill enabled:active:bg-fill-strong",
"a settings row's Action: one control shape in a card",
],
["ui/Settings.tsx", "aria-current={s.id === section", "a settings section row"],
];

Expand Down
9 changes: 9 additions & 0 deletions apps/desktop/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,11 @@
border-radius: 9999px;
background: var(--rc-knob);
box-shadow: var(--rc-knob-shadow);
transition: scale 200ms var(--ease-snappy);
}
/* Held, the thumb swells like the switch's knob and the segmented control's pill. */
.rc-range:active::-webkit-slider-thumb {
scale: 1.15;
}
.rc-range::-moz-range-track {
height: 8px;
Expand All @@ -1040,6 +1045,10 @@
border-radius: 9999px;
background: var(--rc-knob);
box-shadow: var(--rc-knob-shadow);
transition: scale 200ms var(--ease-snappy);
}
.rc-range:active::-moz-range-thumb {
scale: 1.15;
}

/*
Expand Down
59 changes: 34 additions & 25 deletions apps/desktop/src/ui/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { formatClock, isRunning, type ThreadState } from "../state/thread";
import { retryStalledFirstMessage, retryThread } from "../state/threadActions";
import { splitThreadKey } from "../state/threadKeys";
import { failureHarness, turnErrorAdvice } from "../state/turnError";
import type { PanelKind } from "../state/viewActions";
import { overviewExpanded, setOverviewExpanded } from "../state/widgets";
import { AttentionCard, ResolvedApprovalBar } from "./AttentionCards";
import { OriginChip } from "./Branches";
Expand All @@ -71,23 +72,14 @@ import { NEW_THREAD_WIDGETS_MIN_HEIGHT, NewThreadWidgets } from "./NewThreadWidg
import { boundTips } from "./newThreadTips";
import { ProjectMark } from "./ProjectMark";
import { ProjectPicker, useMoveBlockedReason } from "./ProjectPicker";
import {
Callout,
ClusterButton,
cx,
Kbd,
Pill,
Skeleton,
Spinner,
surfaceCollisionPadding,
Tooltip,
} from "./primitives";
import { Callout, cx, Kbd, Pill, Skeleton, Spinner, surfaceCollisionPadding, Tooltip } from "./primitives";
import { RemoteThreadIndicator } from "./RemoteAccessPage";
import { ReportPanel } from "./ReportPanel";
import { RightPanel } from "./RightPanel";
import { RollingNumber } from "./RollingNumber";
import { UserRow } from "./Rows";
import { useThreadStatus } from "./Status";
import { ThreadTitle } from "./ThreadTitle";
import { FIRST_ROW_PAD, Transcript } from "./Transcript";
import { WhileAwayCard } from "./WhileAway";

Expand Down Expand Up @@ -162,22 +154,39 @@ function PlanHeaderButton({ thread }: { thread?: ThreadState }) {
return thread ? <PlanButton thread={thread} /> : null;
}

// The side panel's toggle: it opens the panel on this thread's last tab (Details, Changes, Pull
// requests) and closes whichever is showing. It carries `data-panel-toggle`: a panel that closes
// with nothing else focused hands the keyboard back to it (ui/RightPanel.tsx).
/**
* The side panel's toggle names the tab it opens (this thread's last: Details, Changes, Pull
* requests). Its `data-panel-toggle` takes the keyboard back when a panel closes (ui/RightPanel.tsx).
*/
const PANEL_LABELS: Record<PanelKind, string> = {
details: "Details",
changes: "Changes",
pulls: "Pull requests",
peek: "Thread",
};

function DetailsHeaderButton() {
const on = useApp((s) => !!s.panel);
const panel = useApp((s) => s.panel);
const remembered = useApp((s) => (s.selectedId ? s.panelByThread[s.selectedId] : undefined));
const key = useShortcutHint("toggle-panel");
const label = PANEL_LABELS[panel ?? remembered ?? "details"];
return (
<ClusterButton
label="Side panel"
tooltip={on ? `Close side panel (${key})` : `Side panel (${key})`}
data-panel-toggle
on={on}
onClick={toggleRightPanel}
>
<PanelRight size={16} />
</ClusterButton>
<Tooltip label={panel ? `Close side panel (${key})` : `Side panel (${key})`} side="bottom">
<button
type="button"
aria-label="Side panel"
aria-pressed={!!panel}
data-panel-toggle
onClick={toggleRightPanel}
className={cx(
"inline-flex h-7 items-center gap-1.5 rounded-full pr-2 pl-3 text-callout text-fg-muted hover:bg-fill hover:text-fg active:bg-fill-strong",
panel && "bg-fill text-fg",
)}
>
{label}
<PanelRight size={16} />
</button>
</Tooltip>
);
}

Expand Down Expand Up @@ -256,7 +265,7 @@ function Header({
/
</span>
)}
<h1 className="min-w-0 truncate font-semibold text-body">{title}</h1>
<ThreadTitle thread={pending ? undefined : thread} title={title} />
{thread && machine && (
<MachineSelector
thread={thread}
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/ui/RightPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ export function RightPanel() {
}}
className={cx(
CARD_SURFACE,
// As tall as what it shows, up to the room the row gives it.
"self-start",
// The full height of the row, below the header: a floating sidebar, not a card that ends with its content.
"self-stretch",
// Above the header's glass (`z-10`): the header spans the whole view and fades 24px past
// its foot, which would otherwise wash over the card's top 12px. The card starts below
// the header's band, so nothing of it covers the header's own controls.
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ui/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ function PanelHeader({ label }: { label: string }) {
{save.pending ? "Saving…" : save.error ? `Could not save: ${save.error}` : save.saved ? "Saved" : ""}
</span>
{resets.count > 0 && (
<Action quiet onClick={() => resets.restore()}>
<Action size="sm" onClick={() => resets.restore()}>
<RotateCcw size={13} />
Restore defaults
</Action>
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ui/SettingsAppearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export function AppearancePage() {
action={
<div className="flex items-center gap-1">
{hasShell() && (
<Action quiet size="sm" onClick={() => revealPath(userDir)}>
<Action size="sm" onClick={() => revealPath(userDir)}>
<FolderOpen size={12} /> Open themes folder
</Action>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ui/SettingsScope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function SettingsScopeBar({ machineOnly = false }: { machineOnly?: boolea
...(machineOnly ? [] : [{ value: ALL, label: "All machines" }]),
];
return (
<div className="mb-6 flex flex-col gap-2 rounded-xl bg-surface px-4 py-3">
<div className="mb-6 flex flex-col gap-2 rounded-xl border border-border bg-surface px-4 py-3">
<div className="flex flex-wrap items-center gap-3">
<div className="min-w-0 flex-1">
<div className="flex items-center gap-1.5 font-medium text-body text-fg">
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ui/SidebarThreadRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ import { ThreadQuickActions } from "./ThreadQuickActions";
// One thread row of the sidebar (ThreadRow, PendingRow), its state label and its
// context menu (ThreadMenuItems), split out of Sidebar.tsx, which lays the rows out.

function ThreadMenuItems({
export function ThreadMenuItems({
session,
Menu,
Item,
Expand Down
Loading