Quellcode durchsuchen

fix: answer form radio name matches action field (option, not option-block-id); remove question title display; simplified terminal — stdin blue, stdout white, stderr red, # lines green per-line; skip llm-comment entries in terminal (duplicates bash command_text)

clanker vor 1 Monat
Ursprung
Commit
95468c5476
3 geänderte Dateien mit 38 neuen und 29 gelöschten Zeilen
  1. 12 10
      src/pages/app.css
  2. 3 5
      src/pages/task_detail.html
  3. 23 14
      src/pages/task_terminal.html

+ 12 - 10
src/pages/app.css

@@ -491,7 +491,7 @@ summary { cursor: pointer; font-weight: 600; }
 
 [hidden] { display: none !important; }
 
-/* Plain terminal view — single monospace block, no cards */
+/* Plain terminal — looking over a colleague's shoulder */
 
 .terminal-plain {
     background: #1a1a2e;
@@ -500,29 +500,31 @@ summary { cursor: pointer; font-weight: 600; }
     font-family: "SF Mono", "Fira Code", "Cascadia Code", Menlo, monospace;
     font-size: 0.875rem;
     line-height: 1.5;
-    max-height: 70vh;
+    max-height: 75vh;
     overflow-y: auto;
     padding: var(--grid-2);
     white-space: pre-wrap;
     word-break: break-all;
 }
 
-.term-comment {
+/* LLM thinking / bash comments — green */
+.term-think {
     color: #4ade80;
-    font-style: italic;
 }
 
-.term-cmd {
+/* stdin — what the LLM typed (blue) */
+.term-stdin {
     color: #7dd3fc;
-    font-weight: 600;
 }
 
-.term-input-text {
-    color: #a5b4fc;
+/* stdout — standard terminal white */
+.term-stdout {
+    color: #d4d4d4;
 }
 
-.term-out {
-    color: #d4d4d4;
+/* stderr — red */
+.term-stderr {
+    color: #f87171;
 }
 
 /* Comment dialog */

+ 3 - 5
src/pages/task_detail.html

@@ -349,10 +349,9 @@
                 </div>
 
                 <p><span stm-attribute.class="'badge badge-' + block.block_type" stm-text="block.block_type">type</span>
-                    <strong stm-text="block.question">question</strong>
                     <span class="muted" stm-text="block.created_display">when</span></p>
 
-                <div stm-if="block.body.length > 0 && block.block_type != 'review'" class="md rfc-body"
+                <div stm-if="block.body.length > 0" class="md rfc-body"
                      stm-markdown="block.body">body</div>
 
                 <div stm-if="block.answered">
@@ -363,12 +362,11 @@
                 <form stm-if="!block.answered && block.block_type == 'question'" stm-action="block.answer_action">
                     <div class="options">
                         <label stm-for-option-in="block.options" stm-key="option" class="option-card">
-                            <input type="radio" stm-attribute.name="'option-' + block.id"
-                                   stm-attribute.value="option">
+                            <input type="radio" name="option" stm-attribute.value="option">
                             <span stm-text="option">option</span>
                         </label>
                         <label>
-                            <input type="radio" stm-attribute.name="'option-' + block.id" value="__other__">
+                            <input type="radio" name="option" value="__other__">
                             <span>Other:</span>
                             <textarea name="other" rows="2"></textarea>
                         </label>

+ 23 - 14
src/pages/task_terminal.html

@@ -45,33 +45,42 @@
                 }
 
                 function appendEntry(log, entry) {
+                    // Only render bash entries — llm-comment entries duplicate
+                    // the # lines already present in the bash command_text
                     var type = entry.type || 'command';
+                    if (type !== 'bash' && type !== 'command') return;
 
-                    if (type === 'llm-comment' || (entry.command && entry.command.charAt(0) === '#')) {
-                        var c = document.createElement('span');
-                        c.className = 'term-comment';
-                        c.textContent = (entry.command || entry.output || '') + '\n';
-                        log.appendChild(c);
-                        return;
-                    }
-
+                    // stdin: the LLM's response sent to bash — render per-line
                     if (entry.command && entry.command.length > 0) {
-                        var cmd = document.createElement('span');
-                        cmd.className = 'term-cmd';
-                        cmd.textContent = '$ ' + entry.command + '\n';
-                        log.appendChild(cmd);
+                        var lines = entry.command.split('\n');
+                        for (var i = 0; i < lines.length; i++) {
+                            var line = lines[i];
+                            if (line.length === 0) continue;
+                            var span = document.createElement('span');
+                            if (line.charAt(0) === '#') {
+                                span.className = 'term-think';
+                                span.textContent = line + '\n';
+                            } else {
+                                span.className = 'term-stdin';
+                                span.textContent = '$ ' + line + '\n';
+                            }
+                            log.appendChild(span);
+                        }
                     }
 
+                    // piped input (saddle query)
                     if (entry.input && entry.input.length > 0) {
                         var inp = document.createElement('span');
-                        inp.className = 'term-input-text';
+                        inp.className = 'term-stdin';
                         inp.textContent = entry.input + '\n';
                         log.appendChild(inp);
                     }
 
+                    // stdout/stderr
                     if (entry.output && entry.output.length > 0) {
                         var out = document.createElement('span');
-                        out.className = 'term-out';
+                        out.className = (entry.exit_code !== 0 && entry.exit_code !== -1)
+                            ? 'term-stderr' : 'term-stdout';
                         out.textContent = entry.output + '\n';
                         log.appendChild(out);
                     }