ГЛОБАЛЬНЫЙ РЕФАКТОРИНГ АРХИТЕКТУРЫ - Рефакторинг этапов 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>
|
||||
|
||||
@@ -891,6 +891,60 @@ button:disabled {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.autoruns-run-id-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.autoruns-run-id-row > span {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.autoruns-copy-run-id-btn {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgb(var(--rgb-text-main));
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
min-width: 16px;
|
||||
min-height: 16px;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
opacity: 0.92;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.autoruns-copy-run-id-btn:hover {
|
||||
color: rgb(var(--rgb-text-main));
|
||||
opacity: 1;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.autoruns-copy-run-id-btn:focus-visible {
|
||||
outline: 1px solid rgba(var(--rgb-text-main), 0.7);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.autoruns-copy-icon-svg {
|
||||
width: 0.82rem;
|
||||
height: 0.82rem;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 1.75;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
.autoruns-dialog-toolbar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@@ -946,12 +1000,17 @@ button:disabled {
|
||||
padding: 8px 10px;
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.autoruns-msg header,
|
||||
.autoruns-msg footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
gap: 8px;
|
||||
font-size: 0.74rem;
|
||||
color: var(--text-muted);
|
||||
@@ -960,9 +1019,19 @@ button:disabled {
|
||||
.autoruns-msg-head-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.autoruns-msg-head-actions > span {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.autoruns-msg-case-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -979,6 +1048,14 @@ button:disabled {
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.35;
|
||||
font-size: 0.84rem;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.autoruns-msg footer span {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.autoruns-comment-icon {
|
||||
|
||||
Reference in New Issue
Block a user