Skip to content

Conversation

@RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Sep 2, 2025

Description

Shows git branch if available
Prioritizes branch over owner/repo on smaller widths
CON-3746

image image image

Summary by cubic

Show the current git branch in the CLI status bar. On narrow terminals, the branch is prioritized over owner/repo; falls back to repo or cwd. Addresses CON-3746.

  • New Features

    • ResponsiveRepoDisplay renders repo/branch based on terminal width.
    • Display order: "owner/repo ⊦branch" if it fits → branch → repo → nothing; non-git shows cwd. Remote URL override supported.
    • Added getGitBranch plus getRepoInfo/getResponsiveRepoText helpers.
    • Truncation added to the UpdateNotification label to prevent overflow.
    • Unit and E2E tests cover branch detection, detached HEAD, special chars, and formatting.
  • Refactors

    • TUIChat now passes remoteUrl to BottomStatusBar; removed precomputed repoURLText.
    • Added a minimal TUI spec for cwd/git display.

@RomneyDa RomneyDa requested a review from a team as a code owner September 2, 2025 22:01
@RomneyDa RomneyDa requested review from tingwai and removed request for a team September 2, 2025 22:01
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 2, 2025
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

⚠️ AI review completed but no review output was generated. Check the action logs for details.


💡 To request a new review, comment @continue-general-review

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

6 issues found across 10 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

// Since we can't easily mock git commands in this test environment,
// we just test that the function returns either a string or null
const result = getGitBranch();
expect(typeof result === "string" || result === null).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Assertion is too weak and effectively tautological for a string | null return type; consider mocking git/execSync to assert specific outcomes (e.g., branch string in repo, null on failure).

Prompt for AI agents
Address the following comment on extensions/cli/src/util/git.test.ts at line 83:

<comment>Assertion is too weak and effectively tautological for a string | null return type; consider mocking git/execSync to assert specific outcomes (e.g., branch string in repo, null on failure).</comment>

<file context>
@@ -74,4 +74,13 @@ describe(&quot;git utilities - GitHub Actions detection&quot;, () =&gt; {
+      // Since we can&#39;t easily mock git commands in this test environment,
+      // we just test that the function returns either a string or null
+      const result = getGitBranch();
+      expect(typeof result === &quot;string&quot; || result === null).toBe(true);
+    });
+  });
</file context>

tingwai
tingwai previously approved these changes Sep 5, 2025
Copy link
Contributor

@tingwai tingwai left a comment

Choose a reason for hiding this comment

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

Nice touch with checking screen width so we don't try to fit too much if its not wide enough

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 5, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 5, 2025
@sestinj sestinj merged commit 4e061ac into main Sep 9, 2025
56 checks passed
@sestinj sestinj deleted the dallin/cli-git-branch branch September 9, 2025 04:22
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Sep 9, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2025
@github-actions github-actions bot added the tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys label Sep 9, 2025
@sestinj
Copy link
Contributor

sestinj commented Sep 11, 2025

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:XL This PR changes 500-999 lines, ignoring generated files. tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants