Sfoglia il codice sorgente

ui: task page progress feed directly below the status head

The agent's green progress updates (task_progress feed, saddle
progress-update) rendered further down the page below the plan; they
now sit immediately under the full-width status-head card Phase 3
pinned to the top — the latest line first, the history behind the fold
(newest-first ordering unchanged). Task-page test pins the placement
(status-head < Progress < Description) and the newest-first render.
clanker 1 mese fa
parent
commit
4fcf4f6e51
2 ha cambiato i file con 44 aggiunte e 17 eliminazioni
  1. 20 17
      src/pages/task_detail.html
  2. 24 0
      test/web_stack_test.py

+ 20 - 17
src/pages/task_detail.html

@@ -262,6 +262,26 @@
                 </form>
             </section>
 
+            <!-- The agent's progress feed sits directly below the status
+                 head: newest first (the latest line up top, the history
+                 behind the fold). -->
+            <h3>Progress</h3>
+            <div stm-if="task.progress.length > 0">
+                <p class="progress-latest" stm-text="task.progress[0].summary">latest</p>
+                <p class="muted" stm-text="'reported ' + task.progress[0].when_display">when</p>
+                <details stm-if="task.progress.length > 1">
+                    <summary>Show history (<span stm-text="task.progress.length">0</span> updates)</summary>
+                    <ul class="progress-history">
+                        <li stm-for-item-in="task.progress">
+                            <span class="muted" stm-text="item.when_display">when</span> —
+                            <span stm-text="item.summary">summary</span>
+                        </li>
+                    </ul>
+                </details>
+            </div>
+            <p stm-if="task.progress.length == 0" class="muted">No progress reports yet — the agent reports via
+                <code>saddle progress-update</code>.</p>
+
             <div class="cards">
                 <section class="card">
                     <h3>Description</h3>
@@ -320,23 +340,6 @@
                 </form>
             </details>
 
-            <h3>Progress</h3>
-            <div stm-if="task.progress.length > 0">
-                <p class="progress-latest" stm-text="task.progress[0].summary">latest</p>
-                <p class="muted" stm-text="'reported ' + task.progress[0].when_display">when</p>
-                <details stm-if="task.progress.length > 1">
-                    <summary>Show history (<span stm-text="task.progress.length">0</span> updates)</summary>
-                    <ul class="progress-history">
-                        <li stm-for-item-in="task.progress">
-                            <span class="muted" stm-text="item.when_display">when</span> —
-                            <span stm-text="item.summary">summary</span>
-                        </li>
-                    </ul>
-                </details>
-            </div>
-            <p stm-if="task.progress.length == 0" class="muted">No progress reports yet — the agent reports via
-                <code>saddle progress-update</code>.</p>
-
             <h3>Blocks <span class="muted" stm-if="task.blocks.length > 0">(<span stm-text="task.blocks.length">0</span>)</span></h3>
             <div stm-for-block-in="task.blocks" stm-key="block.id"
                  stm-attribute.class="'block-card ' + block.block_type + (block.answered ? ' answered' : '')">

+ 24 - 0
test/web_stack_test.py

@@ -2482,6 +2482,30 @@ def main():
               and page.index("status-head") < page.index("<h3>Description</h3>")
               and page.index("status-head") < page.index("<h3>Plan</h3>"),
               "the status block sits at the very top of the task page")
+        # The agent's progress feed renders DIRECTLY below the status
+        # head (above the description cards), newest line first.
+        check(page.index("status-head") < page.index("<h3>Progress</h3>")
+              < page.index("<h3>Description</h3>"),
+              "the progress feed sits directly below the status head")
+        conn = db()
+        conn.execute("insert into tasks (project_id, title, status, priority,"
+                     " created_at) values (1, 'Progress layout task', 'working', 5,"
+                     " strftime('%s','now','-120 seconds'))")
+        layout_task = conn.execute("select max(id) from tasks").fetchone()[0]
+        # backdated so the dashboard-timeline fixtures below stay the
+        # newest events
+        conn.execute("insert into task_progress (task_id, summary, created_at)"
+                     " values (?, 'first update', strftime('%s','now','-90 seconds'))",
+                     (layout_task,))
+        conn.execute("insert into task_progress (task_id, summary, created_at)"
+                     " values (?, 'second update', strftime('%s','now','-89 seconds'))",
+                     (layout_task,))
+        conn.commit()
+        conn.close()
+        status, history_page = http("GET", "/tasks/%d" % layout_task, timeout=15)
+        check(status == 200
+              and history_page.index("progress-latest") < history_page.index("progress-history"),
+              "the progress timeline renders newest-first (latest above the history)")
 
         print("== phase 3: dashboard — pinned blocks + activity timeline ==")
         # Pinned OPEN blocking items as link-through cards, newest