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
15 changes: 11 additions & 4 deletions apps/presentation/dashboard/smoke/chat-model-menu-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@ try {
assert.doesNotMatch(goal, /goal-only-model|Fast|personal-chat-model-menu/, "The Goal reading header leaves sending choices in the single composer");
assert.doesNotMatch(goal, /gpt-6\.1-sol/, "Goal readback does not inherit the steward model");
const linked = header("idle", { readOnlySourceLabel: "Historical run", selectedGoal: { goalId: "source-case", title: "Historical run", agentLanes: [] } });
const sourceBadge = linked.match(/class="personal-read-only-source"[^>]*>(.*?)<\/span>/)?.[1] ?? "";
assert.match(sourceBadge, new RegExp(locale === "zh-CN" ? "只读" : "Read only"));
assert.doesNotMatch(sourceBadge, /Historical run/, "The source badge does not repeat the visible Goal title");
assertions += 32;
// The persistent badge is its trigger name and visible text. Its disclosure
// panel is opened on demand and may explain the same source once.
const badgeStart = linked.indexOf('class="personal-read-only-source"');
const badgeEnd = linked.indexOf('class="personal-channel-actions"', badgeStart);
const badge = linked.slice(badgeStart, badgeEnd > badgeStart ? badgeEnd : undefined)
.replace(/<div [^>]*class="context-help-popover"[\s\S]*?<\/div>/, "");
assert.match(badge, new RegExp(locale === "zh-CN" ? "只读" : "Read only"));
assert.doesNotMatch(badge, /Historical run/, "The read-only source badge does not repeat the visible Goal title");
const distinct = header("idle", { readOnlySourceLabel: "Remote build", selectedGoal: { goalId: "source-case", title: "Public Goal", agentLanes: [] } });
assert.match(distinct, /class="personal-read-only-source-label"[^>]*>Remote build</, "A source the Goal title does not name stays visible in the badge");
assertions += 33;
}
console.log(`Chat model/header: ${assertions} bilingual model, defaults and accessible refresh assertions passed (SSR only)`);
} finally { globalThis.window = originalWindow; }
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,13 @@ export function ChannelHeader({
: "header.managerAllocationConfigured")
: null;

// The Goal title already names the source, so the persistent badge must not
// repeat it; only its disclosure panel explains that same source.
const sourceNamedByTitle = selectedGoal?.title === readOnlySourceLabel;
const runtimeControl = scopeUnavailable || agentWorkActive ? null : readOnlySourceLabel ? (
<div className="personal-read-only-source">
<ContextHelp icon={Eye} label={`${readOnlySourceLabel} · ${t("common.readOnly")}`}><p>{t("header.readOnlySourceDescription", { source: readOnlySourceLabel })}</p></ContextHelp>
{selectedGoal?.title === readOnlySourceLabel ? null : <span className="personal-read-only-source-label">{readOnlySourceLabel}</span>}
<ContextHelp icon={Eye} label={sourceNamedByTitle ? t("header.readOnlySourceHelp") : `${readOnlySourceLabel} · ${t("common.readOnly")}`}><p>{t("header.readOnlySourceDescription", { source: readOnlySourceLabel })}</p></ContextHelp>
{sourceNamedByTitle ? null : <span className="personal-read-only-source-label">{readOnlySourceLabel}</span>}
<small>{t("common.readOnly")}</small>
</div>
) : selectedGoal && !composerVisible ? null : <>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ const en = {
"header.managerView": "Manager view",
"header.openGoalNavigation": "Open Goal navigation",
"header.readOnlySourceDescription": "Original records from {source}; execution remains on its source",
"header.readOnlySourceHelp": "Read-only source help",
"header.refresh": "Refresh status",
"header.refreshDone": "Updated just now",
"header.refreshFailed": "Refresh failed",
Expand Down Expand Up @@ -2345,6 +2346,7 @@ const zhCN: Record<WorkspaceMessageKey, string> = {
"header.managerView": "管家视图",
"header.openGoalNavigation": "打开 Goal 导航",
"header.readOnlySourceDescription": "显示 {source} 的原始记录;执行控制在原运行环境",
"header.readOnlySourceHelp": "只读来源说明",
"header.refresh": "刷新状态",
"header.refreshDone": "刚刚更新",
"header.refreshFailed": "刷新失败",
Expand Down
Loading