Skip to content

feat(desktop): use unique-names-generator for workspace names#252

Merged
Kitenite merged 3 commits intomainfrom
indigo-thunder-33
Dec 4, 2025
Merged

feat(desktop): use unique-names-generator for workspace names#252
Kitenite merged 3 commits intomainfrom
indigo-thunder-33

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Dec 4, 2025

Summary

  • Replace hardcoded adjective/noun word lists with the unique-names-generator library
  • Increases workspace naming variety from ~22,500 combinations to ~490,000+ (1,400 adjectives × 350 animals × 100 numbers)
  • Uses the well-maintained library with TypeScript support

Test plan

  • Create a new workspace and verify it generates a valid branch name in the format {adjective}-{animal}-{number}
  • Verify typecheck passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Git branch names are now generated using an updated naming pattern combining descriptive words with numbers in a lowercase, dash-separated format.

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

Replace hardcoded word lists with the unique-names-generator library for
generating workspace branch names. This increases naming variety from
~22,500 combinations to ~490,000+ (1,400 adjectives × 350 animals × 100
numbers).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Dec 4, 2025 6:24am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 4, 2025

Warning

Rate limit exceeded

@Kitenite has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1d762e4 and 3da9f7f.

📒 Files selected for processing (1)
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/git.ts (1 hunks)

Walkthrough

The changes replace hard-coded adjective and noun arrays in branch name generation with the unique-names-generator library dependency. A new package is added to the desktop app's dependencies, and the git utility function is refactored to use the external library while maintaining its public API.

Changes

Cohort / File(s) Summary
Dependency Addition
apps/desktop/package.json
Added unique-names-generator version ^4.7.1 to project dependencies
Branch Name Generation Refactoring
apps/desktop/src/lib/trpc/routers/workspaces/utils/git.ts
Replaced hard-coded adjective/noun arrays and random selection logic with uniqueNamesGenerator library to produce two-part, lowercase, dash-separated names using adjectives and animals; function signature unchanged

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single dependency addition with standard semantic versioning
  • Straightforward refactoring of internal logic without API changes
  • Homogeneous pattern across limited file set
  • No complex control flow or business logic modifications

Poem

🐰 A library springs forth, with names so grand,
Where adjectives dance with creatures so bland,
No more do we hardcode with toil and with care,
The generator brings uniqueness to share! ✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: replacing hardcoded workspace name generation with the unique-names-generator library.
Description check ✅ Passed The description includes a clear summary, test plan, and addresses the purpose and impact of the change, though it deviates from the template structure by omitting standard sections like Related Issues and Type of Change.

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.

Replace random 2-digit number (100 possibilities) with a 4-character
base64url-encoded random suffix (262,144 possibilities) using Node's
crypto.randomBytes for better collision resistance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use hex encoding (0-9, a-f) instead of base64url to ensure branch names
are fully lowercase. Still provides 16M+ combinations (16^6).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Kitenite Kitenite merged commit ba481d7 into main Dec 4, 2025
7 checks passed
@Kitenite Kitenite deleted the indigo-thunder-33 branch December 4, 2025 06:25
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.

1 participant