Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Branch Creation UX and Refactor Issue Branch Management #6278

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

amrshadid
Copy link

@amrshadid amrshadid commented Oct 13, 2024

This PR introduces significant improvements to the branch creation and management process, focusing on enhancing the user experience and refactoring the existing code for better maintainability and performance. Key changes include:

  • Branch Selection UI Overhaul:

    • Introduced a QuickPick interface for selecting branches, allowing users to choose from existing local/remote branches or create a new one.
    • Visually highlighted branches related to the issue (e.g., branches containing the issue number).
    • Provided a custom branch name option directly in the selection UI for flexible branch creation.

Some Related Issues:

  • #2243: Detect and use already-linked PR branches when starting work on an issue.
  • #4120: Detect branch names referencing an issue and automatically start working on them.
  • #4509: Improve transparency when creating and checking out branches for issues.

These issues are addressed by improving the branch selection experience, handling remote branches more seamlessly, and enhancing error feedback.

Testing and Verification:

  • Manual Testing:

    • Verified that the QuickPick interface correctly displays existing branches and suggested branch names.
    • Tested creation and checkout of local and remote branches.
    • Confirmed proper upstream tracking for remote branches.
    • Ensured that validation errors (e.g., invalid branch names) display appropriate messages.

- Implemented a `QuickPick` menu for smoother branch selection and creation process.
- Highlighted suggested branch names with visual cues for better user experience.
- Enhanced handling of remote branches, ensuring upstream is set automatically when needed.
- Removed unnecessary methods (`offerNewBranch`, `getBranchTitle`) to simplify code and improve maintainability.
- Improved branch name validation and error messages to provide more helpful feedback.
@amrshadid
Copy link
Author

@microsoft-github-policy-service agree

Copy link

@nightscorn nightscorn left a comment

Choose a reason for hiding this comment

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

cxc

Copy link

@nightscorn nightscorn left a comment

Choose a reason for hiding this comment

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

ujghm

Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! It looks like there are a lot of changes in here that aren't strictly related to the feature you're adding, which makes it slow to review. Could you please remove these changes? I've also left a few other comments.

src/issues/currentIssue.ts Show resolved Hide resolved
src/issues/currentIssue.ts Show resolved Hide resolved
amrshadid and others added 2 commits October 18, 2024 17:38
- Refactored getBranchTitle() to correctly apply the ISSUE_BRANCH_TITLE setting by using variableSubstitution().
- Improved handling of the silent flag.
- Cleaned up unrelated code changes.
@amrshadid
Copy link
Author

@alexr00 Thanks for the feedback! I’ve addressed the specific comments and focused on ensuring the necessary changes related to the feature.

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.

3 participants