Skip to content

Revert "tui: improve tmux experience and simplify keyboard enhancements"#2098

Merged
dgageot merged 1 commit intodocker:mainfrom
gtardif:revert_tui_changes
Mar 13, 2026
Merged

Revert "tui: improve tmux experience and simplify keyboard enhancements"#2098
dgageot merged 1 commit intodocker:mainfrom
gtardif:revert_tui_changes

Conversation

@gtardif
Copy link
Contributor

@gtardif gtardif commented Mar 13, 2026

This reverts commit 552362d.

This was causing weird behaviour in VSCode, with azerty layout, capitalised letters (with Shift on) where using querty ; without shift, lowercase letters using azerty.

@gtardif gtardif requested a review from a team as a code owner March 13, 2026 15:36
This reverts commit 552362d.

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
@gtardif gtardif force-pushed the revert_tui_changes branch from 2ffce2d to f946c5d Compare March 13, 2026 15:37
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Assessment: 🟡 NEEDS ATTENTION

This revert PR removes keyboard enhancement features that were causing issues with VSCode and AZERTY keyboard layouts. The revert itself is mostly clean, but introduces 2 confirmed bugs and 1 likely issue related to incomplete state management of keyboard enhancements.

Key Issues

🔴 CONFIRMED (2 findings):

  1. Chat page lacks keyboard enhancement tracking field (line 260)
  2. View configuration removal may break keyboard enhancement detection (toFullscreenView function)

🟡 LIKELY (1 finding):

  1. Message forwarding may not reach all nested components (line 597)

Details

The revert adds a new keyboardEnhancementsSupported field to track terminal capabilities, but:

  • The chat page component doesn't track this state (unlike the editor component)
  • The view configuration no longer requests keyboard enhancement events, which may prevent the new tracking field from being updated
  • It's unclear if all nested components (especially inline edit textareas) properly receive keyboard enhancement configuration

Recommendation

Consider adding keyboard enhancement state tracking to the chat page component and verifying that the new keyboardEnhancementsSupported field will be properly updated without the view-level KeyboardEnhancements.ReportEventTypes setting.


updated, _ := m.chatPage.Update(*m.keyboardEnhancements)
m.chatPage = updated.(chat.Page)
editorModel, _ := m.editor.Update(*m.keyboardEnhancements)
m.editor = editorModel.(editor.Editor)
Copy link

Choose a reason for hiding this comment

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

🔴 CONFIRMED: Chat page lacks keyboard enhancement tracking

The reapplyKeyboardEnhancements() method forwards the keyboard enhancements message to both the chat page and editor. However, the chat page component (pkg/tui/page/chat/chat.go) does not have a keyboardEnhancementsSupported field like the editor does.

Impact: If the chat page needs to make decisions based on keyboard enhancement support (e.g., keybinding configuration for inline editing), it won't have that information available after reapply.

Recommendation: Consider adding a keyboardEnhancementsSupported field to the chat page component, similar to the editor component.

return m, cmd
return m, tea.Batch(cmd, editorCmd)

// --- Keyboard input ---
Copy link

Choose a reason for hiding this comment

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

🟡 LIKELY: Keyboard enhancements may not reach all nested components

The code forwards KeyboardEnhancementsMsg to both chatPage and editor, then batches the commands. While the forwarding to top-level components is correct, it's unclear whether all nested components that need keyboard enhancement configuration (especially inline edit textareas within the messages component) properly receive and configure their keybindings.

Impact: Some nested UI components may not properly configure keyboard shortcuts that depend on terminal capabilities.

Recommendation: Verify that the messages component and its inline edit textarea properly handle keyboard enhancement messages.

view.KeyboardEnhancements.ReportEventTypes = true
if working {
view.ProgressBar = tea.NewProgressBar(tea.ProgressBarIndeterminate, 0)
}
Copy link

Choose a reason for hiding this comment

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

🔴 CONFIRMED: Removed view config may prevent keyboard enhancement detection

This revert removes view.ReportFocus = true and view.KeyboardEnhancements.ReportEventTypes = true from the view configuration. However, the PR also adds a new keyboardEnhancementsSupported field (line 124) that is set based on received KeyboardEnhancementsMsg messages (line 590).

The problem: If the view no longer requests keyboard enhancement events via KeyboardEnhancements.ReportEventTypes, the terminal may not send KeyboardEnhancementsMsg at all, leaving the new tracking field uninitialized or stale.

Impact: The keyboardEnhancementsSupported field may never be updated, causing the application to incorrectly assume keyboard enhancements are unavailable even when the terminal supports them.

Recommendation: Either keep view.KeyboardEnhancements.ReportEventTypes = true or verify that keyboard enhancement messages are received through another mechanism.

@dgageot dgageot merged commit c42a18a into docker:main Mar 13, 2026
4 checks passed
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