fix(record): use example.com as the default record start URL

This commit is contained in:
“haonan”
2026-07-22 14:15:53 +08:00
parent 585308df45
commit d1de850b42
8 changed files with 27 additions and 14 deletions
@@ -81,7 +81,7 @@ describe("App", () => {
fireEvent.click(screen.getByRole("button", { name: "快捷功能" })); fireEvent.click(screen.getByRole("button", { name: "快捷功能" }));
expect(screen.getByText("操作录制")).toBeTruthy(); expect(screen.getByText("操作录制")).toBeTruthy();
expect(screen.getByText("录制你的操作,供 Agent 复用")).toBeTruthy(); expect(screen.getByText("录制你的操作,供 Agent 参考")).toBeTruthy();
expect(screen.queryByText("未连接")).toBeNull(); expect(screen.queryByText("未连接")).toBeNull();
fireEvent.click(screen.getByRole("button", { name: /操作录制/ })); fireEvent.click(screen.getByRole("button", { name: /操作录制/ }));
@@ -96,7 +96,7 @@ describe("App", () => {
fireEvent.click(screen.getByRole("button", { name: "返回" })); fireEvent.click(screen.getByRole("button", { name: "返回" }));
expect(screen.getByText("未连接")).toBeTruthy(); expect(screen.getByText("未连接")).toBeTruthy();
expect(screen.queryByText("录制你的操作,供 Agent 复用")).toBeNull(); expect(screen.queryByText("录制你的操作,供 Agent 参考")).toBeNull();
}); });
it("shows single-line compact metadata and copies the instance id", async () => { it("shows single-line compact metadata and copies the instance id", async () => {
+18 -5
View File
@@ -126,9 +126,16 @@ export function App() {
<RiArrowLeftLine className="size-4" aria-hidden /> <RiArrowLeftLine className="size-4" aria-hidden />
</Button> </Button>
) : ( ) : (
<img src={getLogoSrc()} alt="" className="size-7 rounded-lg" data-slot="popup-brand-logo" /> <img
src={getLogoSrc()}
alt=""
className="size-7 rounded-lg"
data-slot="popup-brand-logo"
/>
)} )}
<h1 className="min-w-0 flex-1 truncate text-sm font-semibold tracking-tight">{headerTitle}</h1> <h1 className="min-w-0 flex-1 truncate text-sm font-semibold tracking-tight">
{headerTitle}
</h1>
{view === "main" && ( {view === "main" && (
<Button <Button
type="button" type="button"
@@ -264,7 +271,9 @@ export function App() {
> >
<Icon className="size-4 shrink-0 text-muted-foreground" aria-hidden /> <Icon className="size-4 shrink-0 text-muted-foreground" aria-hidden />
<span className="min-w-0 flex-1"> <span className="min-w-0 flex-1">
<span className="block text-xs font-medium text-foreground">{t(feature.titleKey)}</span> <span className="block text-xs font-medium text-foreground">
{t(feature.titleKey)}
</span>
<span className="mt-0.5 block text-[11px] leading-snug text-muted-foreground"> <span className="mt-0.5 block text-[11px] leading-snug text-muted-foreground">
{t(feature.descKey)} {t(feature.descKey)}
</span> </span>
@@ -292,7 +301,9 @@ export function App() {
id="bh-record-purpose" id="bh-record-purpose"
type="text" type="text"
value={purposeDraft} value={purposeDraft}
onChange={(event: ChangeEvent<HTMLInputElement>) => setPurposeDraft(event.target.value)} onChange={(event: ChangeEvent<HTMLInputElement>) =>
setPurposeDraft(event.target.value)
}
placeholder={t("popup.record.topicPlaceholder")} placeholder={t("popup.record.topicPlaceholder")}
className="mt-0 h-8 text-sm" className="mt-0 h-8 text-sm"
data-slot="popup-record-purpose-input" data-slot="popup-record-purpose-input"
@@ -306,7 +317,9 @@ export function App() {
id="bh-record-start-url" id="bh-record-start-url"
type="url" type="url"
value={startUrlDraft} value={startUrlDraft}
onChange={(event: ChangeEvent<HTMLInputElement>) => setStartUrlDraft(event.target.value)} onChange={(event: ChangeEvent<HTMLInputElement>) =>
setStartUrlDraft(event.target.value)
}
placeholder={t("popup.record.startUrlPlaceholder")} placeholder={t("popup.record.startUrlPlaceholder")}
className="mt-0 h-8 text-sm" className="mt-0 h-8 text-sm"
data-slot="popup-record-start-url-input" data-slot="popup-record-start-url-input"
@@ -1,5 +1,5 @@
import { RiRecordCircleLine } from "@remixicon/react";
import type { RemixiconComponentType } from "@remixicon/react"; import type { RemixiconComponentType } from "@remixicon/react";
import { RiRecordCircleLine } from "@remixicon/react";
export type PopupFeatureId = "record"; export type PopupFeatureId = "record";
@@ -9,8 +9,8 @@ import {
} from "../record"; } from "../record";
describe("record defaults", () => { describe("record defaults", () => {
it("uses Baidu as the default injectable start URL", () => { it("uses example.com as the default injectable start URL", () => {
expect(RECORD_DEFAULT_START_URL).toBe("https://www.baidu.com/"); expect(RECORD_DEFAULT_START_URL).toBe("https://example.com/");
}); });
}); });
+1 -1
View File
@@ -78,7 +78,7 @@ function sleep(ms: number): Promise<void> {
} }
/** Injectable http(s) landing page when `tool.record_start` omits `url`. */ /** Injectable http(s) landing page when `tool.record_start` omits `url`. */
export const RECORD_DEFAULT_START_URL = "https://www.baidu.com/"; export const RECORD_DEFAULT_START_URL = "https://example.com/";
/** Pages where MV3 content scripts cannot attach (Agent Window boots here). */ /** Pages where MV3 content scripts cannot attach (Agent Window boots here). */
function isContentScriptRestrictedUrl(url: string | undefined): boolean { function isContentScriptRestrictedUrl(url: string | undefined): boolean {
+1 -1
View File
@@ -212,7 +212,7 @@ Capture the user's own actions in the Agent Window to a `trace.json`, for later
```bash ```bash
bsk record start --browser <instance-id-or-label> [--url https://…] [--purpose "publish a wiki doc"] [--output trace.json] bsk record start --browser <instance-id-or-label> [--url https://…] [--purpose "publish a wiki doc"] [--output trace.json]
# `--url` is optional; default https://www.baidu.com/ when omitted (must be http(s)). # `--url` is optional; default https://example.com/ when omitted (must be http(s)).
# Blocks until the user clicks Finish in the recording panel, then writes ./trace.json and closes the window. # Blocks until the user clicks Finish in the recording panel, then writes ./trace.json and closes the window.
bsk record stop [--output trace.json] # terminal fallback if the browser panel is unavailable bsk record stop [--output trace.json] # terminal fallback if the browser panel is unavailable
+1 -1
View File
@@ -50,7 +50,7 @@ pub struct RecordStartArgs {
pub tab_id: Option<i64>, pub tab_id: Option<i64>,
/// Navigate to this http(s) URL before recording. When omitted, defaults /// Navigate to this http(s) URL before recording. When omitted, defaults
/// to `https://www.baidu.com/`. /// to `https://example.com/`.
#[arg(long)] #[arg(long)]
pub url: Option<String>, pub url: Option<String>,
+1 -1
View File
@@ -212,7 +212,7 @@ Capture the user's own actions in the Agent Window to a `trace.json`, for later
```bash ```bash
bsk record start --browser <instance-id-or-label> [--url https://…] [--purpose "publish a wiki doc"] [--output trace.json] bsk record start --browser <instance-id-or-label> [--url https://…] [--purpose "publish a wiki doc"] [--output trace.json]
# `--url` is optional; default https://www.baidu.com/ when omitted (must be http(s)). # `--url` is optional; default https://example.com/ when omitted (must be http(s)).
# Blocks until the user clicks Finish in the recording panel, then writes ./trace.json and closes the window. # Blocks until the user clicks Finish in the recording panel, then writes ./trace.json and closes the window.
bsk record stop [--output trace.json] # terminal fallback if the browser panel is unavailable bsk record stop [--output trace.json] # terminal fallback if the browser panel is unavailable