Repository navigation
refactor(tui): remove unreachable view checks and stale ponytail markers - #1922
Merged
Merged
Conversation
isInputBlocked's trailing DiffViewer, Explorer and Help operands were dead - every non-chat view already satisfied the first operand. Replace the deferred-shortcut markers on isInputBlocked and inspectPluginHooks with doc comments that match the code.
inference-gateway-maintainer
Bot
marked this pull request as ready for review
November 20, 2026 14:56
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
November 20, 2026 14:56
Closed
4 tasks
Contributor
|
🎉 This PR is included in version 0.265.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1921
no docs ticket: internal-only refactor
Summary
isInputBlockedcarried three operands that could never change its result: each of DiffViewer, Explorer and Help already makescurrentView != tui.ViewStateChattrue, and in the chat view those equality checks were trivially false. This drops the dead operands, and replaces two stale ponytail shortcut markers whose code outgrew them with short doc comments that state what the code actually does. Behavior is unchanged, so no tests needed updating.Changes
internal/presentation/tui/app/chat.go: remove the unreachable|| currentView == tui.ViewStateDiffViewer || currentView == tui.ViewStateExplorer || currentView == tui.ViewStateHelpoperands -currentView != tui.ViewStateChatalone blocks every non-chat viewinternal/presentation/tui/app/chat.go: replace the// ponytail: extracted to reduce cyclomatic complexity of handleViewSpecificMessagesmarker with a doc comment listing what blocks input (non-chat view, pending approval, plan approval or user question, retry, teleport, message-history mode) - the predicate is now shared byhandleViewSpecificMessages,CanRequestSuggestionand tests, not an extraction of one functioninternal/plugins/installer.go: drop theponytail: extracted to reduce nestif complexity in Inspect. / ceiling: none / upgrade:marker and state in one line whatinspectPluginHooksreturnsVerification
go test ./internal/presentation/tui/app ./internal/pluginspassestask precommit:runpasses (mod tidy, mocks, fmt, gofmt/gci imports, golangci-lint, markdownlint)