worktree-launcher 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +19 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -828,19 +828,23 @@ function askBranchName(state) {
828
828
  });
829
829
  input.focus();
830
830
  screen.render();
831
- input.on("submit", (value) => {
831
+ input.on("submit", () => {
832
+ const value = input.getValue();
832
833
  if (!value || !value.trim()) {
833
834
  form.destroy();
834
835
  screen.render();
836
+ worktreeList.focus();
835
837
  return;
836
838
  }
837
839
  try {
838
840
  validateBranchName(value.trim());
839
841
  state.branchName = value.trim();
840
842
  form.destroy();
843
+ screen.render();
841
844
  askBaseBranch(state);
842
845
  } catch (e) {
843
846
  setStatus(`Error: ${e.message}`);
847
+ input.clearValue();
844
848
  input.focus();
845
849
  screen.render();
846
850
  }
@@ -848,6 +852,7 @@ function askBranchName(state) {
848
852
  input.on("cancel", () => {
849
853
  form.destroy();
850
854
  screen.render();
855
+ worktreeList.focus();
851
856
  });
852
857
  input.readInput();
853
858
  }
@@ -901,11 +906,13 @@ function askBaseBranch(state) {
901
906
  list.on("select", (_item, index) => {
902
907
  state.baseBranch = index === 0 ? "current" : "default";
903
908
  form.destroy();
909
+ screen.render();
904
910
  askCopyEnv(state);
905
911
  });
906
912
  list.key(["escape"], () => {
907
913
  form.destroy();
908
914
  screen.render();
915
+ worktreeList.focus();
909
916
  });
910
917
  }
911
918
  function askCopyEnv(state) {
@@ -948,11 +955,13 @@ function askCopyEnv(state) {
948
955
  list.on("select", (_item, index) => {
949
956
  state.copyEnv = index === 0;
950
957
  form.destroy();
958
+ screen.render();
951
959
  askPushToRemote(state);
952
960
  });
953
961
  list.key(["escape"], () => {
954
962
  form.destroy();
955
963
  screen.render();
964
+ worktreeList.focus();
956
965
  });
957
966
  }
958
967
  function askPushToRemote(state) {
@@ -995,11 +1004,13 @@ function askPushToRemote(state) {
995
1004
  list.on("select", (_item, index) => {
996
1005
  state.pushToRemote = index === 1;
997
1006
  form.destroy();
1007
+ screen.render();
998
1008
  askAITool(state);
999
1009
  });
1000
1010
  list.key(["escape"], () => {
1001
1011
  form.destroy();
1002
1012
  screen.render();
1013
+ worktreeList.focus();
1003
1014
  });
1004
1015
  }
1005
1016
  function askAITool(state) {
@@ -1042,11 +1053,13 @@ function askAITool(state) {
1042
1053
  list.on("select", (_item, index) => {
1043
1054
  state.aiTool = index === 0 ? "claude" : index === 1 ? "codex" : "skip";
1044
1055
  form.destroy();
1056
+ screen.render();
1045
1057
  executeCreation(state);
1046
1058
  });
1047
1059
  list.key(["escape"], () => {
1048
1060
  form.destroy();
1049
1061
  screen.render();
1062
+ worktreeList.focus();
1050
1063
  });
1051
1064
  }
1052
1065
  async function executeCreation(state) {
@@ -1068,6 +1081,7 @@ async function executeCreation(state) {
1068
1081
  }
1069
1082
  await refreshWorktrees();
1070
1083
  setStatus(`Created ${branchName}`);
1084
+ worktreeList.focus();
1071
1085
  if (aiTool !== "skip") {
1072
1086
  await launchInWorktree(worktreePath, aiTool);
1073
1087
  }
@@ -1083,12 +1097,15 @@ async function executeCreation(state) {
1083
1097
  }
1084
1098
  await refreshWorktrees();
1085
1099
  setStatus(`Created ${branchName}`);
1100
+ worktreeList.focus();
1086
1101
  if (aiTool !== "skip") {
1087
1102
  await launchInWorktree(worktreePath, aiTool);
1088
1103
  }
1089
1104
  }
1090
1105
  } catch (e) {
1091
1106
  setStatus(`Error: ${e.message}`);
1107
+ worktreeList.focus();
1108
+ screen.render();
1092
1109
  }
1093
1110
  }
1094
1111
  async function launchInWorktree(worktreePath, tool) {
@@ -1174,7 +1191,7 @@ ${tool} launched in: ${path8.basename(wt.path)}
1174
1191
 
1175
1192
  // src/index.ts
1176
1193
  var program = new Command();
1177
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.4.1").action(async () => {
1194
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.4.2").action(async () => {
1178
1195
  await interactiveCommand();
1179
1196
  });
1180
1197
  program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").option("-p, --push", "Push branch to remote (visible on GitHub)").action(async (branchName, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktree-launcher",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "CLI tool for managing git worktrees with AI coding assistants",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",