Skip to content

test(tui): wait for the Thinking Effort row in the color menu's own-colors test - #135

Closed
eric-engberg wants to merge 11 commits into
feat/model-family-colorsfrom
test/wait-for-ink-keys-color-menu
Closed

eric-engberg wants to merge 11 commits into
feat/model-family-colorsfrom
test/wait-for-ink-keys-color-menu

Conversation

@eric-engberg

Copy link
Copy Markdown
Owner

Builds on #133 (test/wait-for-ink-keys) and merges feat/model-family-colors (#40), which carries the Thinking Effort test from #2. Fork-only meet branch for next; not for upstream.

What

The color menu test that checks the note for a widget that sets some of its own colors waits for the Thinking Effort row to show instead of calling flushInk.

Why

#133 replaces every fixed 25 ms sleep in ColorMenu.test.tsx and drops the flushInk helper. That test comes from the fork's Thinking Effort branch and isn't on main, so #133 can't change it. Once both are in next, the file no longer compiles (Cannot find name 'flushInk'), and a recorded conflict resolution can't carry the fix.

How

Testing

  • bun run lint: clean; it fails on the merge alone.
  • The test passes, and next rebuilds with lint and the full suite passing once this branch is listed.

The line editor and color menu tests slept a fixed 25ms after rendering
and after each key, then asserted. Ink redraws, and React re-attaches
Ink's input listener, on their own schedule. On a loaded machine the
assertion ran before the redraw, or the next key reached the listener
left from before the last redraw and was applied to the old state.
Under load these tests failed intermittently, the number style and
label tests most often.

Each wait now retries until the key's visible effect shows (the row's
new suffix, the label editor's draft, the picker's search text, the
moved highlight), then yields two setImmediate turns before the next
key, through the shared helper in src/tui/__tests__/helpers/wait-for-ink.ts.
Assertions that only restated a wait move into it; the rest are
unchanged.
…olors test

The line and color editor tests no longer sleep a fixed 25ms after each
render and key. They wait for the key's visible effect, and the sleep
helper flushInk is gone. The color menu test that checks the note for a
widget that sets some of its own colors still called flushInk after the
first render, so it no longer compiled. It now waits until the frame
shows the Thinking Effort row, then reads that frame as before.
…or-menu

# Conflicts:
#	docs/USAGE.md
#	src/tui/App.tsx
#	src/tui/__tests__/App-dev-reload.test.ts
#	src/tui/components/ItemsEditor.tsx
#	src/tui/components/__tests__/ItemsEditor.test.ts
#	src/utils/renderer.ts
#	src/widgets/SessionUsage.ts
#	src/widgets/__tests__/ThinkingEffort.test.ts
#	src/widgets/shared/usage-display.ts
#	src/widgets/shared/usage-percent-widget.ts
@eric-engberg
eric-engberg changed the base branch from test/wait-for-ink-keys to feat/model-family-colors November 6, 2026 01:02
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@eric-engberg

Copy link
Copy Markdown
Owner Author

Superseded: this fix reached main with sirmalloc#777.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant