Skip to content

Dashboard: briefly flips to history view during batch startup #507

@HenryLach

Description

@HenryLach

Problem

When a new batch starts, the dashboard briefly shows the previous batch's history view before switching to the new batch. This happens because the #487 fix (clear viewer when batch disappears) triggers during a brief polling gap where batch-state.json is being written.

Sequence

  1. New batch starts → batch-state.json being created
  2. Dashboard poll reads no batch (file not yet written or in-flight)
  3. lastBatchId logic detects "batch gone" → clears viewer → shows history
  4. Next poll picks up new batch → switches back to live view

Fix

Add a brief debounce: only flip to history if "no batch" persists for 2+ consecutive polls (10+ seconds). A single missing poll should not trigger the transition.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions