Skip to content

Conversation

@stefandevo
Copy link
Collaborator

@stefandevo stefandevo commented Jan 22, 2026

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-a3b2

Changes

  • Meaningful branch names: Generate branch name slug from feature title (lowercase, alphanumeric, hyphens)
  • Shorter suffix: Use 4-character random suffix for uniqueness instead of timestamp
  • Title generation: If no title provided in auto worktree mode, generate one from description first
  • Fallback handling: Fall back to 'untitled' if both title and description are empty
  • Bug fix from review: Apply substring limit (50 chars) before removing trailing hyphens to prevent malformed branch names when truncation occurs at a hyphen position

Review Comments Addressed

From the original PR #604 reviews:

Comment Status
[CodeRabbit] Edge case: empty title/description ✅ Handled via || 'untitled' fallback
[Gemini HIGH] Substring order causing trailing hyphens ✅ Fixed - .substring(0, 50) now before .replace(/^-|-$/g, '')
[Gemini HIGH] Missing background title gen in update ⏭️ Intentionally different - CREATE auto-generates, UPDATE respects user choice
[Gemini MEDIUM] DRY principle violation ⏭️ Skipped - only 2 places, clear code, minimal benefit from abstraction

Example

Before:

feature/main-1737547200000-tt2v
feature/main-1737547300000-x9kp

After:

feature/add-user-authentication-a3b2
feature/fix-login-validation-x9kp

Test plan

  • Create a new feature with auto worktree mode and verify branch name is based on title
  • Create a feature without title (only description) and verify title is generated for branch name
  • Create a feature with a very long title (>50 chars) and verify branch name is properly truncated without trailing hyphens
  • Create a feature with special characters in title and verify they're converted to hyphens
  • Update an existing feature to auto worktree mode and verify branch name generation works

Closes #604

Summary by CodeRabbit

  • New Features

    • Automatic title generation from descriptions when using auto work mode, including on updates.
  • Improvements

    • New slug-based branch naming for clearer, more consistent branch names.
    • Generated titles now propagate to feature titles and are computed in background with progress indication.
    • More reliable branch/worktree creation and consistent behavior across add/update flows.

✏️ Tip: You can customize this high-level summary in your review settings.

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
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Meaningful Branch Names: Worktree branch names are now generated from feature titles, replacing the previous timestamp-based naming convention with human-readable slugs.
  • Improved Uniqueness Suffix: The branch name uniqueness suffix has been shortened to a 4-character random string, replacing the longer timestamp.
  • Dynamic Title Generation: If a feature title is not provided in 'auto' worktree mode, a title will be generated from the feature's description for use in the branch name. A fallback to 'untitled' is in place if both title and description are empty.
  • Robust Slugification: The branch name slug generation now correctly handles truncation (limiting to 50 characters) before removing leading/trailing hyphens, preventing malformed branch names.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

 ___________________________________________________________________________________________________________
< Childhood dream: become a code reviewer. Adult reality: became a code reviewer. Childhood dream achieved. >
 -----------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

✏️ 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 reviews.request_changes_workflow setting in your project's settings in CodeRabbit to automatically approve the review once all CodeRabbit's comments are resolved.

Note

Other AI code review bot(s) detected

CodeRabbit 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.

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Branch and Title Generation Logic Update
apps/ui/src/components/views/board-view/hooks/use-board-actions.ts
Refactored auto branch naming from timestamp-based to slug-derived approach; added auto-title generation via Electron API when workMode is 'auto'; introduced titleGenerating flag and needsTitleGeneration tracking; updated both feature add and update flows to generate title, compute slug-based branch name (feature/{titleSlug}-{randomSuffix}), and propagate generated titles; updated worktree creation integration and removed getPrimaryWorktreeBranch dependencies

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • worktree-select #182: Modifies the same use-board-actions hook and feature add/update/worktree creation flows, with changes to onWorktreeAutoSelect callback integration that complement the branch-title/branch-name generation updates.
  • feat: add auto-generated titles for features #184: Implements the same auto-generated feature title flow using titleGenerating flag and generateTitle API, directly aligned with the title generation logic in this PR.

Suggested labels

Enhancement

Poem

🐰 Hop along with slugified names,
Where titles dance and branches proclaim,
No timestamps needed, just words so fine,
Electron whispers, "This title is thine!"
Auto-mode magic, a feature's refrain! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: generating meaningful worktree branch names from feature titles, which aligns perfectly with the changeset's primary objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link

@coderabbitai coderabbitai bot left a 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.

…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.
@stefandevo stefandevo added the Testers-Requested Request for others to test an enhancement or bug fix/etc. label Jan 22, 2026
@stefandevo stefandevo merged commit c65f931 into AutoMaker-Org:v0.14.0rc Jan 23, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testers-Requested Request for others to test an enhancement or bug fix/etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant