Skip to content

fix(desktop): use consistent branch sanitization in NewWorkspaceModal#1557

Merged
Kitenite merged 1 commit into
mainfrom
kitenite/anatosaurus
Feb 18, 2026
Merged

fix(desktop): use consistent branch sanitization in NewWorkspaceModal#1557
Kitenite merged 1 commit into
mainfrom
kitenite/anatosaurus

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 18, 2026

Summary

  • Aligns the title-to-branch auto-generation logic with the manual branch name input by using sanitizeBranchName instead of sanitizeSegment
  • Both paths now apply the same linting/sanitization, preserving slash-separated segments (e.g. feature/my featurefeature/my-feature)

Changes

  • NewWorkspaceModal.tsx: Changed generateSlugFromTitle to use sanitizeBranchName instead of sanitizeSegment
  • Removed unused sanitizeSegment import

Test Plan

  • Create a workspace with a title containing / (e.g. feature/login fix) — branch preview should show feature/login-fix
  • Create a workspace with a simple title (e.g. fix login bug) — branch preview should show fix-login-bug (unchanged behavior)
  • Manually edit the branch name — should still work as before

Summary by CodeRabbit

  • Refactor
    • Updated workspace slug generation logic to use an improved sanitization method.

…n NewWorkspaceModal

Use the same branch sanitization logic for both auto-generated (from title)
and manually-edited branch names. Previously, title used sanitizeSegment
which strips slashes, while manual input used sanitizeBranchName which
preserves slash-separated segments.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR updates the slug generation logic in NewWorkspaceModal.tsx by replacing the sanitizeSegment utility with sanitizeBranchName. The change affects only the import statements and the generateSlugFromTitle function implementation, with no modifications to control flow or public API signatures.

Changes

Cohort / File(s) Summary
Slug Generation Utility Update
apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx
Replaced sanitizeSegment with sanitizeBranchName in the slug generation helper function. Removed sanitizeSegment import and updated generateSlugFromTitle to invoke sanitizeBranchName instead.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰✨ A slug by another name sanitizes just as sweet,
Branch names now flow with sanitizeBranchName neat!
One import out, one utility swapped with care,
Modal slugs dance through the fresh air! 🌿

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/anatosaurus

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.

@Kitenite Kitenite merged commit f48ec9f into main Feb 18, 2026
4 of 6 checks passed
@Kitenite Kitenite deleted the kitenite/anatosaurus branch February 18, 2026 06:37
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app
  • ⚠️ Streams Fly.io app

Thank you for your contribution! 🎉

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