Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(home): show each topic as one track on the team board (#22649)

Arvin Xu70e48ed270bd
diff --git a/locales/en-US/home.json b/locales/en-US/home.json
index 7dae647216d..3cd92faccb4 100644
--- a/locales/en-US/home.json
+++ b/locales/en-US/home.json
@@ -192,7 +192,6 @@
"team.agent.untitled": "Untitled agent",
"team.attention.approvalNeeded": "Waiting for approval to continue",
"team.attention.blocked": "Waiting on teammates",
- "team.attention.empty": "Nothing is waiting on anyone right now.",
"team.attention.failed": "Failed",
"team.attention.failedAgo": "Failed {{time}} ago",
"team.attention.handle": "Review",
diff --git a/locales/zh-CN/home.json b/locales/zh-CN/home.json
index 561274d15ae..494db7b5ad1 100644
--- a/locales/zh-CN/home.json
+++ b/locales/zh-CN/home.json
@@ -192,7 +192,6 @@
"team.agent.untitled": "未命名助手",
"team.attention.approvalNeeded": "需要批准后才能继续",
"team.attention.blocked": "等待团队成员",
- "team.attention.empty": "目前没有需要处理的事项。",
"team.attention.failed": "失败",
"team.attention.failedAgo": "{{time}}前失败",
"team.attention.handle": "去处理",
diff --git a/packages/locales/src/default/home.ts b/packages/locales/src/default/home.ts
index 8e02bcb1a55..3062f6c7769 100644
--- a/packages/locales/src/default/home.ts
+++ b/packages/locales/src/default/home.ts
@@ -199,7 +199,6 @@ export default {
'team.agent.untitled': 'Untitled agent',
'team.attention.approvalNeeded': 'Waiting for approval to continue',
'team.attention.blocked': 'Waiting on teammates',
- 'team.attention.empty': 'Nothing is waiting on anyone right now.',
'team.attention.failed': 'Failed',
'team.attention.failedAgo': 'Failed {{time}} ago',
'team.attention.handle': 'Review',
diff --git a/src/features/HomeTeamBoard/AttentionList.tsx b/src/features/HomeTeamBoard/AttentionList.tsx
index 55a7174db22..79cbc634ad9 100644
--- a/src/features/HomeTeamBoard/AttentionList.tsx
+++ b/src/features/HomeTeamBoard/AttentionList.tsx
@@ -37,7 +37,6 @@ const styles = stylex.create({
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
- empty: { color: cssVar.colorTextTertiary, fontSize: 13 },
heading: { color: cssVar.colorTextTertiary, fontSize: 12, fontWeight: 500 },
item: {
backgroundColor: { 'default': 'transparent', ':hover': cssVar.colorFillQuaternary },
@@ -159,9 +158,6 @@ const AttentionList = ({ items, now }: { items: AgentRunBoardAttentionItem[]; no
now={now}
title={t('team.attention.failed')}
/>
- {items.length === 0 && (
- <span {...stylex.props(styles.empty)}>{t('team.attention.empty')}</span>
- )}
</Flexbox>
);
};
diff --git a/src/features/HomeTeamBoard/Timeline.tsx b/src/features/HomeTeamBoard/Timeline.tsx
index 5ab9828fb79..08841a7605e 100644
--- a/src/features/HomeTeamBoard/Timeline.tsx
+++ b/src/features/HomeTeamBoard/Timeline.tsx
@@ -21,6 +21,7 @@ import {
NOW_TICK_INDEX,
type PlacedRun,
resolveRowLabel,
+ resolveTopicSpan,
type TopicRow,
} from './layout';
import { RUN_STATUS_VISUALS } from './statusVisuals';
@@ -62,6 +63,8 @@ const styles = stylex.create({
},
axis: { height: 20, position: 'relative' },
bar: {
+ // A bare <button> paints the browser's gray under the translucent segments.
+ backgroundColor: 'transparent',
borderRadius: 5,
borderStyle: 'none',
borderWidth: 0,
@@ -154,6 +157,14 @@ const styles = stylex.create({
height: '100%',
justifyContent: 'center',
},
+ topicSpan: {
+ backgroundColor: cssVar.colorFillTertiary,
+ borderRadius: 5,
+ height: BAR_HEIGHT,
+ pointerEvents: 'none',
+ position: 'absolute',
+ top: 3,
+ },
segment: { display: 'block', height: '100%', overflow: 'hidden', position: 'relative' },
live: { borderInlineEndStyle: 'solid', borderInlineEndWidth: 2, boxSizing: 'border-box' },
shine: {
@@ -174,7 +185,9 @@ const styles = stylex.create({
const mix = (status: AgentRunBoardRunStatus, percent: number) =>
`color-mix(in srgb, ${RUN_STATUS_VISUALS[status].color} ${percent}%, transparent)`;
-const tint = (status: AgentRunBoardRunStatus) => mix(status, 32);
+const tint = (status: AgentRunBoardRunStatus) =>
+ // Finished turns read as work done on the track, so they stay blue against the idle band.
+ status === 'done' ? `color-mix(in srgb, ${cssVar.colorInfo} 24%, transparent)` : mix(status, 32);
/** Live work: fills toward its leading edge, with a light sweeping across it. */
const LiveSegment = () => (
@@ -279,6 +292,22 @@ const Bar = ({
);
};
+/** One band per topic: bars are its working turns, the band showing between them its idle time. */
+const TopicSpanBand = ({ runs }: { runs: PlacedRun[] }) => {
+ const { endsWaiting, left, width } = resolveTopicSpan(runs);
+
+ return (
+ <span
+ aria-hidden
+ data-testid={'team-board-topic-span'}
+ {...sx(styles.topicSpan, {
+ insetInlineStart: `${left}%`,
+ width: endsWaiting ? `calc(${width}% + ${WAIT_MARK_WIDTH}px)` : `${width}%`,
+ })}
+ />
+ );
+};
+
const RowLabel = ({ agentId, row, title }: { agentId: string; row: TopicRow; title: string }) => {
const openDrawer = useOpenRunDrawer();
const { anchor, offset, room } = resolveRowLabel(row.runs);
@@ -372,6 +401,7 @@ const Lane = ({
{...stylex.props(styles.row)}
>
<div {...stylex.props(styles.track)}>
+ <TopicSpanBand runs={row.runs} />
{row.runs.map((placed) => (
<Bar
agentId={lane.agentId}
diff --git a/src/features/HomeTeamBoard/index.tsx b/src/features/HomeTeamBoard/index.tsx
index b2c3c801b9e..9926a14e350 100644
--- a/src/features/HomeTeamBoard/index.tsx
+++ b/src/features/HomeTeamBoard/index.tsx
@@ -32,6 +32,7 @@ const styles = stylex.create({
},
alignItems: 'start',
},
+ columnsFull: { gridTemplateColumns: 'minmax(0, 1fr)' },
empty: {
borderColor: cssVar.colorBorderSecondary,
borderRadius: 12,
@@ -73,6 +74,10 @@ const HomeTeamBoard = () => {
if (error && !data) return <AsyncError error={error} variant={'inline'} onRetry={mutate} />;
+ // An older server can omit the field; the board must still render.
+ const attention = data?.attention ?? [];
+ const hasAttention = attention.length > 0;
+
return (
<Flexbox data-testid={'team-board'} gap={20} {...stylex.props(styles.root)}>
{!data ? (
@@ -118,7 +123,7 @@ const HomeTeamBoard = () => {
onAgentChange={setAgentId}
onUserChange={setUserId}
/>
- <div {...stylex.props(styles.columns)}>
+ <div {...stylex.props(styles.columns, !hasAttention && styles.columnsFull)}>
{!data.lanes?.length ? (
<div {...stylex.props(styles.empty)}>
{t(scope === 'involved' ? 'team.emptyInvolved' : 'team.empty', {
@@ -130,7 +135,7 @@ const HomeTeamBoard = () => {
) : (
<Timeline board={data} />
)}
- <AttentionList items={data.attention} now={data.generatedAt} />
+ {hasAttention && <AttentionList items={attention} now={data.generatedAt} />}
</div>
</Flexbox>
)}
diff --git a/src/features/HomeTeamBoard/layout.test.ts b/src/features/HomeTeamBoard/layout.test.ts
index ffadf1f18f0..f667523ef03 100644
--- a/src/features/HomeTeamBoard/layout.test.ts
+++ b/src/features/HomeTeamBoard/layout.test.ts
@@ -12,6 +12,7 @@ import {
MIN_BAR_PERCENT,
NOW_TICK_INDEX,
resolveRowLabel,
+ resolveTopicSpan,
} from './layout';
const start = new Date('2026-11-08T10:00:00Z');
@@ -38,6 +39,49 @@ const run = (
...overrides,
});
+describe('resolveTopicSpan', () => {
+ const placedRuns = (...runs: AgentRunBoardRun[]) =>
+ layoutLaneTopics(runs, start, end).rows[0].runs;
+
+ it('covers the idle gap from the first turn to the last', () => {
+ const span = resolveTopicSpan(
+ placedRuns(run('a', 6, 12, { topicId: 't' }), run('b', 30, 36, { topicId: 't' })),
+ );
+
+ expect(span.left).toBeCloseTo(9);
+ expect(span.width).toBeCloseTo(45);
+ expect(span.endsWaiting).toBe(false);
+ });
+
+ it('reaches the end of an earlier turn that outlasts the later ones', () => {
+ const span = resolveTopicSpan(
+ placedRuns(run('a', 0, 48, { topicId: 't' }), run('b', 6, 12, { topicId: 't' })),
+ );
+
+ expect(span.width).toBeCloseTo(72);
+ });
+
+ it('includes the minimum width of a very short last turn', () => {
+ const span = resolveTopicSpan(
+ placedRuns(run('a', 0, 6, { topicId: 't' }), run('b', 30, 30, { topicId: 't' })),
+ );
+
+ expect(span.width).toBeCloseTo(45 + MIN_BAR_PERCENT);
+ });
+
+ it('flags a topic whose last turn is waiting so the span covers the wait mark', () => {
+ const span = resolveTopicSpan(
+ placedRuns(
+ run('a', 0, 6, { topicId: 't' }),
+ run('b', 12, null, { status: 'needs_human', topicId: 't', waitingSince: at(18) }),
+ ),
+ );
+
+ expect(span.width).toBeCloseTo(27);
+ expect(span.endsWaiting).toBe(true);
+ });
+});
+
describe('layoutLaneTopics', () => {
it('positions a run as percentages and extends a live run to the end', () => {
const { rows } = layoutLaneTopics([run('a', 30, null)], start, end);
diff --git a/src/features/HomeTeamBoard/layout.ts b/src/features/HomeTeamBoard/layout.ts
index 79ac6d9280f..1440bf7da2c 100644
--- a/src/features/HomeTeamBoard/layout.ts
+++ b/src/features/HomeTeamBoard/layout.ts
@@ -128,6 +128,28 @@ export const resolveRowLabel = (runs: PlacedRun[]): RowLabelPlacement => {
return { anchor: 'end', offset: 100 - end, room: end };
};
+export interface TopicSpan {
+ /** Whether the span must also cover the wait mark drawn past its last bar. */
+ endsWaiting: boolean;
+ left: number;
+ width: number;
+}
+
+const placedEnd = ({ left, width }: PlacedRun) => left + width;
+
+/** The stretch of a row from the topic's first turn to its last, idle gaps included. */
+export const resolveTopicSpan = (runs: PlacedRun[]): TopicSpan => {
+ const left = Math.min(...runs.map((placed) => placed.left));
+ // Not simply the last run: an earlier turn can outlast the ones started after it.
+ const latest = runs.reduce((a, b) => (placedEnd(b) >= placedEnd(a) ? b : a));
+
+ return {
+ endsWaiting: latest.run.status === 'needs_human',
+ left,
+ width: placedEnd(latest) - left,
+ };
+};
+
const HOUR_MS = 60 * 60_000;
const DAY_HOURS = 24;