Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 2 additions & 40 deletions apps/desktop/src/ui/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ import { chooseFolder } from "../state/folders";
import type { HeaderButtonId } from "../state/headerButtons";
import { offlineNotice } from "../state/machineCache";
import { hasPendingChange, useOutbox } from "../state/machineOutbox";
import {
machineGlyph,
machineTint,
offlineSinceLabel,
useMachineReconnecting,
useMachines,
} from "../state/machines";
import { offlineSinceLabel, useMachineReconnecting, useMachines } from "../state/machines";
import { heldSetup, type PendingSetup, pendingStatus } from "../state/setup";
import {
dismissPendingSetup,
Expand Down Expand Up @@ -56,15 +50,12 @@ import {
CircleCheck,
CircleDashed,
CircleDot,
Laptop,
ListChecks,
type LucideIcon,
PanelRight,
} from "./icons";
import { JobRunBar, useJobRun } from "./JobRunBar";
import { LinkedThreads } from "./Links";
import { DeviceGlyphIcon } from "./MachineGlyph";
import { MachineSelector } from "./MachineSelector";
import { HEADER_HEIGHT, MainHeader } from "./MainHeader";
import { NewThreadBanner } from "./NewThreadBanner";
import { NEW_THREAD_WIDGETS_MIN_HEIGHT, NewThreadWidgets } from "./NewThreadWidgets";
Expand Down Expand Up @@ -183,11 +174,7 @@ function Header({
const folderKey = useShortcutHint("thread-folder");
const session = useApp((s) => (thread ? s.sessions.find((x) => x.id === thread.id) : undefined));
const listed = session?.title;
// A thread on a paired computer: the header says where it runs and opens the machine mover
// (docs/desktop.md › Several machines).
const machine = useMachineOfThread(thread?.id);
const machineHost = thread ? splitThreadKey(thread.id).host : "";
const machineEntry = useMachines((s) => s.machines.find((entry) => entry.id === machineHost));
const title = pending?.title ?? (thread ? (thread.title ?? listed ?? "New thread") : "New thread");
const cwd = pending?.cwd ?? thread?.cwd ?? projectCwd;
const newThreadHost = useApp((s) => s.newThreadHost);
Expand Down Expand Up @@ -225,7 +212,7 @@ function Header({
<button
type="button"
aria-label={`Project: ${projectName(cwd)}`}
className="-mx-1 flex max-w-[220px] shrink-0 items-center gap-1.5 rounded-sm px-1 text-body text-fg-muted hover:bg-fill-subtle hover:text-fg data-[state=open]:bg-fill-subtle data-[state=open]:text-fg"
className="-mx-1 flex h-7 max-w-[220px] shrink-0 items-center gap-1.5 rounded-sm px-2 text-body text-fg-muted hover:bg-fill-subtle hover:text-fg data-[state=open]:bg-fill-subtle data-[state=open]:text-fg"
>
<ProjectMark name={projectName(cwd)} />
<span className="min-w-0 truncate">{projectName(cwd)}</span>
Expand All @@ -239,31 +226,6 @@ function Header({
</span>
)}
<ThreadTitle thread={pending ? undefined : thread} title={title} />
{thread && machine && (
<MachineSelector
thread={thread}
side="bottom"
align="start"
trigger={
<Pill
size="sm"
aria-label={`Machine: ${machine}`}
className="max-w-[300px] font-normal text-fg-muted data-[state=open]:bg-fill data-[state=open]:text-fg"
>
{machineEntry ? (
<DeviceGlyphIcon
glyph={machineGlyph(machineEntry)}
tint={machineTint(machineEntry)}
size={12}
/>
) : (
<Laptop size={12} className="shrink-0" aria-hidden />
)}
<span className="truncate">{machine}</span>
</Pill>
}
/>
)}
{/* A fork, a side chat or a delegate links back to the thread it came from. */}
{thread && <OriginChip threadId={thread.id} />}
{/* A paired device is attached, or the thread is shared with them (RemoteAccessPage.tsx). */}
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/ui/ThreadTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function ThreadTitle({ thread, title }: { thread?: ThreadState; title: st
if (e.key === "Enter") commit();
if (e.key === "Escape") setRenaming(false);
}}
className="-mx-1 h-6 min-w-0 max-w-[480px] flex-1 rounded-sm bg-fill px-1 font-medium text-body text-fg outline-none"
className="-mx-1 h-7 min-w-0 max-w-[480px] flex-1 rounded-sm bg-fill px-2 font-medium text-body text-fg outline-none"
/>
);
}
Expand All @@ -49,7 +49,7 @@ export function ThreadTitle({ thread, title }: { thread?: ThreadState; title: st
<button
type="button"
aria-label={`Thread actions for ${title}`}
className="group -mx-1 flex h-6 min-w-0 items-center gap-0.5 rounded-sm px-1 text-left hover:bg-fill-subtle data-[state=open]:bg-fill-subtle"
className="group -mx-1 flex h-7 min-w-0 items-center gap-0.5 rounded-sm px-2 text-left hover:bg-fill-subtle data-[state=open]:bg-fill-subtle"
>
<h1 className="min-w-0 truncate font-medium text-body text-fg">{title}</h1>
<ChevronDown
Expand Down
2 changes: 1 addition & 1 deletion scripts/comment-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
21 apps/desktop/src/ui/ChangesPanel.tsx
5 apps/desktop/src/ui/ChatBackgroundGroup.tsx
5 apps/desktop/src/ui/ChatLight.tsx
111 apps/desktop/src/ui/ChatView.tsx
109 apps/desktop/src/ui/ChatView.tsx
14 apps/desktop/src/ui/CommandPalette.tsx
5 apps/desktop/src/ui/Compare.tsx
222 apps/desktop/src/ui/Composer.tsx
Expand Down