- backend: project_stages/stage_runs tables; /api/workbench router (overview, run agent with confirmed-upstream context only, edit draft, confirm, restore, script import, in-flow image/video generation via the shared queue with source=workbench); project stats gain real stage_confirmed/stage_status/active_jobs - frontend: /workbench picker + /workbench/[id] five-stage page (stepper, per-stage editors, style direction chooser, storyboard table, asset prompt cards with in-flow generation, shot video prompts with player, agent + task side rail); nav 创作工作台 now opens it; home entries go through the workbench (导入剧本 skips 剧本创作); project cards show real five-stage progress; i18n keys in all seven dictionaries - tests: 9 backend workbench tests (flow handoff, edit/confirm/restore, import, generation, Chinese failure states) Co-authored-by: multica-agent <github@multica.ai>
103 lines
2.1 KiB
Svelte
103 lines
2.1 KiB
Svelte
<script lang="ts">
|
|
import Icon from '$lib/components/ui/Icon.svelte';
|
|
import { toast } from '$lib/toast';
|
|
import { t } from '$lib/i18n.svelte';
|
|
|
|
/**
|
|
* Mono prompt card (spec §4.3 提示词卡): dark bg, strong border, header
|
|
* label + copy action, horizontally scrollable mono body.
|
|
*/
|
|
interface Props {
|
|
label: string;
|
|
text: string;
|
|
copyKey?: string;
|
|
}
|
|
|
|
let { label, text, copyKey = 'workbench.copied' }: Props = $props();
|
|
|
|
async function copy() {
|
|
try {
|
|
await navigator.clipboard.writeText(text);
|
|
toast.success(t(copyKey));
|
|
} catch {
|
|
toast.error(t('workbench.copyFailed'));
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<div class="prompt-card">
|
|
<div class="prompt-head">
|
|
<span class="prompt-label">{label}</span>
|
|
<button type="button" class="copy-btn" onclick={copy}>
|
|
<Icon name="copy" size={12} />
|
|
{t('workbench.copy')}
|
|
</button>
|
|
</div>
|
|
<pre class="prompt-body">{text}</pre>
|
|
</div>
|
|
|
|
<style>
|
|
.prompt-card {
|
|
background: var(--bg);
|
|
border: 1px solid var(--border-strong);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
min-width: 0;
|
|
}
|
|
|
|
.prompt-head {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
padding: 6px 10px;
|
|
border-bottom: 1px solid var(--border);
|
|
background: var(--surface-2);
|
|
}
|
|
|
|
.prompt-label {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
color: var(--text-2);
|
|
letter-spacing: 0.02em;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.copy-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 2px 9px;
|
|
border-radius: 999px;
|
|
border: 1px solid var(--border-strong);
|
|
background: var(--surface-3);
|
|
color: var(--accent);
|
|
font-size: 10.5px;
|
|
font-family: inherit;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition:
|
|
background-color 150ms cubic-bezier(0.16, 1, 0.3, 1),
|
|
border-color 150ms;
|
|
}
|
|
.copy-btn:hover {
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
.prompt-body {
|
|
margin: 0;
|
|
padding: 9px 10px;
|
|
font-family: var(--font-a-mono);
|
|
font-size: 11.5px;
|
|
line-height: 1.7;
|
|
color: var(--text);
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
font-variant-numeric: tabular-nums;
|
|
max-height: 220px;
|
|
overflow: auto;
|
|
}
|
|
</style>
|