From e39f08a35e0da6c842c239cdaf65c33b981cd813 Mon Sep 17 00:00:00 2001 From: Maria Hovhannisyan Date: Tue, 22 Sep 2026 13:49:14 +0400 Subject: [PATCH] Fix compare-mode prompt templating preview and field notes. Show both Prompt A and B full-prompt previews, and mark case fields that appear in only one template. Co-authored-by: Cursor --- public/app.css | 17 +++++++++++++ public/app.js | 65 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 9 deletions(-) diff --git a/public/app.css b/public/app.css index 54cc9ad..4de0cd3 100644 --- a/public/app.css +++ b/public/app.css @@ -391,6 +391,13 @@ code { color: var(--Colors-Text-Body-Light); } +.eval-field__usage { + margin-left: 6px; + font-size: 0.6875rem; + font-weight: 400; + color: var(--Colors-Text-Body-Light); +} + .eval-controls-row { display: flex; flex-wrap: wrap; @@ -743,6 +750,12 @@ select.input { color: var(--Colors-Text-Body-Light); } +.eval-case-prompt-preview__prompt-label { + margin: var(--UI-Spacing-spacing-s, 12px) 0 4px; + font-weight: 600; + color: var(--Colors-Text-Body-Medium); +} + .eval-case-prompt-preview .eval-template-preview { min-height: 6rem; max-height: 16rem; @@ -754,6 +767,10 @@ select.input { line-height: 1.5; } +.eval-case-prompt-preview .eval-case-prompt-preview__prompt-label + .eval-template-preview { + margin-top: 0; +} + @media (max-width: 600px) { .eval-example { grid-template-columns: 1fr; diff --git a/public/app.js b/public/app.js index 1913861..102a435 100644 --- a/public/app.js +++ b/public/app.js @@ -151,6 +151,16 @@ function activeTemplateFields() { }); } +function fieldPromptUsageNote(fieldName) { + if (!session.compareMode || !PROMPT_TEMPLATING.dynamicFields) return ''; + const inA = findPromptPlaceholders(promptAEl.value).includes(fieldName); + const inB = findPromptPlaceholders(promptBEl.value).includes(fieldName); + if (inA && inB) return ''; + if (inA) return 'A only'; + if (inB) return 'B only'; + return ''; +} + function parseTemplateParts(template) { const parts = []; const source = String(template ?? ''); @@ -637,9 +647,15 @@ function renderCases() { const value = field.name === 'input' ? c.input : (c.variables?.[field.name] ?? ''); + const usageNote = fieldPromptUsageNote(field.name); return `