refactor(ui-tui): clean touched resize and sticky prompt paths

Trim comment noise, remove redundant typing, normalize sticky prompt viewport args to top→bottom order, and reuse one sticky viewport helper instead of duplicating the math.
This commit is contained in:
Brooklyn Nicholson 2026-04-23 14:37:00 -05:00
parent 9a885fba31
commit 9bf6e1cd6e
5 changed files with 23 additions and 32 deletions

View file

@ -13,7 +13,7 @@ describe('stickyPromptFromViewport', () => {
const offsets = [0, 2, 10, 12, 20]
expect(stickyPromptFromViewport(messages, offsets, 16, 8, false)).toBe('')
expect(stickyPromptFromViewport(messages, offsets, 8, 16, false)).toBe('')
})
it('shows the latest user message above the viewport when no user message is visible', () => {
@ -26,6 +26,6 @@ describe('stickyPromptFromViewport', () => {
const offsets = [0, 2, 10, 12, 20]
expect(stickyPromptFromViewport(messages, offsets, 20, 16, false)).toBe('current prompt')
expect(stickyPromptFromViewport(messages, offsets, 16, 20, false)).toBe('current prompt')
})
})