Skip to content

Commit 26f0a36

Browse files
improve(ui): streamline session hovercard details
1 parent 267bc58 commit 26f0a36

12 files changed

Lines changed: 441 additions & 383 deletions

‎docs/tools/progress-card.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ The tool returns a short receipt such as `Progress card updated (rev 4, 1/3 done
5050
Choose the representation that makes the current state easiest to scan: use a table for comparisons or metrics, a progress bar for one long operation, and a checklist only when the work is genuinely sequential. Omit the checklist when a table, bar, or sentence says it better, and do not repeat the same facts across the plan and Markdown. Markdown accepts ordinary formatting, links, and optional progress bars:
5151

5252
```md
53-
Tests are running.
53+
<progress aria-label="Tests · 3/7" value="3" max="7"></progress>
5454

55-
<progress value="3" max="7"></progress>
55+
Tests are running.
5656

5757
| check | state |
5858
| ---------- | ------- |
5959
| unit tests | passed |
6060
| live flow | running |
6161
```
6262

63-
The Control UI renders `progress` elements with `value` and `max` attributes. Other raw HTML is stripped by the Markdown sanitizer.
63+
Put one progress bar first and give it a short `aria-label` with its purpose and current/total values. In the session hovercard, the Agent Notepad pins the bar above the note and shows that label. Other raw HTML is stripped by the Markdown sanitizer.
6464

6565
## Limits
6666

@@ -88,7 +88,7 @@ The current chat keeps exactly one live card in the main conversation:
8888
- The card appears in the collapsible surface inside the composer at every width.
8989

9090
Opening a side panel does not move the card out of the conversation. The placements are mutually exclusive. Hover a session row in the sidebar or a session-reference link in chat to see the same card for that session. All card placements read the same Gateway-backed state and refresh after `progressCard.changed` notifications.
91-
Each placement shows the local time of the last progress update, including seconds.
91+
The composer and dashboard placements show the local time of the last progress update. The hovercard instead shows the current-or-next plan step and its completed/total count, followed by Markdown in a separate Agent Notepad when a note is present.
9292

9393
## Pin the card to the dashboard
9494

‎src/agents/tools/progress-card-tool.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "vitest";
22
import { createProgressCardTool } from "./progress-card-tool.js";
33

44
const DESCRIPTION =
5-
'Maintain this session\'s progress card: the single durable status surface shown next to the session in OpenClaw\'s UIs, for someone who is not reading the transcript. Keep it current on any task that takes more than a moment — it is how the user watches you work without scrolling. Each call replaces the whole card. Pick the representation that fits the work, using either or both parts: `markdown` — a compact note; tables for comparisons or metrics, <progress value="3" max="7"></progress> bars for one long operation, a bold one-liner for simple state; other raw HTML is stripped. Known URL? Link it. Don’t leave PRs or issues as bare IDs. And `plan` — an ordered step checklist (pending | in_progress | completed, at most one in_progress) for genuinely sequential work. The checklist is optional: omit it whenever a table, bar, or sentence says it better, and never repeat the same facts in both parts. Call with both parts empty to clear. Update on meaningful change — a step done, a blocker, results in — not every message. Max 8 KB markdown, 50 steps.';
5+
'Maintain this session\'s progress card: the single durable status surface shown next to the session in OpenClaw\'s UIs, for someone who is not reading the transcript. Keep it current on any task that takes more than a moment — it is how the user watches you work without scrolling. Each call replaces the whole card. Pick the representation that fits the work, using either or both parts: `markdown` — a compact note; tables for comparisons or metrics, a bold one-liner for simple state, or one <progress aria-label="CI · 4/6" value="4" max="6"></progress> bar for a long operation. Put a progress bar first and give it a short aria-label with its purpose and current/total values; the session hovercard pins it above the note and shows that label. Other raw HTML is stripped. Known URL? Link it. Don’t leave PRs or issues as bare IDs. And `plan` — an ordered step checklist (pending | in_progress | completed, at most one in_progress) for genuinely sequential work. The checklist is optional: omit it whenever a table, bar, or sentence says it better, and never repeat the same facts in both parts. Call with both parts empty to clear. Update on meaningful change — a step done, a blocker, results in — not every message. Max 8 KB markdown, 50 steps.';
66

77
describe("progress_card tool", () => {
88
it("replaces the card and returns compact progress receipts", async () => {

‎src/agents/tools/progress-card-tool.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function createProgressCardTool(options: ProgressCardToolOptions = {}): A
3232
name: "progress_card",
3333
label: "Progress Card",
3434
description:
35-
'Maintain this session\'s progress card: the single durable status surface shown next to the session in OpenClaw\'s UIs, for someone who is not reading the transcript. Keep it current on any task that takes more than a moment — it is how the user watches you work without scrolling. Each call replaces the whole card. Pick the representation that fits the work, using either or both parts: `markdown` — a compact note; tables for comparisons or metrics, <progress value="3" max="7"></progress> bars for one long operation, a bold one-liner for simple state; other raw HTML is stripped. Known URL? Link it. Don’t leave PRs or issues as bare IDs. And `plan` — an ordered step checklist (pending | in_progress | completed, at most one in_progress) for genuinely sequential work. The checklist is optional: omit it whenever a table, bar, or sentence says it better, and never repeat the same facts in both parts. Call with both parts empty to clear. Update on meaningful change — a step done, a blocker, results in — not every message. Max 8 KB markdown, 50 steps.',
35+
'Maintain this session\'s progress card: the single durable status surface shown next to the session in OpenClaw\'s UIs, for someone who is not reading the transcript. Keep it current on any task that takes more than a moment — it is how the user watches you work without scrolling. Each call replaces the whole card. Pick the representation that fits the work, using either or both parts: `markdown` — a compact note; tables for comparisons or metrics, a bold one-liner for simple state, or one <progress aria-label="CI · 4/6" value="4" max="6"></progress> bar for a long operation. Put a progress bar first and give it a short aria-label with its purpose and current/total values; the session hovercard pins it above the note and shows that label. Other raw HTML is stripped. Known URL? Link it. Don’t leave PRs or issues as bare IDs. And `plan` — an ordered step checklist (pending | in_progress | completed, at most one in_progress) for genuinely sequential work. The checklist is optional: omit it whenever a table, bar, or sentence says it better, and never repeat the same facts in both parts. Call with both parts empty to clear. Update on meaningful change — a step done, a blocker, results in — not every message. Max 8 KB markdown, 50 steps.',
3636
parameters: ProgressCardToolSchema,
3737
execute: async (_toolCallId, rawArgs) => {
3838
const sessionKey = options.agentSessionKey?.trim();

‎ui/src/components/portaled-hovercard.ts‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,11 @@ export class PortaledHovercardController {
3737
);
3838
}
3939

40-
schedulePointerExit(event: PointerEvent, target: HTMLElement, bridgeMs = 220): void {
40+
schedulePointerExit(bridgeMs = 220): void {
4141
this.pointerInside = false;
42-
const side = this.card?.dataset.side;
43-
const rect = target.getBoundingClientRect();
44-
const towardCard =
45-
(event.relatedTarget instanceof Node && this.card?.contains(event.relatedTarget)) ||
46-
(side === "right" && event.clientX >= rect.right) ||
47-
(side === "left" && event.clientX <= rect.left) ||
48-
(side === "bottom" && event.clientY >= rect.bottom) ||
49-
(side === "top" && event.clientY <= rect.top);
50-
this.scheduleClose(towardCard ? bridgeMs : this.closeDelayMs);
42+
// Portaled cards can be viewport-clamped diagonally from their trigger, so
43+
// exit coordinates cannot reliably tell whether the pointer is crossing the gap.
44+
this.scheduleClose(bridgeMs);
5145
}
5246

5347
focusables(): HTMLElement[] {

0 commit comments

Comments
 (0)