Skip to content

Commit 3442dc3

Browse files
fix(tui): restore story list on completion screen
When EventStoryStarted was removed during the prd.json cleanup, the code that set currentStoryID and currentStoryStart was lost. Without these, finalizeStoryTiming() always returned early, leaving storyTimings empty and the completion screen without its story list. Attach the current storyID to EventIterationStart events from the loop, and start tracking story timing in the TUI when the story changes.
1 parent 18619c9 commit 3442dc3

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

internal/loop/loop.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,14 @@ func (l *Loop) Run(ctx context.Context) error {
191191
l.mu.Unlock()
192192
}
193193

194-
// Send iteration start event
194+
// Send iteration start event with current story ID
195+
l.mu.Lock()
196+
iterStoryID := l.currentStoryID
197+
l.mu.Unlock()
195198
l.events <- Event{
196199
Type: EventIterationStart,
197200
Iteration: currentIter,
201+
StoryID: iterStoryID,
198202
}
199203

200204
// Run a single iteration with retry logic

internal/tui/app.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,12 @@ func (a App) handleLoopEvent(prdName string, event loop.Event) (tea.Model, tea.C
927927
case loop.EventIterationStart:
928928
if isCurrentPRD {
929929
a.lastActivity = "Starting iteration..."
930+
// Start tracking story timing if this is a new story
931+
if event.StoryID != "" && event.StoryID != a.currentStoryID {
932+
a.finalizeStoryTiming()
933+
a.currentStoryID = event.StoryID
934+
a.currentStoryStart = time.Now()
935+
}
930936
}
931937
case loop.EventAssistantText:
932938
if isCurrentPRD {

0 commit comments

Comments
 (0)