-
Notifications
You must be signed in to change notification settings - Fork 491
feat(ui): generate meaningful worktree branch names from feature titles #655
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
feat(ui): generate meaningful worktree branch names from feature titles #655
Conversation
Instead of generating random branch names like `feature/main-1737547200000-tt2v`, this change creates human-readable branch names based on the feature title: `feature/add-user-authentication-a3b2` Changes: - Generate branch name slug from feature title (lowercase, alphanumeric, hyphens) - Use 4-character random suffix for uniqueness instead of timestamp - If no title provided, generate one from description first (for auto worktree mode) - Fall back to 'untitled' if both title and description are empty - Fix: Apply substring limit before removing trailing hyphens to prevent malformed branch names when truncation occurs at a hyphen position This makes it much easier to identify which worktree corresponds to which feature when working with multiple features simultaneously. Closes AutoMaker-Org#604
Summary of ChangesHello @stefandevo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience by revamping the worktree branch naming convention. Instead of generic, timestamp-based names, branches are now derived from feature titles, making them more descriptive and easier to understand at a glance. The changes also introduce intelligent title generation from descriptions when a title is absent, ensuring that meaningful branch names are consistently created, along with robust handling of edge cases for empty inputs and proper slug formatting. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe change updates branch and title generation logic in the board actions hook to auto-generate feature titles from descriptions when work mode is 'auto' and replace timestamp-based branch naming with slug-based naming derived from generated or provided titles, while propagating generated titles to the feature. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a great enhancement by generating human-readable branch names from feature titles, which significantly improves developer experience. The implementation is robust, handling various edge cases like empty titles, long titles, and special characters. My review focuses on improving maintainability by addressing code duplication. I've identified two blocks of logic that are repeated in handleAddFeature and handleUpdateFeature and could be extracted into shared helper functions. These changes would make the code more DRY and easier to maintain in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/ui/src/components/views/board-view/hooks/use-board-actions.ts`:
- Around line 351-363: The auto-branch generation always overwrites an existing
branch; modify the logic in use-board-actions (around
finalBranchName/titleForBranch) to first check if updates.branchName is present
and, if so, preserve it instead of generating a new name; i.e., only run the
slug + randomSuffix generation for finalBranchName when workMode === 'auto' AND
updates.branchName is falsy, otherwise set finalBranchName = updates.branchName
(or undefined) to avoid creating a new worktree and orphaning the original
branch.
apps/ui/src/components/views/board-view/hooks/use-board-actions.ts
Outdated
Show resolved
Hide resolved
…ures When editing a feature that already has a branch name assigned, preserve it instead of generating a new one. This prevents orphaning existing worktrees when users edit features in auto worktree mode.
Summary
This PR reimplements the meaningful worktree names feature from #604, addressing all review feedback.
Instead of generating random branch names like
feature/main-1737547200000-tt2v, this change creates human-readable branch names based on the feature title:feature/add-user-authentication-a3b2Changes
Review Comments Addressed
From the original PR #604 reviews:
|| 'untitled'fallback.substring(0, 50)now before.replace(/^-|-$/g, '')Example
Before:
After:
Test plan
Closes #604
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.