ГЛОБАЛЬНЫЙ РЕФАКТОРИНГ АРХИТЕКТУРЫ - Рефакторинг этапов Stage 3.6 Усилина оркестрация и детект data-scope для живого сленга. Убрана шаблонность soft-refusal в limited-ответах. Подрезана словарнаю жирность в фильтр-экстракторе
This commit is contained in:
@@ -407,6 +407,15 @@ function CommentResolvedIcon({ resolved }: { resolved: boolean }) {
|
||||
);
|
||||
}
|
||||
|
||||
function CopyOutlineIcon() {
|
||||
return (
|
||||
<svg className="autoruns-copy-icon-svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<rect x="9" y="9" width="11" height="11" rx="2.2" />
|
||||
<path d="M15 7V5.8a1.8 1.8 0 0 0-1.8-1.8H5.8A1.8 1.8 0 0 0 4 5.8v7.4A1.8 1.8 0 0 0 5.8 15H7" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
export function AutoRunsHistoryPanel({
|
||||
connection,
|
||||
prompts,
|
||||
@@ -526,6 +535,38 @@ export function AutoRunsHistoryPanel({
|
||||
[onLog]
|
||||
);
|
||||
|
||||
const copyRunIdToClipboard = useCallback(
|
||||
async (event: React.SyntheticEvent, runId: string) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
const value = String(runId ?? "").trim();
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (navigator?.clipboard?.writeText) {
|
||||
await navigator.clipboard.writeText(value);
|
||||
} else {
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = value;
|
||||
textarea.setAttribute("readonly", "true");
|
||||
textarea.style.position = "fixed";
|
||||
textarea.style.opacity = "0";
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
log(`run id copied: ${value}`);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
setErrorText(`Копирование run id: ${message}`);
|
||||
log(`copy run id error: ${message}`);
|
||||
}
|
||||
},
|
||||
[log]
|
||||
);
|
||||
|
||||
function startAssistantLiveStatusTicker(): () => void {
|
||||
let index = 0;
|
||||
setAssistantLiveStatus(ASSISTANT_STAGES[0]);
|
||||
@@ -1819,7 +1860,25 @@ export function AutoRunsHistoryPanel({
|
||||
<strong>{formatDateTime(run.run_timestamp)}</strong>
|
||||
<span>{formatShortTarget(run.eval_target)}</span>
|
||||
</div>
|
||||
<div className="autoruns-run-meta">{run.run_id}</div>
|
||||
<div className="autoruns-run-meta autoruns-run-id-row">
|
||||
<span>{run.run_id}</span>
|
||||
<span
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
className="autoruns-copy-run-id-btn"
|
||||
onClick={(event) => void copyRunIdToClipboard(event, run.run_id)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter" || event.key === " ") {
|
||||
event.preventDefault();
|
||||
void copyRunIdToClipboard(event, run.run_id);
|
||||
}
|
||||
}}
|
||||
title="Скопировать run id"
|
||||
aria-label={`Скопировать run id ${run.run_id}`}
|
||||
>
|
||||
<CopyOutlineIcon />
|
||||
</span>
|
||||
</div>
|
||||
<div className="autoruns-run-meta">
|
||||
режим={run.mode ?? "нет данных"} | mock={String(run.use_mock)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user