[PR #692] [MERGED] fix(tui): optimistic rendering #9679

Closed
opened 2026-02-16 18:13:58 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/692
Author: @timoclsn
Created: 7/4/2025
Status: Merged
Merged: 7/4/2025
Merged by: @adamdotdevin

Base: devHead: fix-optimistic-rendering


📝 Commits (1)

📊 Changes

1 file changed (+3 additions, -5 deletions)

View changed files

📝 packages/tui/internal/components/chat/messages.go (+3 -5)

📄 Description

The optimistic update mechanism had delays when displaying user input messages. Sometimes there would be a long delay before the user's message appeared after hitting enter.

  • The OptimisticMessageAddedMsg handler called m.renderView(m.width) synchronously, which could block the UI.
  • Changed the handler to use asynchronous rendering like other parts of the codebase:

This ensures the first thing that happens when a user hits enter is that their message gets rendered immediately, providing instant feedback.

Closes #686


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/692 **Author:** [@timoclsn](https://github.com/timoclsn) **Created:** 7/4/2025 **Status:** ✅ Merged **Merged:** 7/4/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `fix-optimistic-rendering` --- ### 📝 Commits (1) - [`6cbc5c5`](https://github.com/anomalyco/opencode/commit/6cbc5c57574b9d79ff00c9d3b44edb45d16c10f3) Fix optimistic rendering ### 📊 Changes **1 file changed** (+3 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/tui/internal/components/chat/messages.go` (+3 -5) </details> ### 📄 Description The optimistic update mechanism had delays when displaying user input messages. Sometimes there would be a long delay before the user's message appeared after hitting enter. - The `OptimisticMessageAddedMsg` handler called `m.renderView(m.width)` synchronously, which could block the UI. - Changed the handler to use asynchronous rendering like other parts of the codebase: This ensures the first thing that happens when a user hits enter is that their message gets rendered immediately, providing instant feedback. Closes #686 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:58 -05:00
yindo closed this issue 2026-02-16 18:13:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9679