Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/logsqueak/tui/screens/integration_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,21 @@ def __init__(
self._test_background_tasks: Dict[str, BackgroundTask] = {}

# Track which blocks have decisions ready (for navigation blocking)
# If decisions are pre-generated, mark all blocks as ready (including those with no decisions)
# In test mode (decisions is a static list), mark all blocks as ready
# In production mode (decisions is shared streaming list), only mark blocks with decisions
self.decisions_ready: Dict[str, bool] = {}
if decisions:
# Mark blocks with decisions as ready
for block_id in self.decisions_by_block.keys():
self.decisions_ready[block_id] = True
# Mark blocks without decisions as ready too (allows navigation through empty blocks)
for ec in edited_content:
if ec.block_id not in self.decisions_ready:
self.decisions_ready[ec.block_id] = True

# Only mark all blocks ready if NOT using shared streaming list
# (auto_start_workers=False indicates we're using shared list from Phase 2)
if auto_start_workers:
# Test mode with pre-generated decisions - mark all blocks ready
for ec in edited_content:
if ec.block_id not in self.decisions_ready:
self.decisions_ready[ec.block_id] = True

# Track decision count for polling updates (when using shared list from Phase 2)
self._last_known_decision_count = len(self.decisions)
Expand Down Expand Up @@ -294,7 +299,8 @@ def on_mount(self) -> None:

from logsqueak.tui.app import LogsqueakApp
task = None
if isinstance(self.app, LogsqueakApp):
# Check for background_tasks attribute (works for both LogsqueakApp and test MockApp)
if hasattr(self.app, 'background_tasks'):
task = self.app.background_tasks.get("llm_decisions")

if task and task.status == "running":
Expand Down