Skip to content

fix(desktop): sanitize manually entered branch names in workspace modal#933

Merged
Kitenite merged 1 commit intosuperset-sh:mainfrom
kkjcheng:fix-invalid-branch-names
Jan 25, 2026
Merged

fix(desktop): sanitize manually entered branch names in workspace modal#933
Kitenite merged 1 commit intosuperset-sh:mainfrom
kkjcheng:fix-invalid-branch-names

Conversation

@kkjcheng
Copy link
Copy Markdown
Contributor

@kkjcheng kkjcheng commented Jan 24, 2026

Summary

  • Apply the same branch name sanitization to manually entered branch names that was already applied to auto-generated names from titles
  • Fixes bug where manually entering a branch name with spaces or special characters would cause worktree creation to fail (git rejects invalid branch names)

Test plan

  • Open New Workspace modal
  • Expand "Advanced options" and manually enter a branch name with spaces (e.g., "my feature branch")
  • Verify it auto-sanitizes to "my-feature-branch" as you type

Apply the same sanitization (spaces to dashes, remove special chars) to
manually entered branch names that was already applied to auto-generated
branch names from titles.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

The handleBranchNameChange function in NewWorkspaceModal is modified to normalize branch input by applying generateBranchFromTitle before updating state, ensuring consistent branch naming rather than accepting raw user input directly.

Changes

Cohort / File(s) Summary
Branch Input Normalization
apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx
Modified handleBranchNameChange to apply generateBranchFromTitle normalization to branch input before state update

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

A rabbit hops through branch names bright, 🐰
Normalizing chaos, setting things right,
From untamed text to formatted delight,
One simple line makes the code tight! ✨

🚥 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
Title check ✅ Passed The title clearly describes the main change: sanitizing manually entered branch names in the workspace modal, which aligns with the code modification.
Description check ✅ Passed The pull request description effectively communicates the fix, provides clear testing steps, and addresses a specific bug. However, it deviates from the repository's template structure.

✏️ 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.

@Kitenite Kitenite merged commit 011f31f into superset-sh:main Jan 25, 2026
5 checks passed
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.

2 participants