Repository navigation
feat(tui): color the git branch icon when the workspace is dirty or unpushed - #1164
Merged
Merged
Conversation
…npushed
Adds GitStatusResolvedEvent and fetchGitStatusCmd following the PR-fetch
pattern: git status --porcelain and rev-list --count @{u}..HEAD run off the
UI goroutine on Init, bash completion, and every tool completion. The input
box top border renders the branch icon in the warning color when the tree
has uncommitted changes, accent when only unpushed commits exist, and the
default status color when clean. Outside a repo nothing runs or renders.
Closes #1157
This reverts commit 7853e99.
One background goroutine in cmd/chat pushes agentdomain.HeartbeatEvent through the UI notifier every 10 seconds. It is the only clock feeding the Update loop, so periodic freshness checks subscribe to it instead of re-arming private tea.Ticks (the pattern PR #700 removed). The input view uses it to refetch git status for changes made outside the TUI; the git call stays in a tea.Cmd and is skipped entirely when the git_branch indicator is disabled.
Contributor
|
🎉 This PR is included in version 0.188.0 🎉 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.
Closes #1157
tui.GitStatusResolvedEvent{Dirty, Unpushed}andfetchGitStatusCmd(mirrorsfetchGitPRCmd, usesutils.RunGit).Init,BashCommandCompletedEvent, everyToolExecutionCompletedEvent(PR refetch stays gated on Bash), and the new app heartbeat.runUIHeartbeatincmd/chatpushesagentdomain.HeartbeatEventthrough the UI notifier every 10s (constants.UIHeartbeatInterval) and stops on context cancel. It is the one clock feeding Update, in line with refactor(tui): single event-loop ingress - one notifier, no self-rescheduling pollers #700's no-self-rearming-ticks design; components that need periodic freshness subscribe to it. Handlers only return atea.Cmd, no inline I/O.RenderInputFieldtakes aniconColor; only the leading⎇rune is colored, applied after truncation so long branch names and the PR number behave as before.git statusfails, zero event returned,rev-listskipped, nothing rendered.git_branch: falseskips the git process entirely.input_view_test.go,provider_test.go,cmd/chat/heartbeat_test.go; docs updated.