Skip to content

fix(ui-tui): redraw after session resume - #62187

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/62170-tui-session-redraw
Closed

LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/62170-tui-session-redraw

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • force a full Ink redraw on the immediate resume snap after switching TUI sessions
  • keep the resume scroll helper isolated in a small module with focused coverage
  • preserve the existing sticky follow-up snaps while fixing the stale first paint

Testing

  • ./node_modules/.bin/vitest run src/app/sessionResumeView.test.ts
  • ./node_modules/.bin/eslint src/app/useSessionLifecycle.ts src/app/sessionResumeView.ts src/app/sessionResumeView.test.ts
  • ./node_modules/.bin/esbuild src/app/sessionResumeView.ts --bundle --platform=node --format=esm --external:@hermes/ink --external:react >/dev/null
  • ./node_modules/.bin/esbuild src/app/sessionResumeView.test.ts --bundle --platform=node --format=esm --external:vitest --external:@hermes/ink >/dev/null
  • git diff --check

Closes #62170

@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 10, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating the stale first-paint path and reusing the existing Ink redraw primitive.

Problems

  • The Closes #62170 linkage is broader than this implementation. The helper is scheduled only after activation/resume (ui-tui/src/app/useSessionLifecycle.ts:322, :376), while #62170 separately reports normal live assistant responses staying invisible and says /redraw does not fix that symptom. This change cannot run for those later stream updates.

Suggested changes

  • Keep this focused stale-resume repaint fix, but remove Closes #62170 or split the unresolved live-update symptom into a follow-up.

Automated hermes-sweeper review.

if (!manuallyScrolledAfterResume && (index === 0 || scroll.isSticky())) {
scroll.scrollToBottom()

if (index === 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repaint is intentionally limited to the first resume snap. Since #62170 also reports a live-stream freeze after the resume completes, please avoid closing that entire issue with this PR unless that remaining symptom is split into a follow-up.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 11, 2026
@teknium1 teknium1 added the area/sessions Session lifecycle, resume, persistence, history label Jul 19, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Merged via PR #86332 as part of the stale-repaint class fix (TUI focus regain / session resume / dashboard PTY reattach). Your commit was cherry-picked onto current main with your authorship preserved in git log. Thank you!

@teknium1 teknium1 closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TUI shows stale session content after switching sessions (v0.18.1)

3 participants