MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / _build_task_panel

Function _build_task_panel

core/display.py:158–184  ·  view source on GitHub ↗

Build a rich panel showing task checklist.

(queue)

Source from the content-addressed store, hash-verified

156_task_live = None
157
158def _build_task_panel(queue):
159 """Build a rich panel showing task checklist."""
160 from core.taskqueue import STATUS_DONE, STATUS_RUNNING, STATUS_FAILED, STATUS_PENDING
161 text = Text.from_markup('')
162 for t in queue.tasks:
163 if t.status == STATUS_DONE:
164 icon = '[green]✓[/green]' # markup
165 style = 'dim'
166 elif t.status == STATUS_RUNNING:
167 icon = '[cyan]⠸[/cyan]' # markup
168 style = 'bold'
169 elif t.status == STATUS_FAILED:
170 icon = '[red]✗[/red]' # markup
171 style = 'red'
172 else:
173 icon = '[dim]☐[/dim]' # markup
174 style = 'dim'
175 done = queue.done_count()
176 total = len(queue.tasks)
177 line = f' {icon} {t.id}. {t.description[:50]}'
178 if t.status == STATUS_DONE and t.result:
179 line += f' [dim]→ {t.result[:40]}[/dim]'
180 text.append_text(Text.from_markup(line + '\n'))
181 done = queue.done_count()
182 total = len(queue.tasks)
183 title = f'Task Plan [dim]{done}/{total}[/dim]'
184 return Panel(text, title=title, border_style='cyan', box=box.ROUNDED)
185
186def show_task_plan(queue):
187 """Print initial task plan (static)."""

Callers 2

show_task_planFunction · 0.85
update_task_displayFunction · 0.85

Calls 1

done_countMethod · 0.80

Tested by

no test coverage detected