feat: virtual-scroll rendering for work-item list via --virtualize flag#1425
Merged
SorraTheOrc merged 3 commits intoApr 8, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/TheWizardsCode/ContextHub/sessions/845ce879-be31-4e91-9a8f-897061b43acb Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
…ection Agent-Logs-Url: https://github.com/TheWizardsCode/ContextHub/sessions/845ce879-be31-4e91-9a8f-897061b43acb Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add full virtualization of work-item tree
feat: virtual-scroll rendering for work-item list via --virtualize flag
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blessed materializes every row as a DOM node on
setItems(), making large lists (~5k items) unusably slow. This adds an opt-in virtual-scroll path that only passes the visible viewport slice to blessed.New:
VirtualList(src/tui/virtual-list.ts)Pure indexing class with no blessed dependency — all viewport arithmetic lives here.
Controller wiring (
src/tui/controller.ts)getGlobalSelectedIndex()— convertslist.selected(viewport-relative when virtual) to the full-list index. Replaces everylist.selected as numbercall site.renderListAndDetail: whenvlis set, updates viewport height from the widget, callsvl.slice(lines)instead of passing all lines, and syncslist.select(vl.selectedIndexInViewport).listKeypressHandler: detects when the cursor hits the viewport edge and callsvl.scrollBy(±1)+ re-render rather than letting blessed silently ignore the keypress.renderListAndDetail.updateListSelection: appliesvl.offset + idxconversion before updating the detail pane.Layout / CLI
CreateLayoutOptions.virtualize?: boolean— when set,createLayoutreturns a pre-configuredVirtualListinlayout.virtualList.wl tui --virtualizeflag wires this throughcontroller.start().Tests
27 unit tests in
test/tui/virtual-list.test.tscoveringmoveBy,selectAbsolute,scrollBy,slice,setTotalItems,setViewportHeight, and boundary conditions. Existing TUI tests unaffected.