MCPcopy
hub / github.com/docker/docker-agent / SidebarComponent

Struct SidebarComponent

pkg/tui/components/tool/todotool/sidebar.go:22–33  ·  view source on GitHub ↗

SidebarComponent represents the todo display component for the sidebar

Source from the content-addressed store, hash-verified

20
21// SidebarComponent represents the todo display component for the sidebar
22type SidebarComponent struct {
23 todos []todo.Todo
24 width int
25
26 // renderCache memoizes the rendered todo list keyed by content width.
27 // Render() is called on every animation frame while the agent works (the
28 // sidebar rebuilds its whole cache on each spinner tick) and the two-pass
29 // scrollbar layout renders at two widths, so without this the O(todos)
30 // word-wrap+style work runs many times per second on long lists. Cleared
31 // when the todos change (SetTodos) or the theme changes (InvalidateCache).
32 renderCache map[int]string
33}
34
35func NewSidebarComponent() *SidebarComponent {
36 return &SidebarComponent{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected