Yoel and Cursor
d1ccfcff40
fix(settings): normalize and validate branch prefixes ( #7772 )
...
* Normalize branch prefixes and flag invalid ones in settings
A custom branch prefix ending in a slash (e.g. "team/") produced a
double-slashed branch name like "team//feature" that git rejects, and
the raw check-ref-format error gave no hint that the prefix caused it.
- Normalize the configured prefix (trim whitespace, strip leading/
trailing and duplicate slashes) in the shared branch-name builder so
the common trailing-slash case just works, for local and SSH worktrees.
- Validate the prefix on the worktree-create path (computeValidatedBranchName)
so a genuinely invalid prefix fails fast with a clear
"update it in Settings -> Git" message instead of an opaque git error.
- Add a live BranchPrefixFeedback under the Branch Prefix setting: previews
the resulting branch name, warns on invalid characters, and notes when a
prefix collapses to none.
- Keep the background first-work rename on the non-throwing builder since the
prefix is already validated at create time.
* Keep caret in place when editing the branch prefix
The custom branch prefix input was directly controlled by settings, but
updateSettings persists through an async IPC round-trip, so the value
updated a tick late and React re-assigned it, snapping the caret to the
end on mid-string edits. Drive the input from a local draft and only
adopt genuine external settings changes so the caret stays put (and fast
typing survives slow SSH round-trips).
Co-authored-by: Cursor <cursoragent@cursor.com >
* Return ReactNode from BranchPrefixFeedback
JSX.Element needlessly excludes null/string/number returns; ReactNode
keeps the component's return type from over-constraining future changes.
Co-authored-by: Cursor <cursoragent@cursor.com >
---------
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-24 00:39:32 -07:00
..
2026-07-24 00:39:32 -07:00
2026-07-24 00:26:11 -07:00
2026-07-23 18:35:31 -07:00
2026-07-13 00:26:22 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 23:48:07 -07:00
2026-07-22 11:42:34 -07:00
2026-07-24 00:25:35 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-13 00:26:22 -07:00
2026-07-23 18:35:31 -07:00
2026-07-13 00:26:22 -07:00
2026-07-23 18:35:31 -07:00
2026-07-20 03:18:28 -07:00
2026-07-24 00:29:23 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-05-16 14:36:46 -07:00
2026-07-13 00:26:22 -07:00
2026-07-23 18:35:31 -07:00
2026-07-20 03:18:28 -07:00
2026-07-23 18:35:31 -07:00
2026-07-24 00:26:34 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 23:20:52 -07:00
2026-07-23 18:35:31 -07:00
2026-07-13 00:26:22 -07:00
2026-07-10 00:11:27 -07:00
2026-07-23 18:35:31 -07:00
2026-07-12 23:43:07 -07:00
2026-07-24 00:39:32 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-19 21:31:36 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-05-30 02:46:28 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 19:05:22 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-24 00:27:40 -07:00
2026-07-23 18:35:31 -07:00
2026-07-24 00:25:35 -07:00
2026-07-24 00:39:32 -07:00
2026-07-21 18:23:20 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-05-30 13:26:48 -07:00
2026-07-24 00:24:53 -07:00
2026-06-29 22:38:29 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-20 03:18:24 -07:00
2026-07-23 18:35:31 -07:00
2026-07-17 18:50:21 -07:00
2026-07-23 18:35:31 -07:00
2026-07-24 00:36:18 -07:00
2026-07-20 01:14:17 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-06-17 16:20:37 -07:00
2026-06-17 16:20:37 -07:00
2026-05-18 14:09:21 -07:00
2026-05-18 14:09:21 -07:00
2026-05-18 14:09:21 -07:00
2026-07-23 06:22:56 -07:00
2026-07-23 06:22:56 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-06-22 18:01:37 -07:00
2026-06-22 18:01:37 -07:00
2026-07-17 15:27:39 -07:00
2026-07-17 15:27:39 -07:00
2026-05-15 23:52:37 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-07-22 17:17:59 -07:00
2026-07-22 17:17:59 -07:00
2026-05-30 15:26:11 -04:00
2026-06-29 22:38:29 -07:00
2026-07-16 23:10:40 -07:00
2026-06-19 17:14:55 -07:00
2026-06-29 22:38:29 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-24 00:26:25 -07:00
2026-07-23 18:35:31 -07:00
2026-05-30 09:04:52 -07:00
2026-05-30 09:04:52 -07:00
2026-07-18 23:01:29 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-13 01:10:38 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-10 17:52:50 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-06 16:43:05 -07:00
2026-07-06 16:43:05 -07:00
2026-05-30 09:04:52 -07:00
2026-05-30 09:04:52 -07:00
2026-07-20 19:47:58 -07:00
2026-07-24 00:25:26 -07:00
2026-07-24 00:25:26 -07:00
2026-06-24 00:17:49 -07:00
2026-06-24 00:17:49 -07:00
2026-06-17 16:08:14 -07:00
2026-07-13 01:10:38 -07:00
2026-07-24 00:27:40 -07:00
2026-07-24 00:27:40 -07:00
2026-06-24 21:07:15 -04:00
2026-06-29 22:38:29 -07:00
2026-07-23 18:03:43 -07:00
2026-07-23 18:03:43 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-06-24 19:19:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-06-29 22:38:29 -07:00
2026-07-09 16:24:20 -07:00
2026-07-09 16:24:20 -07:00
2026-07-20 14:34:53 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-06-21 18:51:44 -07:00
2026-07-14 01:55:04 -07:00
2026-07-10 17:27:47 -07:00
2026-07-10 17:27:47 -07:00
2026-05-21 21:52:26 -07:00
2026-05-21 21:52:26 -07:00
2026-05-21 21:52:26 -07:00
2026-05-21 21:52:26 -07:00
2026-07-06 20:21:58 -07:00
2026-07-06 20:21:58 -07:00
2026-07-07 12:43:53 -07:00
2026-07-07 12:43:53 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-09 02:13:13 -07:00
2026-07-11 21:03:04 -07:00
2026-07-11 21:03:04 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-21 17:44:40 -07:00
2026-07-22 18:52:37 -07:00
2026-07-17 15:27:39 -07:00
2026-07-17 15:27:39 -07:00
2026-07-09 23:00:01 -07:00
2026-05-30 13:09:17 -07:00
2026-07-23 18:35:31 -07:00
2026-05-27 00:47:01 -07:00
2026-07-05 02:53:17 -07:00
2026-07-23 18:35:31 -07:00
2026-07-06 15:12:56 -07:00
2026-05-26 20:56:11 -07:00
2026-07-22 18:52:37 -07:00
2026-07-09 23:00:01 -07:00
2026-07-21 17:44:40 -07:00
2026-07-22 18:52:37 -07:00
2026-05-31 10:11:51 -07:00
2026-05-31 10:11:51 -07:00
2026-06-29 22:38:29 -07:00
2026-07-11 02:03:14 -07:00
2026-07-09 22:37:40 -04:00
2026-07-11 02:03:14 -07:00
2026-07-24 00:27:40 -07:00
2026-07-24 00:27:40 -07:00
2026-05-30 11:01:09 -07:00
2026-07-23 19:00:00 -07:00
2026-07-23 19:00:00 -07:00
2026-07-11 02:05:58 -07:00
2026-07-04 21:31:51 -07:00
2026-07-04 21:31:51 -07:00
2026-06-29 18:02:10 -07:00
2026-06-03 12:25:54 -07:00
2026-06-03 12:25:54 -07:00
2026-07-23 18:35:31 -07:00
2026-07-02 11:24:07 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-05-29 16:06:33 -07:00
2026-07-19 17:31:34 -07:00
2026-07-14 15:23:06 -07:00
2026-06-29 00:32:36 -07:00
2026-06-29 22:38:29 -07:00
2026-07-12 23:19:15 -07:00
2026-07-19 16:04:05 -07:00