MCPcopy Index your code
hub / github.com/anomalyco/opencode / scrollTodoFinal

Function scrollTodoFinal

packages/opencode/src/cli/cmd/run/tool.ts:795–825  ·  view source on GitHub ↗
(p: ToolProps<typeof TodoWriteTool>)

Source from the content-addressed store, hash-verified

793}
794
795function scrollTodoFinal(p: ToolProps<typeof TodoWriteTool>): string {
796 const items = list<{ status?: string }>(p.input.todos)
797 const time = span(p.frame.state)
798 if (items.length === 0) {
799 if (!time) {
800 return "0 todos"
801 }
802
803 return `0 todos · ${time}`
804 }
805
806 const doneN = items.filter((item) => item.status === "completed").length
807 const runN = items.filter((item) => item.status === "in_progress").length
808 const left = items.length - doneN - runN
809 const tail = [`${items.length} total`]
810 if (doneN > 0) {
811 tail.push(`${doneN} done`)
812 }
813 if (runN > 0) {
814 tail.push(`${runN} active`)
815 }
816 if (left > 0) {
817 tail.push(`${left} pending`)
818 }
819
820 if (time) {
821 tail.push(time)
822 }
823
824 return tail.join(" · ")
825}
826
827function scrollQuestionStart(_: ToolProps<typeof QuestionTool>): string {
828 return ""

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
listFunction · 0.70
spanFunction · 0.70

Tested by

no test coverage detected