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
21 changes: 20 additions & 1 deletion apps/web/src/bench/bench-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,29 @@ export function BenchDrawer({
active.offsetLeft < strip.scrollLeft ||
active.offsetLeft + active.offsetWidth > strip.scrollLeft + strip.clientWidth
) {
strip.scrollLeft = active.offsetLeft - 16;
strip.scrollLeft = Math.max(0, active.offsetLeft - 32);
}
}, [tab, open]);

// Edge fades show only on the side that still has tabs to scroll to.
useEffect(() => {
const strip = stripRef.current;
if (strip === null) return;
const update = () => {
const max = strip.scrollWidth - strip.clientWidth;
strip.dataset["fadeStart"] = String(strip.scrollLeft > 1);
strip.dataset["fadeEnd"] = String(strip.scrollLeft < max - 1);
};
update();
strip.addEventListener("scroll", update, { passive: true });
const observer = new ResizeObserver(update);
observer.observe(strip);
return () => {
strip.removeEventListener("scroll", update);
observer.disconnect();
};
}, []);

useEffect(() => {
if (!open) return;
// preventScroll: focusing must never shift the thread's scroll position.
Expand Down
24 changes: 22 additions & 2 deletions apps/web/src/bench/drawer.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
/* Drawer chrome and tab-body sections: unboxed, per the mockup. */

.drawer .drawer-tabs {
-webkit-mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
--fade-start: #000;
--fade-end: #000;
-webkit-mask: linear-gradient(
90deg,
var(--fade-start),
#000 28px,
#000 calc(100% - 28px),
var(--fade-end)
);
mask: linear-gradient(
90deg,
var(--fade-start),
#000 28px,
#000 calc(100% - 28px),
var(--fade-end)
);
}
.drawer .drawer-tabs[data-fade-start="true"] {
--fade-start: transparent;
}
.drawer .drawer-tabs[data-fade-end="true"] {
--fade-end: transparent;
}
.drawer .drawer-tabs button:last-child {
margin-right: 24px;
Expand Down
14 changes: 9 additions & 5 deletions apps/web/src/bench/insights-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export function InsightsTab({ workbenchTenantId }: { readonly workbenchTenantId:
];

return (
<div className="drawer-stack">
<section className="insights-panel">
<h3>Last 7 days</h3>
<div>
<section className="drawer-sec">
<div className="drawer-sec-head">
<h3>Last 7 days</h3>
</div>
<div className="bi-stats">
{tiles.map(([label, value]) => (
<div key={label} className="bi-stat">
Expand All @@ -45,8 +47,10 @@ export function InsightsTab({ workbenchTenantId }: { readonly workbenchTenantId:
))}
</div>
</section>
<section className="insights-panel">
<h3>Runs per day</h3>
<section className="drawer-sec">
<div className="drawer-sec-head">
<h3>Runs per day</h3>
</div>
<OutcomeChart days={stats.days} />
</section>
<Link
Expand Down
16 changes: 10 additions & 6 deletions apps/web/src/bench/members-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export function MembersTab({
const agents = participants.filter((p) => p.kind === "agent");

return (
<div className="drawer-stack">
<section className="insights-panel">
<h3>People</h3>
<div>
<section className="drawer-sec">
<div className="drawer-sec-head">
<h3>People</h3>
</div>
{people.isPending ? <Skeleton className="h-12 w-full" /> : null}
{people.isError ? (
<RichEmptyState
Expand Down Expand Up @@ -61,8 +63,10 @@ export function MembersTab({
})}
</ul>
</section>
<section className="insights-panel">
<h3>Agents</h3>
<section className="drawer-sec">
<div className="drawer-sec-head">
<h3>Agents</h3>
</div>
{loading ? <Skeleton className="h-12 w-full" /> : null}
{!loading && agents.length === 0 ? (
<p className="workbench-info-empty-note">No agents yet.</p>
Expand All @@ -74,7 +78,7 @@ export function MembersTab({
<WorkbenchAvatar kind="worker" name={agent.name} size="md" />
<span className="drawer-list-text">
<b>{agent.name}</b>
<span>{agent.address === "" ? "Starting" : "Live"}</span>
<span>{agent.address === "" ? "Starting" : "Running"}</span>
</span>
</Link>
</li>
Expand Down
Loading