Refine terminal history scrolling and job failure summaries

This commit is contained in:
npc0-hue
2026-08-10 13:48:23 +08:00
parent fbd24b6a44
commit d1f4dce4f5
7 changed files with 54 additions and 11 deletions
@@ -20,7 +20,7 @@ The server log SSE route currently replays `historyLimit` entries independently
- Treat `historyLimit` as a server-wide budget for the SSE endpoint, with a platform cap of 10,000. This prevents stream-count multiplication while retaining the existing query parameter and compatibility for existing clients.
- Read bounded tails from each stream using its latest sequence, merge by timestamp/sequence/stream ID, and emit only the newest budgeted entries in chronological order. This keeps the UI output coherent without adding a new cross-stream database query API.
- Give the terminal output element a ref and track `followLatest` from scroll position. Initial history and live events call a bottom-scroll helper only while locked; a user scroll above a small bottom threshold unlocks, and a later scroll to the threshold locks again.
- Give the terminal output element a ref and track `followLatest` from scroll position. The terminal requests only a 500-entry recent replay, then locks to the bottom after `ready` with two animation frames; layout-driven scroll events during replay cannot unlock follow mode. After initialization, a user scroll above a small bottom threshold unlocks, and a later scroll to the threshold locks again.
- Keep the rendered buffer capped at 10,000 through the existing merge helper. System and command-result lines use the same cap, so browser memory remains bounded even when the stream is noisy.
## Risks / Trade-offs
@@ -25,6 +25,7 @@ The management terminal SHALL begin with the output viewport at the newest rende
- **WHEN** the terminal receives its initial bounded history
- **THEN** the output viewport scrolls to the bottom after the lines render
- **AND** new log events continue to appear without moving the viewport away from the newest line
- **AND** the terminal requests no more than 500 initial history entries while retaining up to 10,000 rendered lines as live output arrives
#### Scenario: Operator inspects older output
- **WHEN** the operator scrolls above the bottom threshold
@@ -5,11 +5,11 @@
## 2. Management Terminal View
- [x] 2.1 Add a scroll container ref and follow-latest state to the management terminal, with initial/live bottom scrolling only while locked and unlock/relock detection at the bottom threshold.
- [ ] 2.1 Add a scroll container ref and follow-latest state to the management terminal, with initial/live bottom scrolling only while locked and unlock/relock detection at the bottom threshold.
- [x] 2.2 Increase the terminal retention buffer to 10,000 lines and keep oldest-line eviction for all incoming line types.
- [x] 2.3 Add focused frontend tests for initial bottom positioning, scroll unlock/relock, bounded buffer behavior, and bounded SSE history options.
- [ ] 2.3 Add focused frontend tests for initial bottom positioning, scroll unlock/relock, bounded buffer behavior, and bounded SSE history options.
## 3. Verification
- [x] 3.1 Run focused platform and platform_web tests, then `scripts/check-structure.sh`.
- [x] 3.2 Run `openspec validate improve-server-terminal-log-window --strict` and record verification evidence before marking tasks complete.
- [ ] 3.1 Run focused platform and platform_web tests, then `scripts/check-structure.sh`.
- [ ] 3.2 Run `openspec validate improve-server-terminal-log-window --strict` and record verification evidence before marking tasks complete.