Skip to content

Keep Kilo Console terminals stable during refresh#10833

Merged
catrielmuller merged 2 commits into
mainfrom
worried-crabapple
Jun 2, 2026
Merged

Keep Kilo Console terminals stable during refresh#10833
catrielmuller merged 2 commits into
mainfrom
worried-crabapple

Conversation

@catrielmuller

@catrielmuller catrielmuller commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue.

Context

Kilo Console briefly tears down the active terminal and replaces the changes panel with a loading state when project snapshots refresh after worktree changes or resize-related PTY updates. The console also logs a warning when it receives sync events in the newer syncEvent envelope instead of the legacy name shape.

Implementation

Terminal frames are already keyed by stable PTY identity in the outer list, so the inner Show no longer uses the freshly allocated query object as a keyed boundary. That keeps the existing Ghostty instance mounted while snapshot data refreshes. The changes panel now only renders its loading placeholder before the first diff result exists, preserving the prior diff during background refreshes. The route event parser also accepts both legacy name and newer syncEvent.type sync events, treating unknown envelopes as non-actionable instead of throwing.

Screenshots / Video

N/A - behavior-only flicker fix; no visual redesign.

image

How to Test

Manual/local verification

  • Agent: bun run typecheck from packages/kilo-console/
  • Agent: bun test src from packages/kilo-console/
  • Agent: bun turbo typecheck passed via the normal pre-push hook

Reviewer test steps

  1. Start a local backend with bun dev serve --port 4096 --hostname 127.0.0.1 --cors http://127.0.0.1:3017 from the repo root.
  2. Start the console with bun run dev from packages/kilo-console/.
  3. Open a project with an active terminal, then edit a file in the selected worktree or resize the browser window.
  4. Confirm the terminal remains visible and the changes panel keeps the previous diff visible while refreshes complete.

Blocked checks and substitute verification

  • None.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@kilo-code-bot

kilo-code-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The three behavioral changes are all correct:

  1. Show keying removal (ProjectConsoleRoute.tsx:705) — Removing keyed prevents GhosttyTerminal from being torn down and re-mounted when the input() memo changes value (e.g. on snapshot refresh). The inner render function receives target as a SolidJS accessor, so target() at line 716 correctly dereferences it when constructing the Query prop. Since the terminal is already de-duplicated by stable PTY key in the outer For, removing the keyed boundary is the right call.

  2. Diff loading guard (ProjectConsoleRoute.tsx:757) — diffs.loading && !diffs() correctly suppresses the "Loading diff…" placeholder during background refreshes (when previous data already exists), while still showing it on the initial load when no data is present yet. The downstream "No changes detected" check at line 763 already guards with !diffs.loading, so neither placeholder flashes during a refresh.

  3. eventType hardening (ProjectConsoleRoute.tsx:91-98) — Gracefully handles both legacy name and newer syncEvent.type sync envelope shapes, and treats unknown/missing envelopes as a no-op ("") rather than propagating undefined. The as cast is an acceptable escape hatch for an opaque external payload.

Files Reviewed (5 files)
  • packages/kilo-console/src/routes/projects/ProjectConsoleRoute.tsx
  • packages/kilo-console/index.html
  • packages/kilo-console/public/favicon.svg
  • .changeset/console-diff-refresh.md
  • .changeset/console-favicon.md

Reviewed by claude-4.6-sonnet-20260217 · 846,864 tokens

Review guidance: REVIEW.md from base branch main

@catrielmuller catrielmuller merged commit 5e7e158 into main Jun 2, 2026
18 of 20 checks passed
@catrielmuller catrielmuller deleted the worried-crabapple branch June 2, 2026 21:07
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.

2 participants