Skip to content

Commit c064cae

Browse files
authored
feat(ui): preview GitHub issues and pull requests on hover (#100434)
* feat(ui): add GitHub link hover cards * chore(ui): sync GitHub hover card copy baseline * docs(changelog): defer GitHub preview entry
1 parent d2d5911 commit c064cae

15 files changed

Lines changed: 2156 additions & 5 deletions

‎docs/web/control-ui.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ The compact footer keeps connection status, **Settings**, **Docs**, and mobile p
123123
<Accordion title="Chat and Talk">
124124
- Chat with the model via Gateway WS (`chat.history`, `chat.send`, `chat.abort`, `chat.inject`).
125125
- Chat history refreshes request a bounded recent window with per-message text caps, so large sessions do not force the browser to render a full transcript payload before chat becomes usable.
126+
- Hovering or keyboard-focusing a public GitHub issue or pull request link shows its state, title, author, recent activity, comments, and change statistics. The connected Gateway fetches and caches public metadata without changing the link target, including when the UI uses a remote Gateway. The Gateway uses `GH_TOKEN` or `GITHUB_TOKEN` when available, after confirming the repository is public; otherwise it uses GitHub's anonymous API with a longer cache.
126127
- Talk through browser realtime sessions. OpenAI uses direct WebRTC, Google Live uses a constrained one-use browser token over WebSocket, and backend-only realtime voice plugins use the Gateway relay transport. Client-owned provider sessions start with `talk.client.create`; Gateway relay sessions start with `talk.session.create`. The relay keeps provider credentials on the Gateway while the browser streams microphone PCM through `talk.session.appendAudio`, forwards `openclaw_agent_consult` provider tool calls through `talk.client.toolCall` for Gateway policy and the larger configured OpenClaw model, and routes active-run voice steering through `talk.client.steer` or `talk.session.steer`.
127128
- Stream tool calls and live tool output cards in Chat (agent events).
128129
- Activity tab with browser-local, redaction-first summaries of live tool activity from existing `session.tool` / tool event delivery.
@@ -450,6 +451,7 @@ In practice:
450451
- Avatars and images served under relative paths (for example `/avatars/<id>`) still render, including authenticated avatar routes the UI fetches and converts into local `blob:` URLs.
451452
- Inline `data:image/...` URLs still render.
452453
- Local `blob:` URLs created by the Control UI still render.
454+
- GitHub link preview avatars are fetched by the Gateway from GitHub's fixed avatar host and returned as bounded `data:` URLs; the operator browser never contacts the remote avatar host.
453455
- Remote avatar URLs emitted by channel metadata are stripped at the Control UI's avatar helpers and replaced with the built-in logo/badge, so a compromised or malicious channel cannot force arbitrary remote image fetches from an operator browser.
454456

455457
This is always on and not configurable.

‎src/gateway/control-ui-contract.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ export const CONTROL_UI_TERMINAL_ENABLED_ATTRIBUTE = "data-openclaw-terminal-ena
99
/** Sandbox policy for assistant-provided embed surfaces inside Control UI. */
1010
export type ControlUiEmbedSandboxMode = "strict" | "scripts" | "trusted";
1111

12+
/** Public GitHub metadata rendered by Control UI link hover cards. */
13+
export type ControlUiGitHubPreview = {
14+
additions?: number;
15+
avatarDataUrl?: string;
16+
changedFiles?: number;
17+
closedAt?: string;
18+
comments?: number;
19+
createdAt: string;
20+
deletions?: number;
21+
draft?: boolean;
22+
kind: "issue" | "pull";
23+
login: string;
24+
mergedAt?: string;
25+
number: number;
26+
owner: string;
27+
repo: string;
28+
state: string;
29+
stateReason?: string;
30+
title: string;
31+
updatedAt: string;
32+
};
33+
1234
/** Runtime config consumed by the browser Control UI during bootstrap. */
1335
export type ControlUiBootstrapConfig = {
1436
basePath: string;

0 commit comments

Comments
 (0)