Editable analysis prompts on the admin page
CI / test (push) Successful in 44s
CI / build (push) Successful in 4m13s
CI / deploy (push) Skipped

The system prompts of the free summary and the paid detailed analysis can be
edited per language under /admin/promptok. Every save is a new row in
prompt_revisions (NULL = built-in text); new analyses record the revision in
prompt_version (v2-r<id>) and the worker uses exactly that text. Existing
analyses stay; the cross-user cache only copies results of the same revision.

The prompt code moves to the shared analysis-prompt crate so the backend can
show the built-in text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-17 14:25:08 +00:00
co-authored by Claude Opus 5.5
parent 0ba80abb47
commit 86d5dc5503
25 changed files with 1051 additions and 347 deletions
+37
View File
@@ -404,3 +404,40 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.legal a { color: var(--gold); }
.legal-table td { vertical-align: top; line-height: 1.5; }
.danger-box { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--danger); border-radius: var(--radius); }
/* Admin */
.admin-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; }
.admin-nav a {
padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted);
text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.admin-nav a:hover { color: var(--ink); }
.admin-nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.prompt-kind { display: flex; flex-direction: column; gap: 20px; }
.prompt-kind-head { display: flex; gap: 16px 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.prompt-kind-head > p { flex: 1 1 360px; margin: 0; }
.prompt-lang { width: 200px; }
.prompt-editor { display: flex; flex-direction: column; gap: 16px; }
.prompt-status { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.prompt-text {
min-height: 420px; padding: 12px 14px; resize: vertical; line-height: 1.55;
font: 400 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.prompt-extra { display: flex; flex-direction: column; gap: 10px; }
.prompt-pre {
margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2);
white-space: pre-wrap; overflow-wrap: anywhere; font: 400 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
color: var(--ink-2);
}
.prompt-history { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; }
.prompt-history li {
display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
padding: 8px 0; border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
.prompt-text { min-height: 320px; font-size: 13px; }
.prompt-lang { width: 100%; }
.prompt-history li { grid-template-columns: 1fr auto; }
.prompt-history li .hint { grid-column: 1; }
.prompt-history li .btn { grid-column: 2; grid-row: 1 / span 2; }
}