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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,25 @@ function row(container: HTMLElement): HTMLElement {
}

describe("SessionCard orchestration identity", () => {
it("shows grid membership immediately left of the status", () => {
const { container } = render(
<SessionCard
session={makeSession()}
lane={lane}
isSelected={false}
onSelect={vi.fn()}
onContextMenu={vi.fn()}
gridBadge="active"
/>,
);

const indicator = screen.getByRole("img", { name: "In the active grid" });
const status = container.querySelector("[data-session-status-slot]");
expect(indicator).toBeTruthy();
expect(status).toBeTruthy();
expect(indicator.nextElementSibling).toBe(status);
});

it("names the row with its orchestration role for assistive tech", () => {
const { container } = render(
<SessionCard
Expand Down
22 changes: 20 additions & 2 deletions apps/desktop/src/renderer/components/terminals/SessionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ import { GitHubStackBadge } from "../prs/shared/GitHubStackBadge";

Status lives in the row's CONTENT instead, in exactly one place: the status
slot on line 1 (`SessionStatusSlot`). Everything that used to compete with
it on that line — role pills, spawn pills, Imported/grid badges, live-child
it on that line — role pills, spawn pills, Imported badges, live-child
counts, wake chips, the Claude tag — moved into the hover tooltip. They are
real, they are just not worth a permanent seat.
real, they are just not worth a permanent seat. Grid membership is the one
compact identity marker that stays visible because it explains why a sidebar
session is also present in the workspace.
────────────────────────────────────────────────────────────────────────── */

/* ── Full-bleed row geometry ───────────────────────────────────────────────
Expand Down Expand Up @@ -816,6 +818,20 @@ export const SessionCard = React.memo(function SessionCard({
runtimePin={runtimePin}
/>
);
const gridIndicator = gridBadge ? (
<span
data-testid="session-grid-indicator"
role="img"
className={cn(
"inline-flex shrink-0 items-center justify-center",
gridBadge === "active" ? "text-violet-300" : "text-muted-fg/40",
)}
title={gridBadge === "active" ? "In the active grid" : "In another grid"}
aria-label={gridBadge === "active" ? "In the active grid" : "In another grid"}
>
<GridFour size={11} weight={gridBadge === "active" ? "fill" : "bold"} />
</span>
) : null;
Comment thread
arul28 marked this conversation as resolved.

/* COMPACT ROWS ONLY. The full row carries lineage on line 1 now, and two
lineage indicators on one row is exactly the duplication this pass removes.
Expand Down Expand Up @@ -920,6 +936,7 @@ export const SessionCard = React.memo(function SessionCard({
{titleNode}
{compactLineageGlyph}
<ToolLogo toolType={session.toolType} size={14} className="shrink-0 opacity-75" />
{gridIndicator}
{statusSlot}
</div>
) : (
Expand All @@ -935,6 +952,7 @@ export const SessionCard = React.memo(function SessionCard({
{part}
</React.Fragment>
))}
{gridIndicator}
{statusSlot}
</div>

Expand Down