Skip to content

refactor(tui): remove unreachable view checks and stale ponytail markers - #1922

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-1921
Nov 20, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-1921

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #1921

no docs ticket: internal-only refactor

Summary

isInputBlocked carried three operands that could never change its result: each of DiffViewer, Explorer and Help already makes currentView != tui.ViewStateChat true, 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.ViewStateHelp operands - currentView != tui.ViewStateChat alone blocks every non-chat view
  • internal/presentation/tui/app/chat.go: replace the // ponytail: extracted to reduce cyclomatic complexity of handleViewSpecificMessages marker 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 by handleViewSpecificMessages, CanRequestSuggestion and tests, not an extraction of one function
  • internal/plugins/installer.go: drop the ponytail: extracted to reduce nestif complexity in Inspect. / ceiling: none / upgrade: marker and state in one line what inspectPluginHooks returns

Verification

  • go test ./internal/presentation/tui/app ./internal/plugins passes
  • task precommit:run passes (mod tidy, mocks, fmt, gofmt/gci imports, golangci-lint, markdownlint)

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.
@github-project-automation github-project-automation Bot moved this to Todo in 2026 Nov 20, 2026
@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review November 20, 2026 14:56
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner November 20, 2026 14:56
@edenreich
edenreich merged commit 1562192 into main Nov 20, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1921 branch November 20, 2026 15:35
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.265.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 20, 2026
@edenreich edenreich moved this from Todo to Done in 2026 Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[TASK] Refactor isInputBlocked to drop unreachable view checks and stale ponytail markers

1 participant