@kianax/wt 0.1.4 → 0.1.6

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -19
  3. package/dist/cli.js +725 -197
  4. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -14768,35 +14768,23 @@ async function loadGlobalConfig() {
14768
14768
  }
14769
14769
  return result.data;
14770
14770
  }
14771
- async function loadLocalConfig(repoRoot) {
14772
- const path = join2(repoRoot, LOCAL_CONFIG_FILE);
14773
- const raw = await loadJsonFile(path);
14774
- if (!raw) {
14775
- return null;
14776
- }
14777
- const result = LocalConfigSchema.safeParse(raw);
14778
- if (!result.success) {
14779
- console.warn(`Invalid local config at ${path}, ignoring`);
14780
- return null;
14781
- }
14782
- return result.data;
14783
- }
14784
- async function getConfig(repoRoot, repoId) {
14785
- const [config2, localConfig] = await Promise.all([
14786
- loadGlobalConfig(),
14787
- loadLocalConfig(repoRoot)
14788
- ]);
14771
+ async function getConfig(_repoRoot, repoId) {
14772
+ const config2 = await loadGlobalConfig();
14789
14773
  const repoOverride = config2.repos?.[repoId];
14790
- const branchPrefix = localConfig?.defaults?.branchPrefix ?? repoOverride?.branchPrefix ?? config2.defaults.branchPrefix;
14774
+ const branchPrefix = repoOverride?.branchPrefix ?? config2.defaults.branchPrefix;
14791
14775
  const worktreeBase = expandHome(repoOverride?.base ?? config2.paths.base);
14776
+ const comparisonBranch = repoOverride?.comparisonBranch ?? config2.defaults.comparisonBranch;
14792
14777
  return {
14793
14778
  config: config2,
14794
- localConfig,
14795
14779
  branchPrefix,
14796
- worktreeBase
14780
+ worktreeBase,
14781
+ comparisonBranch
14797
14782
  };
14798
14783
  }
14799
- var GLOBAL_CONFIG_PATH, LOCAL_CONFIG_FILE = ".wtrc.json", RepoOverrideSchema, ConfigSchema, LocalConfigSchema, DEFAULT_CONFIG;
14784
+ async function saveGlobalConfig(config2) {
14785
+ await writeFileText(GLOBAL_CONFIG_PATH, JSON.stringify(config2, null, 2));
14786
+ }
14787
+ var GLOBAL_CONFIG_PATH, RepoOverrideSchema, ConfigSchema, DEFAULT_CONFIG;
14800
14788
  var init_config = __esm(() => {
14801
14789
  init_zod();
14802
14790
  init_compat();
@@ -14804,7 +14792,8 @@ var init_config = __esm(() => {
14804
14792
  GLOBAL_CONFIG_PATH = join2(homedir2(), ".config", "wt", "config.json");
14805
14793
  RepoOverrideSchema = exports_external.object({
14806
14794
  branchPrefix: exports_external.string().max(30).regex(/^[a-zA-Z0-9_/-]*$/, "Invalid branch prefix format").optional(),
14807
- base: exports_external.string().optional()
14795
+ base: exports_external.string().optional(),
14796
+ comparisonBranch: exports_external.string().optional()
14808
14797
  });
14809
14798
  ConfigSchema = exports_external.object({
14810
14799
  paths: exports_external.object({
@@ -14813,15 +14802,11 @@ var init_config = __esm(() => {
14813
14802
  }).default({ strategy: "centralized", base: "~/.worktrees" }),
14814
14803
  defaults: exports_external.object({
14815
14804
  branchPrefix: exports_external.string().default(""),
14816
- staleDays: exports_external.number().default(30)
14805
+ staleDays: exports_external.number().default(30),
14806
+ comparisonBranch: exports_external.string().optional()
14817
14807
  }).default({ branchPrefix: "", staleDays: 30 }),
14818
14808
  repos: exports_external.record(exports_external.string(), RepoOverrideSchema).optional()
14819
14809
  });
14820
- LocalConfigSchema = exports_external.object({
14821
- defaults: exports_external.object({
14822
- branchPrefix: exports_external.string().optional()
14823
- }).optional()
14824
- });
14825
14810
  DEFAULT_CONFIG = {
14826
14811
  paths: {
14827
14812
  strategy: "centralized",
@@ -14851,7 +14836,7 @@ var package_default;
14851
14836
  var init_package = __esm(() => {
14852
14837
  package_default = {
14853
14838
  name: "@kianax/wt",
14854
- version: "0.1.4",
14839
+ version: "0.1.6",
14855
14840
  description: "Git worktree manager - make worktrees as effortless as branches",
14856
14841
  type: "module",
14857
14842
  main: "dist/cli.js",
@@ -53143,7 +53128,15 @@ function DetailsView({ worktree, onClose, onSelect }) {
53143
53128
  }, undefined, true, undefined, this),
53144
53129
  worktree.ahead === 0 && worktree.behind === 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
53145
53130
  children: "up to date"
53146
- }, undefined, false, undefined, this)
53131
+ }, undefined, false, undefined, this),
53132
+ worktree.comparisonBranch && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
53133
+ dimColor: true,
53134
+ children: [
53135
+ " (vs ",
53136
+ worktree.comparisonBranch,
53137
+ ")"
53138
+ ]
53139
+ }, undefined, true, undefined, this)
53147
53140
  ]
53148
53141
  }, undefined, true, undefined, this),
53149
53142
  commitMessage && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
@@ -53331,118 +53324,616 @@ var init_RenameDialog = __esm(async () => {
53331
53324
  jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
53332
53325
  });
53333
53326
 
53327
+ // src/tui/components/SettingsDialog.tsx
53328
+ function SettingsDialog({
53329
+ repoId,
53330
+ onClose,
53331
+ onSaved
53332
+ }) {
53333
+ const [config2, setConfig] = import_react30.useState(null);
53334
+ const [selectedField, setSelectedField] = import_react30.useState("paths.strategy");
53335
+ const [editMode, setEditMode] = import_react30.useState(false);
53336
+ const [editValue, setEditValue] = import_react30.useState("");
53337
+ const [error48, setError] = import_react30.useState(null);
53338
+ const [isSaving, setIsSaving] = import_react30.useState(false);
53339
+ const [repoOverrideIds, setRepoOverrideIds] = import_react30.useState([]);
53340
+ import_react30.useEffect(() => {
53341
+ loadGlobalConfig().then((cfg) => {
53342
+ setConfig(cfg);
53343
+ setRepoOverrideIds(Object.keys(cfg.repos ?? {}));
53344
+ });
53345
+ }, []);
53346
+ const allFields = [
53347
+ ...FIELD_ORDER,
53348
+ ...repoOverrideIds.flatMap((id) => [
53349
+ `repos.${id}.branchPrefix`,
53350
+ `repos.${id}.base`,
53351
+ `repos.${id}.comparisonBranch`
53352
+ ]),
53353
+ "addRepo"
53354
+ ];
53355
+ const selectedIndex = allFields.indexOf(selectedField);
53356
+ function getFieldValue(fieldId) {
53357
+ if (!config2)
53358
+ return "";
53359
+ if (fieldId === "paths.strategy")
53360
+ return config2.paths.strategy;
53361
+ if (fieldId === "paths.base")
53362
+ return config2.paths.base;
53363
+ if (fieldId === "defaults.branchPrefix")
53364
+ return config2.defaults.branchPrefix;
53365
+ if (fieldId === "defaults.staleDays")
53366
+ return String(config2.defaults.staleDays);
53367
+ if (fieldId === "defaults.comparisonBranch")
53368
+ return config2.defaults.comparisonBranch ?? "";
53369
+ const match = fieldId.match(/^repos\.(.+)\.(branchPrefix|base|comparisonBranch)$/);
53370
+ if (match) {
53371
+ const [, repoId2, field] = match;
53372
+ const repoConfig = config2.repos?.[repoId2];
53373
+ if (!repoConfig)
53374
+ return "";
53375
+ return repoConfig[field] ?? "";
53376
+ }
53377
+ return "";
53378
+ }
53379
+ function updateField(fieldId, value) {
53380
+ if (!config2)
53381
+ return;
53382
+ const newConfig = { ...config2 };
53383
+ if (fieldId === "paths.strategy") {
53384
+ newConfig.paths = {
53385
+ ...newConfig.paths,
53386
+ strategy: value
53387
+ };
53388
+ } else if (fieldId === "paths.base") {
53389
+ newConfig.paths = { ...newConfig.paths, base: value };
53390
+ } else if (fieldId === "defaults.branchPrefix") {
53391
+ newConfig.defaults = { ...newConfig.defaults, branchPrefix: value };
53392
+ } else if (fieldId === "defaults.staleDays") {
53393
+ const num = Number.parseInt(value, 10);
53394
+ if (!Number.isNaN(num) && num > 0) {
53395
+ newConfig.defaults = { ...newConfig.defaults, staleDays: num };
53396
+ }
53397
+ } else if (fieldId === "defaults.comparisonBranch") {
53398
+ newConfig.defaults = {
53399
+ ...newConfig.defaults,
53400
+ comparisonBranch: value || undefined
53401
+ };
53402
+ } else {
53403
+ const match = fieldId.match(/^repos\.(.+)\.(branchPrefix|base|comparisonBranch)$/);
53404
+ if (match) {
53405
+ const [, repoIdMatch, field] = match;
53406
+ newConfig.repos = {
53407
+ ...newConfig.repos,
53408
+ [repoIdMatch]: {
53409
+ ...newConfig.repos?.[repoIdMatch],
53410
+ [field]: value || undefined
53411
+ }
53412
+ };
53413
+ }
53414
+ }
53415
+ setConfig(newConfig);
53416
+ }
53417
+ function addRepoOverride(id) {
53418
+ if (!config2 || !id.trim())
53419
+ return;
53420
+ const newConfig = {
53421
+ ...config2,
53422
+ repos: {
53423
+ ...config2.repos,
53424
+ [id]: { branchPrefix: "", base: "", comparisonBranch: "" }
53425
+ }
53426
+ };
53427
+ setConfig(newConfig);
53428
+ setRepoOverrideIds([...repoOverrideIds, id]);
53429
+ setSelectedField(`repos.${id}.branchPrefix`);
53430
+ }
53431
+ function deleteRepoOverride(id) {
53432
+ if (!config2)
53433
+ return;
53434
+ const newRepos = { ...config2.repos };
53435
+ delete newRepos[id];
53436
+ setConfig({ ...config2, repos: newRepos });
53437
+ setRepoOverrideIds(repoOverrideIds.filter((r) => r !== id));
53438
+ setSelectedField("addRepo");
53439
+ }
53440
+ async function handleSave() {
53441
+ if (!config2)
53442
+ return;
53443
+ const result = ConfigSchema.safeParse(config2);
53444
+ if (!result.success) {
53445
+ const firstIssue = result.error.issues[0];
53446
+ setError(`Validation error: ${firstIssue?.message ?? "Unknown error"}`);
53447
+ return;
53448
+ }
53449
+ setIsSaving(true);
53450
+ setError(null);
53451
+ try {
53452
+ await saveGlobalConfig(config2);
53453
+ onSaved();
53454
+ } catch (err) {
53455
+ setError(err instanceof Error ? err.message : String(err));
53456
+ setIsSaving(false);
53457
+ }
53458
+ }
53459
+ use_input_default((input, key) => {
53460
+ if (isSaving)
53461
+ return;
53462
+ if (editMode) {
53463
+ if (key.escape) {
53464
+ setEditMode(false);
53465
+ setEditValue("");
53466
+ return;
53467
+ }
53468
+ if (key.return) {
53469
+ if (selectedField === "addRepo" && editValue.trim()) {
53470
+ addRepoOverride(editValue.trim());
53471
+ } else {
53472
+ updateField(selectedField, editValue);
53473
+ }
53474
+ setEditMode(false);
53475
+ setEditValue("");
53476
+ return;
53477
+ }
53478
+ if (selectedField === "paths.strategy") {
53479
+ if (key.leftArrow || key.rightArrow) {
53480
+ const currentIdx = STRATEGIES.indexOf(editValue);
53481
+ const newIdx = key.rightArrow ? (currentIdx + 1) % STRATEGIES.length : (currentIdx - 1 + STRATEGIES.length) % STRATEGIES.length;
53482
+ setEditValue(STRATEGIES[newIdx]);
53483
+ }
53484
+ return;
53485
+ }
53486
+ if (selectedField === "defaults.staleDays") {
53487
+ if (key.backspace || key.delete) {
53488
+ setEditValue((v) => v.slice(0, -1));
53489
+ return;
53490
+ }
53491
+ if (input && /^\d$/.test(input)) {
53492
+ setEditValue((v) => v + input);
53493
+ }
53494
+ return;
53495
+ }
53496
+ if (key.backspace || key.delete) {
53497
+ setEditValue((v) => v.slice(0, -1));
53498
+ return;
53499
+ }
53500
+ if (input && /^[a-zA-Z0-9_/~.-]$/.test(input)) {
53501
+ setEditValue((v) => v + input);
53502
+ }
53503
+ return;
53504
+ }
53505
+ if (key.escape) {
53506
+ onClose();
53507
+ return;
53508
+ }
53509
+ if (key.ctrl && input === "s") {
53510
+ handleSave();
53511
+ return;
53512
+ }
53513
+ if (input === "j" || key.downArrow) {
53514
+ const nextIndex = Math.min(selectedIndex + 1, allFields.length - 1);
53515
+ setSelectedField(allFields[nextIndex]);
53516
+ return;
53517
+ }
53518
+ if (input === "k" || key.upArrow) {
53519
+ const prevIndex = Math.max(selectedIndex - 1, 0);
53520
+ setSelectedField(allFields[prevIndex]);
53521
+ return;
53522
+ }
53523
+ if (key.tab) {
53524
+ const nextIndex = (selectedIndex + 1) % allFields.length;
53525
+ setSelectedField(allFields[nextIndex]);
53526
+ return;
53527
+ }
53528
+ if (key.return) {
53529
+ if (selectedField === "addRepo") {
53530
+ setEditValue(repoId);
53531
+ setEditMode(true);
53532
+ return;
53533
+ }
53534
+ setEditValue(getFieldValue(selectedField));
53535
+ setEditMode(true);
53536
+ return;
53537
+ }
53538
+ if (input === "d") {
53539
+ const match = selectedField.match(/^repos\.(.+)\./);
53540
+ if (match) {
53541
+ deleteRepoOverride(match[1]);
53542
+ }
53543
+ }
53544
+ });
53545
+ if (!config2) {
53546
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53547
+ flexDirection: "column",
53548
+ borderStyle: "round",
53549
+ borderColor: theme.dialog.info,
53550
+ padding: 1,
53551
+ marginTop: 1,
53552
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53553
+ dimColor: true,
53554
+ children: "Loading configuration..."
53555
+ }, undefined, false, undefined, this)
53556
+ }, undefined, false, undefined, this);
53557
+ }
53558
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53559
+ flexDirection: "column",
53560
+ borderStyle: "round",
53561
+ borderColor: theme.dialog.info,
53562
+ padding: 1,
53563
+ marginTop: 1,
53564
+ children: [
53565
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53566
+ bold: true,
53567
+ color: theme.dialog.info,
53568
+ children: "Settings"
53569
+ }, undefined, false, undefined, this),
53570
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53571
+ marginTop: 1,
53572
+ flexDirection: "column",
53573
+ children: [
53574
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53575
+ bold: true,
53576
+ dimColor: true,
53577
+ children: "Worktree Storage"
53578
+ }, undefined, false, undefined, this),
53579
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53580
+ dimColor: true,
53581
+ children: "─".repeat(17)
53582
+ }, undefined, false, undefined, this),
53583
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53584
+ label: "Strategy",
53585
+ value: config2.paths.strategy,
53586
+ isSelected: selectedField === "paths.strategy",
53587
+ isEditing: editMode && selectedField === "paths.strategy",
53588
+ editValue,
53589
+ isEnum: true
53590
+ }, undefined, false, undefined, this),
53591
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53592
+ label: "Base path",
53593
+ value: config2.paths.base,
53594
+ isSelected: selectedField === "paths.base",
53595
+ isEditing: editMode && selectedField === "paths.base",
53596
+ editValue
53597
+ }, undefined, false, undefined, this)
53598
+ ]
53599
+ }, undefined, true, undefined, this),
53600
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53601
+ marginTop: 1,
53602
+ flexDirection: "column",
53603
+ children: [
53604
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53605
+ bold: true,
53606
+ dimColor: true,
53607
+ children: "Defaults"
53608
+ }, undefined, false, undefined, this),
53609
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53610
+ dimColor: true,
53611
+ children: "─".repeat(8)
53612
+ }, undefined, false, undefined, this),
53613
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53614
+ label: "Branch prefix",
53615
+ value: config2.defaults.branchPrefix || "(none)",
53616
+ isSelected: selectedField === "defaults.branchPrefix",
53617
+ isEditing: editMode && selectedField === "defaults.branchPrefix",
53618
+ editValue
53619
+ }, undefined, false, undefined, this),
53620
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53621
+ label: "Stale days",
53622
+ value: String(config2.defaults.staleDays),
53623
+ isSelected: selectedField === "defaults.staleDays",
53624
+ isEditing: editMode && selectedField === "defaults.staleDays",
53625
+ editValue
53626
+ }, undefined, false, undefined, this),
53627
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53628
+ label: "Compare branch",
53629
+ value: config2.defaults.comparisonBranch || "(auto)",
53630
+ isSelected: selectedField === "defaults.comparisonBranch",
53631
+ isEditing: editMode && selectedField === "defaults.comparisonBranch",
53632
+ editValue
53633
+ }, undefined, false, undefined, this)
53634
+ ]
53635
+ }, undefined, true, undefined, this),
53636
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53637
+ marginTop: 1,
53638
+ flexDirection: "column",
53639
+ children: [
53640
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53641
+ bold: true,
53642
+ dimColor: true,
53643
+ children: "Repository Overrides"
53644
+ }, undefined, false, undefined, this),
53645
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53646
+ dimColor: true,
53647
+ children: "─".repeat(20)
53648
+ }, undefined, false, undefined, this),
53649
+ repoOverrideIds.map((id) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53650
+ flexDirection: "column",
53651
+ marginLeft: 1,
53652
+ children: [
53653
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53654
+ dimColor: true,
53655
+ children: id
53656
+ }, undefined, false, undefined, this),
53657
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53658
+ marginLeft: 2,
53659
+ flexDirection: "column",
53660
+ children: [
53661
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53662
+ label: "branchPrefix",
53663
+ value: config2.repos?.[id]?.branchPrefix || "(none)",
53664
+ isSelected: selectedField === `repos.${id}.branchPrefix`,
53665
+ isEditing: editMode && selectedField === `repos.${id}.branchPrefix`,
53666
+ editValue
53667
+ }, undefined, false, undefined, this),
53668
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53669
+ label: "base",
53670
+ value: config2.repos?.[id]?.base || "(none)",
53671
+ isSelected: selectedField === `repos.${id}.base`,
53672
+ isEditing: editMode && selectedField === `repos.${id}.base`,
53673
+ editValue
53674
+ }, undefined, false, undefined, this),
53675
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
53676
+ label: "compareBranch",
53677
+ value: config2.repos?.[id]?.comparisonBranch || "(auto)",
53678
+ isSelected: selectedField === `repos.${id}.comparisonBranch`,
53679
+ isEditing: editMode && selectedField === `repos.${id}.comparisonBranch`,
53680
+ editValue
53681
+ }, undefined, false, undefined, this)
53682
+ ]
53683
+ }, undefined, true, undefined, this)
53684
+ ]
53685
+ }, id, true, undefined, this)),
53686
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53687
+ marginTop: repoOverrideIds.length > 0 ? 1 : 0,
53688
+ children: selectedField === "addRepo" && editMode ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53689
+ children: [
53690
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53691
+ color: theme.accent,
53692
+ children: "[+ Add: "
53693
+ }, undefined, false, undefined, this),
53694
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53695
+ color: theme.accent,
53696
+ children: editValue
53697
+ }, undefined, false, undefined, this),
53698
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53699
+ color: theme.accent,
53700
+ children: "█]"
53701
+ }, undefined, false, undefined, this)
53702
+ ]
53703
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53704
+ color: selectedField === "addRepo" ? theme.accent : undefined,
53705
+ inverse: selectedField === "addRepo",
53706
+ children: "[+ Add override]"
53707
+ }, undefined, false, undefined, this)
53708
+ }, undefined, false, undefined, this)
53709
+ ]
53710
+ }, undefined, true, undefined, this),
53711
+ error48 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53712
+ marginTop: 1,
53713
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53714
+ color: theme.ui.error,
53715
+ children: error48
53716
+ }, undefined, false, undefined, this)
53717
+ }, undefined, false, undefined, this),
53718
+ isSaving && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53719
+ marginTop: 1,
53720
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53721
+ dimColor: true,
53722
+ children: "Saving..."
53723
+ }, undefined, false, undefined, this)
53724
+ }, undefined, false, undefined, this),
53725
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53726
+ marginTop: 1,
53727
+ borderStyle: "single",
53728
+ borderTop: true,
53729
+ borderBottom: false,
53730
+ borderLeft: false,
53731
+ borderRight: false,
53732
+ paddingTop: 1,
53733
+ children: editMode ? selectedField === "paths.strategy" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53734
+ dimColor: true,
53735
+ children: "←/→ cycle Enter confirm Esc cancel"
53736
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53737
+ dimColor: true,
53738
+ children: "Type to edit Enter confirm Esc cancel"
53739
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53740
+ dimColor: true,
53741
+ children: "↑/↓ navigate Tab next Enter edit Esc cancel ^S save"
53742
+ }, undefined, false, undefined, this)
53743
+ }, undefined, false, undefined, this)
53744
+ ]
53745
+ }, undefined, true, undefined, this);
53746
+ }
53747
+ function FieldRow({
53748
+ label,
53749
+ value,
53750
+ isSelected,
53751
+ isEditing,
53752
+ editValue,
53753
+ isEnum
53754
+ }) {
53755
+ const displayValue = isEditing ? editValue : value;
53756
+ const labelWidth = 14;
53757
+ const paddedLabel = `${label}:`.padEnd(labelWidth);
53758
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53759
+ children: [
53760
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53761
+ dimColor: !isSelected,
53762
+ children: paddedLabel
53763
+ }, undefined, false, undefined, this),
53764
+ isEditing ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53765
+ children: isEnum ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53766
+ color: theme.accent,
53767
+ children: [
53768
+ "[",
53769
+ displayValue,
53770
+ " ▾]"
53771
+ ]
53772
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53773
+ children: [
53774
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53775
+ color: theme.accent,
53776
+ children: displayValue
53777
+ }, undefined, false, undefined, this),
53778
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53779
+ color: theme.accent,
53780
+ children: "█"
53781
+ }, undefined, false, undefined, this)
53782
+ ]
53783
+ }, undefined, true, undefined, this)
53784
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53785
+ color: isSelected ? theme.accent : undefined,
53786
+ inverse: isSelected,
53787
+ children: displayValue
53788
+ }, undefined, false, undefined, this)
53789
+ ]
53790
+ }, undefined, true, undefined, this);
53791
+ }
53792
+ var import_react30, jsx_dev_runtime5, FIELD_ORDER, STRATEGIES;
53793
+ var init_SettingsDialog = __esm(async () => {
53794
+ init_config();
53795
+ init_theme();
53796
+ await init_build2();
53797
+ import_react30 = __toESM(require_react(), 1);
53798
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
53799
+ FIELD_ORDER = [
53800
+ "paths.strategy",
53801
+ "paths.base",
53802
+ "defaults.branchPrefix",
53803
+ "defaults.staleDays",
53804
+ "defaults.comparisonBranch"
53805
+ ];
53806
+ STRATEGIES = ["centralized", "sibling"];
53807
+ });
53808
+
53334
53809
  // src/tui/components/StatusBar.tsx
53335
53810
  function StatusBar() {
53336
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
53811
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
53337
53812
  paddingLeft: 3,
53338
53813
  marginBottom: 1,
53339
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53814
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53340
53815
  children: [
53341
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53816
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53342
53817
  dimColor: true,
53343
53818
  children: "["
53344
53819
  }, undefined, false, undefined, this),
53345
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53820
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53346
53821
  color: theme.accent,
53347
53822
  children: "↵"
53348
53823
  }, undefined, false, undefined, this),
53349
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53824
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53350
53825
  dimColor: true,
53351
53826
  children: "]"
53352
53827
  }, undefined, false, undefined, this),
53353
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53828
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53354
53829
  dimColor: true,
53355
53830
  children: " select "
53356
53831
  }, undefined, false, undefined, this),
53357
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53832
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53358
53833
  dimColor: true,
53359
53834
  children: "["
53360
53835
  }, undefined, false, undefined, this),
53361
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53836
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53362
53837
  color: theme.accent,
53363
53838
  children: "q"
53364
53839
  }, undefined, false, undefined, this),
53365
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53840
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53366
53841
  dimColor: true,
53367
53842
  children: "]"
53368
53843
  }, undefined, false, undefined, this),
53369
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53844
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53370
53845
  dimColor: true,
53371
53846
  children: " quit "
53372
53847
  }, undefined, false, undefined, this),
53373
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53848
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53374
53849
  dimColor: true,
53375
53850
  children: "["
53376
53851
  }, undefined, false, undefined, this),
53377
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53852
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53378
53853
  color: theme.accent,
53379
53854
  children: "n"
53380
53855
  }, undefined, false, undefined, this),
53381
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53856
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53382
53857
  dimColor: true,
53383
53858
  children: "]"
53384
53859
  }, undefined, false, undefined, this),
53385
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53860
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53386
53861
  dimColor: true,
53387
53862
  children: " new "
53388
53863
  }, undefined, false, undefined, this),
53389
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53864
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53390
53865
  dimColor: true,
53391
53866
  children: "["
53392
53867
  }, undefined, false, undefined, this),
53393
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53868
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53394
53869
  color: theme.accent,
53395
53870
  children: "d"
53396
53871
  }, undefined, false, undefined, this),
53397
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53872
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53398
53873
  dimColor: true,
53399
53874
  children: "]"
53400
53875
  }, undefined, false, undefined, this),
53401
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53876
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53402
53877
  dimColor: true,
53403
53878
  children: " delete "
53404
53879
  }, undefined, false, undefined, this),
53405
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53880
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53406
53881
  dimColor: true,
53407
53882
  children: "["
53408
53883
  }, undefined, false, undefined, this),
53409
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53884
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53410
53885
  color: theme.accent,
53411
53886
  children: "r"
53412
53887
  }, undefined, false, undefined, this),
53413
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53888
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53414
53889
  dimColor: true,
53415
53890
  children: "]"
53416
53891
  }, undefined, false, undefined, this),
53417
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53892
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53418
53893
  dimColor: true,
53419
53894
  children: " rename "
53420
53895
  }, undefined, false, undefined, this),
53421
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53896
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53422
53897
  dimColor: true,
53423
53898
  children: "["
53424
53899
  }, undefined, false, undefined, this),
53425
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53900
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53426
53901
  color: theme.accent,
53427
53902
  children: "i"
53428
53903
  }, undefined, false, undefined, this),
53429
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53904
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53905
+ dimColor: true,
53906
+ children: "]"
53907
+ }, undefined, false, undefined, this),
53908
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53909
+ dimColor: true,
53910
+ children: " info "
53911
+ }, undefined, false, undefined, this),
53912
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53913
+ dimColor: true,
53914
+ children: "["
53915
+ }, undefined, false, undefined, this),
53916
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53917
+ color: theme.accent,
53918
+ children: "s"
53919
+ }, undefined, false, undefined, this),
53920
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53430
53921
  dimColor: true,
53431
53922
  children: "]"
53432
53923
  }, undefined, false, undefined, this),
53433
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
53924
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53434
53925
  dimColor: true,
53435
- children: " info"
53926
+ children: " settings"
53436
53927
  }, undefined, false, undefined, this)
53437
53928
  ]
53438
53929
  }, undefined, true, undefined, this)
53439
53930
  }, undefined, false, undefined, this);
53440
53931
  }
53441
- var jsx_dev_runtime5;
53932
+ var jsx_dev_runtime6;
53442
53933
  var init_StatusBar = __esm(async () => {
53443
53934
  init_theme();
53444
53935
  await init_build2();
53445
- jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
53936
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
53446
53937
  });
53447
53938
 
53448
53939
  // src/lib/version.ts
@@ -53455,12 +53946,16 @@ var init_version = __esm(() => {
53455
53946
  // src/tui/components/columns.ts
53456
53947
  function formatRow(parts) {
53457
53948
  const { cursor, icon, name, path, age, status, suffix = "" } = parts;
53949
+ const gap = " ".repeat(GAP);
53458
53950
  return [
53459
53951
  cursor.padEnd(COLUMNS.cursor),
53460
53952
  icon.padEnd(COLUMNS.icon),
53461
53953
  name.padEnd(COLUMNS.name),
53954
+ gap,
53462
53955
  path.padEnd(COLUMNS.path),
53956
+ gap,
53463
53957
  age.padEnd(COLUMNS.age),
53958
+ gap,
53464
53959
  status.padEnd(COLUMNS.status),
53465
53960
  suffix
53466
53961
  ].join("");
@@ -53475,7 +53970,7 @@ function formatHeader() {
53475
53970
  status: "status"
53476
53971
  });
53477
53972
  }
53478
- var COLUMNS;
53973
+ var COLUMNS, GAP = 2;
53479
53974
  var init_columns = __esm(() => {
53480
53975
  COLUMNS = {
53481
53976
  cursor: 2,
@@ -53493,8 +53988,8 @@ function WorktreeItem({
53493
53988
  isSelected,
53494
53989
  isCurrent
53495
53990
  }) {
53496
- const [age, setAge] = import_react30.useState(null);
53497
- import_react30.useEffect(() => {
53991
+ const [age, setAge] = import_react31.useState(null);
53992
+ import_react31.useEffect(() => {
53498
53993
  getCommitInfo(worktree.path).then((info) => {
53499
53994
  if (info) {
53500
53995
  setAge(formatAge(info.timestamp));
@@ -53538,7 +54033,7 @@ function WorktreeItem({
53538
54033
  syncSuffix += `-${behind}`;
53539
54034
  const rowText = formatRow({
53540
54035
  cursor: isSelected ? ">" : "",
53541
- icon: isCurrent ? "*" : "",
54036
+ icon: isCurrent ? "" : "",
53542
54037
  name: displayName,
53543
54038
  path: displayPath,
53544
54039
  age: age || "",
@@ -53548,51 +54043,51 @@ function WorktreeItem({
53548
54043
  const cursorEnd = COLUMNS.cursor;
53549
54044
  const iconEnd = cursorEnd + COLUMNS.icon;
53550
54045
  const nameEnd = iconEnd + COLUMNS.name;
53551
- const pathEnd = nameEnd + COLUMNS.path;
53552
- const ageEnd = pathEnd + COLUMNS.age;
53553
- const statusEnd = ageEnd + COLUMNS.status;
53554
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
54046
+ const pathEnd = nameEnd + GAP + COLUMNS.path;
54047
+ const ageEnd = pathEnd + GAP + COLUMNS.age;
54048
+ const statusEnd = ageEnd + GAP + COLUMNS.status;
54049
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
53555
54050
  children: [
53556
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54051
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53557
54052
  color: isSelected ? theme.accent : undefined,
53558
54053
  children: rowText.slice(0, cursorEnd)
53559
54054
  }, undefined, false, undefined, this),
53560
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54055
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53561
54056
  color: isCurrent ? theme.accent : "dim",
53562
54057
  children: rowText.slice(cursorEnd, iconEnd)
53563
54058
  }, undefined, false, undefined, this),
53564
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54059
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53565
54060
  color: isSelected ? theme.accent : undefined,
53566
54061
  children: rowText.slice(iconEnd, nameEnd)
53567
54062
  }, undefined, false, undefined, this),
53568
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54063
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53569
54064
  dimColor: true,
53570
54065
  children: rowText.slice(nameEnd, pathEnd)
53571
54066
  }, undefined, false, undefined, this),
53572
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54067
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53573
54068
  dimColor: true,
53574
54069
  children: rowText.slice(pathEnd, ageEnd)
53575
54070
  }, undefined, false, undefined, this),
53576
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54071
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53577
54072
  color: statusColor,
53578
54073
  children: rowText.slice(ageEnd, statusEnd)
53579
54074
  }, undefined, false, undefined, this),
53580
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
54075
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53581
54076
  color: ahead && ahead > 0 ? theme.ui.success : theme.status.behind,
53582
54077
  children: rowText.slice(statusEnd)
53583
54078
  }, undefined, false, undefined, this)
53584
54079
  ]
53585
54080
  }, undefined, true, undefined, this);
53586
54081
  }
53587
- var import_react30, jsx_dev_runtime6;
54082
+ var import_react31, jsx_dev_runtime7;
53588
54083
  var init_WorktreeItem = __esm(async () => {
53589
54084
  init_log();
53590
54085
  init_paths();
53591
54086
  init_theme();
53592
54087
  init_columns();
53593
54088
  await init_build2();
53594
- import_react30 = __toESM(require_react(), 1);
53595
- jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
54089
+ import_react31 = __toESM(require_react(), 1);
54090
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
53596
54091
  });
53597
54092
 
53598
54093
  // src/tui/components/WorktreeList.tsx
@@ -53610,20 +54105,20 @@ function WorktreeList({
53610
54105
  return currentPath === wt.path || currentPath.startsWith(`${wt.path}/`);
53611
54106
  };
53612
54107
  if (isLoading && worktrees.length === 0) {
53613
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54108
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53614
54109
  paddingX: 1,
53615
54110
  paddingY: 1,
53616
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54111
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53617
54112
  dimColor: true,
53618
54113
  children: "Loading worktrees..."
53619
54114
  }, undefined, false, undefined, this)
53620
54115
  }, undefined, false, undefined, this);
53621
54116
  }
53622
54117
  if (worktrees.length === 0) {
53623
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54118
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53624
54119
  paddingX: 1,
53625
54120
  paddingY: 1,
53626
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54121
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53627
54122
  dimColor: true,
53628
54123
  children: "No worktrees found"
53629
54124
  }, undefined, false, undefined, this)
@@ -53632,12 +54127,12 @@ function WorktreeList({
53632
54127
  const title = ` worktrees v${VERSION2} `;
53633
54128
  const boxWidth = terminalWidth - 2;
53634
54129
  const titleLineWidth = boxWidth - title.length - 4;
53635
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54130
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53636
54131
  flexDirection: "column",
53637
54132
  paddingX: 1,
53638
54133
  paddingTop: 1,
53639
54134
  children: [
53640
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54135
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53641
54136
  dimColor: true,
53642
54137
  children: [
53643
54138
  "╭─",
@@ -53646,46 +54141,46 @@ function WorktreeList({
53646
54141
  "─╮"
53647
54142
  ]
53648
54143
  }, undefined, true, undefined, this),
53649
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54144
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53650
54145
  children: [
53651
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54146
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53652
54147
  dimColor: true,
53653
54148
  children: "│"
53654
54149
  }, undefined, false, undefined, this),
53655
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54150
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53656
54151
  width: boxWidth - 2,
53657
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54152
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53658
54153
  dimColor: true,
53659
54154
  children: formatHeader()
53660
54155
  }, undefined, false, undefined, this)
53661
54156
  }, undefined, false, undefined, this),
53662
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54157
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53663
54158
  dimColor: true,
53664
54159
  children: "│"
53665
54160
  }, undefined, false, undefined, this)
53666
54161
  ]
53667
54162
  }, undefined, true, undefined, this),
53668
- worktrees.map((wt, index) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54163
+ worktrees.map((wt, index) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53669
54164
  children: [
53670
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54165
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53671
54166
  dimColor: true,
53672
54167
  children: "│"
53673
54168
  }, undefined, false, undefined, this),
53674
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
54169
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
53675
54170
  width: boxWidth - 2,
53676
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WorktreeItem, {
54171
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(WorktreeItem, {
53677
54172
  worktree: wt,
53678
54173
  isSelected: index === selectedIndex,
53679
54174
  isCurrent: isCurrentWorktree(wt)
53680
54175
  }, undefined, false, undefined, this)
53681
54176
  }, undefined, false, undefined, this),
53682
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54177
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53683
54178
  dimColor: true,
53684
54179
  children: "│"
53685
54180
  }, undefined, false, undefined, this)
53686
54181
  ]
53687
54182
  }, wt.path, true, undefined, this)),
53688
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
54183
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
53689
54184
  dimColor: true,
53690
54185
  children: [
53691
54186
  "╰",
@@ -53696,7 +54191,7 @@ function WorktreeList({
53696
54191
  ]
53697
54192
  }, undefined, true, undefined, this);
53698
54193
  }
53699
- var jsx_dev_runtime7;
54194
+ var jsx_dev_runtime8;
53700
54195
  var init_WorktreeList = __esm(async () => {
53701
54196
  init_version();
53702
54197
  init_columns();
@@ -53704,14 +54199,15 @@ var init_WorktreeList = __esm(async () => {
53704
54199
  init_build2(),
53705
54200
  init_WorktreeItem()
53706
54201
  ]);
53707
- jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
54202
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
53708
54203
  });
53709
54204
 
53710
54205
  // src/lib/git/status.ts
53711
- async function getWorktreeStatus(worktreePath, branch) {
54206
+ async function getWorktreeStatus(worktreePath, branch, configuredBranch) {
53712
54207
  const status = [];
53713
54208
  let ahead;
53714
54209
  let behind;
54210
+ let actualComparisonBranch;
53715
54211
  const statusResult = await git(["status", "--porcelain"], {
53716
54212
  cwd: worktreePath
53717
54213
  });
@@ -53720,11 +54216,12 @@ async function getWorktreeStatus(worktreePath, branch) {
53720
54216
  }
53721
54217
  if (branch) {
53722
54218
  const mainBranch = await getMainBranch(worktreePath);
53723
- const comparisonBranch = await getComparisonBranch(worktreePath);
54219
+ const comparisonBranch = configuredBranch ? await verifyBranch(worktreePath, configuredBranch) : await getComparisonBranch(worktreePath);
53724
54220
  if (comparisonBranch) {
53725
54221
  const isPrimaryWorktree = mainBranch && branch === mainBranch;
53726
54222
  const hasRemoteComparison = comparisonBranch.startsWith("origin/");
53727
54223
  if (!isPrimaryWorktree || hasRemoteComparison) {
54224
+ actualComparisonBranch = comparisonBranch;
53728
54225
  const aheadBehindResult = await git(["rev-list", "--left-right", "--count", `${comparisonBranch}...HEAD`], { cwd: worktreePath });
53729
54226
  if (aheadBehindResult.success) {
53730
54227
  const parts = aheadBehindResult.stdout.trim().split(/\s+/);
@@ -53774,7 +54271,7 @@ async function getWorktreeStatus(worktreePath, branch) {
53774
54271
  }
53775
54272
  }
53776
54273
  }
53777
- return { status, ahead, behind };
54274
+ return { status, ahead, behind, comparisonBranch: actualComparisonBranch };
53778
54275
  }
53779
54276
  async function getMainBranch(cwd2) {
53780
54277
  for (const branch of DEFAULT_BRANCHES) {
@@ -53800,6 +54297,13 @@ async function getComparisonBranch(cwd2) {
53800
54297
  }
53801
54298
  return null;
53802
54299
  }
54300
+ async function verifyBranch(cwd2, branch) {
54301
+ const result = await git(["rev-parse", "--verify", branch], { cwd: cwd2 });
54302
+ if (result.success) {
54303
+ return branch;
54304
+ }
54305
+ return getComparisonBranch(cwd2);
54306
+ }
53803
54307
  var init_status = __esm(() => {
53804
54308
  init_exec();
53805
54309
  init_constants();
@@ -53807,11 +54311,11 @@ var init_status = __esm(() => {
53807
54311
 
53808
54312
  // src/tui/hooks/useWorktrees.ts
53809
54313
  function useWorktrees() {
53810
- const [worktrees, setWorktrees] = import_react31.useState([]);
53811
- const [isLoading, setIsLoading] = import_react31.useState(true);
53812
- const [error48, setError] = import_react31.useState(null);
53813
- const primaryPathRef = import_react31.useRef(null);
53814
- const fetchWorktrees = import_react31.useCallback(async () => {
54314
+ const [worktrees, setWorktrees] = import_react32.useState([]);
54315
+ const [isLoading, setIsLoading] = import_react32.useState(true);
54316
+ const [error48, setError] = import_react32.useState(null);
54317
+ const primaryPathRef = import_react32.useRef(null);
54318
+ const fetchWorktrees = import_react32.useCallback(async () => {
53815
54319
  setIsLoading(true);
53816
54320
  setError(null);
53817
54321
  try {
@@ -53820,6 +54324,14 @@ function useWorktrees() {
53820
54324
  if (primary) {
53821
54325
  primaryPathRef.current = primary.path;
53822
54326
  }
54327
+ let configuredComparisonBranch;
54328
+ try {
54329
+ const repoInfo = await getRepoInfo();
54330
+ if (repoInfo) {
54331
+ const { comparisonBranch } = await getConfig(repoInfo.worktreeRoot, repoInfo.repoId);
54332
+ configuredComparisonBranch = comparisonBranch;
54333
+ }
54334
+ } catch {}
53823
54335
  const initialWorktrees = list.map((wt) => ({
53824
54336
  ...wt,
53825
54337
  status: []
@@ -53828,12 +54340,13 @@ function useWorktrees() {
53828
54340
  setIsLoading(false);
53829
54341
  const withStatus = await Promise.all(list.map(async (wt) => {
53830
54342
  try {
53831
- const statusResult = await getWorktreeStatus(wt.path, wt.branch);
54343
+ const statusResult = await getWorktreeStatus(wt.path, wt.branch, configuredComparisonBranch);
53832
54344
  return {
53833
54345
  ...wt,
53834
54346
  status: statusResult.status,
53835
54347
  ahead: statusResult.ahead,
53836
- behind: statusResult.behind
54348
+ behind: statusResult.behind,
54349
+ comparisonBranch: statusResult.comparisonBranch
53837
54350
  };
53838
54351
  } catch {
53839
54352
  return { ...wt, status: [] };
@@ -53845,7 +54358,7 @@ function useWorktrees() {
53845
54358
  setIsLoading(false);
53846
54359
  }
53847
54360
  }, []);
53848
- import_react31.useEffect(() => {
54361
+ import_react32.useEffect(() => {
53849
54362
  fetchWorktrees();
53850
54363
  }, [fetchWorktrees]);
53851
54364
  return {
@@ -53855,22 +54368,24 @@ function useWorktrees() {
53855
54368
  refresh: fetchWorktrees
53856
54369
  };
53857
54370
  }
53858
- var import_react31;
54371
+ var import_react32;
53859
54372
  var init_useWorktrees = __esm(() => {
54373
+ init_config();
54374
+ init_repo();
53860
54375
  init_status();
53861
54376
  init_worktree();
53862
- import_react31 = __toESM(require_react(), 1);
54377
+ import_react32 = __toESM(require_react(), 1);
53863
54378
  });
53864
54379
 
53865
54380
  // src/tui/App.tsx
53866
- function App2({ repoName: _repoName, currentPath, onSelect }) {
54381
+ function App2({ repoName, currentPath, onSelect }) {
53867
54382
  const { exit } = use_app_default();
53868
54383
  const { worktrees, isLoading, error: error48, refresh } = useWorktrees();
53869
- const [selectedIndex, setSelectedIndex] = import_react32.useState(0);
53870
- const [activeDialog, setActiveDialog] = import_react32.useState("none");
53871
- const [initialSelectionDone, setInitialSelectionDone] = import_react32.useState(false);
53872
- const [destinationPath, setDestinationPath] = import_react32.useState(currentPath);
53873
- import_react32.useEffect(() => {
54384
+ const [selectedIndex, setSelectedIndex] = import_react33.useState(0);
54385
+ const [activeDialog, setActiveDialog] = import_react33.useState("none");
54386
+ const [initialSelectionDone, setInitialSelectionDone] = import_react33.useState(false);
54387
+ const [destinationPath, setDestinationPath] = import_react33.useState(currentPath);
54388
+ import_react33.useEffect(() => {
53874
54389
  if (!initialSelectionDone && worktrees.length > 0 && currentPath) {
53875
54390
  const index = worktrees.findIndex((wt) => currentPath === wt.path || currentPath.startsWith(`${wt.path}/`));
53876
54391
  if (index !== -1) {
@@ -53879,7 +54394,7 @@ function App2({ repoName: _repoName, currentPath, onSelect }) {
53879
54394
  setInitialSelectionDone(true);
53880
54395
  }
53881
54396
  }, [worktrees, currentPath, initialSelectionDone]);
53882
- import_react32.useEffect(() => {
54397
+ import_react33.useEffect(() => {
53883
54398
  if (selectedIndex >= worktrees.length && worktrees.length > 0) {
53884
54399
  setSelectedIndex(worktrees.length - 1);
53885
54400
  }
@@ -53913,6 +54428,10 @@ function App2({ repoName: _repoName, currentPath, onSelect }) {
53913
54428
  setActiveDialog("details");
53914
54429
  return;
53915
54430
  }
54431
+ if (input === "s") {
54432
+ setActiveDialog("settings");
54433
+ return;
54434
+ }
53916
54435
  if (input === "q") {
53917
54436
  if (destinationPath && destinationPath !== currentPath) {
53918
54437
  onSelect(destinationPath);
@@ -53941,10 +54460,10 @@ function App2({ repoName: _repoName, currentPath, onSelect }) {
53941
54460
  setActiveDialog("none");
53942
54461
  };
53943
54462
  if (error48) {
53944
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
54463
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
53945
54464
  flexDirection: "column",
53946
54465
  padding: 1,
53947
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
54466
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
53948
54467
  color: "red",
53949
54468
  children: [
53950
54469
  "Error: ",
@@ -53953,21 +54472,21 @@ function App2({ repoName: _repoName, currentPath, onSelect }) {
53953
54472
  }, undefined, true, undefined, this)
53954
54473
  }, undefined, false, undefined, this);
53955
54474
  }
53956
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
54475
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
53957
54476
  flexDirection: "column",
53958
54477
  children: [
53959
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(WorktreeList, {
54478
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(WorktreeList, {
53960
54479
  worktrees,
53961
54480
  selectedIndex,
53962
54481
  isLoading,
53963
54482
  currentPath: destinationPath
53964
54483
  }, undefined, false, undefined, this),
53965
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusBar, {}, undefined, false, undefined, this),
53966
- activeDialog === "create" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(CreateDialog, {
54484
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusBar, {}, undefined, false, undefined, this),
54485
+ activeDialog === "create" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(CreateDialog, {
53967
54486
  onClose: handleDialogClose,
53968
54487
  onCreated: handleCreated
53969
54488
  }, undefined, false, undefined, this),
53970
- activeDialog === "delete" && selectedWorktree && primaryWorktree && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(DeleteConfirm, {
54489
+ activeDialog === "delete" && selectedWorktree && primaryWorktree && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(DeleteConfirm, {
53971
54490
  worktree: selectedWorktree,
53972
54491
  primaryWorktree,
53973
54492
  currentPath,
@@ -53979,23 +54498,31 @@ function App2({ repoName: _repoName, currentPath, onSelect }) {
53979
54498
  handleDeleted();
53980
54499
  }
53981
54500
  }, undefined, false, undefined, this),
53982
- activeDialog === "rename" && selectedWorktree && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(RenameDialog, {
54501
+ activeDialog === "rename" && selectedWorktree && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(RenameDialog, {
53983
54502
  worktree: selectedWorktree,
53984
54503
  onClose: handleDialogClose,
53985
54504
  onRenamed: handleRenamed
53986
54505
  }, undefined, false, undefined, this),
53987
- activeDialog === "details" && selectedWorktree && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(DetailsView, {
54506
+ activeDialog === "details" && selectedWorktree && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(DetailsView, {
53988
54507
  worktree: selectedWorktree,
53989
54508
  onClose: handleDialogClose,
53990
54509
  onSelect: () => {
53991
54510
  setDestinationPath(selectedWorktree.path);
53992
54511
  setActiveDialog("none");
53993
54512
  }
54513
+ }, undefined, false, undefined, this),
54514
+ activeDialog === "settings" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(SettingsDialog, {
54515
+ repoId: repoName,
54516
+ onClose: handleDialogClose,
54517
+ onSaved: () => {
54518
+ refresh();
54519
+ setActiveDialog("none");
54520
+ }
53994
54521
  }, undefined, false, undefined, this)
53995
54522
  ]
53996
54523
  }, undefined, true, undefined, this);
53997
54524
  }
53998
- var import_react32, jsx_dev_runtime8;
54525
+ var import_react33, jsx_dev_runtime9;
53999
54526
  var init_App2 = __esm(async () => {
54000
54527
  init_useWorktrees();
54001
54528
  await __promiseAll([
@@ -54004,11 +54531,12 @@ var init_App2 = __esm(async () => {
54004
54531
  init_DeleteConfirm(),
54005
54532
  init_DetailsView(),
54006
54533
  init_RenameDialog(),
54534
+ init_SettingsDialog(),
54007
54535
  init_StatusBar(),
54008
54536
  init_WorktreeList()
54009
54537
  ]);
54010
- import_react32 = __toESM(require_react(), 1);
54011
- jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
54538
+ import_react33 = __toESM(require_react(), 1);
54539
+ jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
54012
54540
  });
54013
54541
 
54014
54542
  // src/tui/components/SetupFlow.tsx
@@ -54066,9 +54594,9 @@ ${command}
54066
54594
  }
54067
54595
  function SetupFlow({ onComplete, onQuit }) {
54068
54596
  const { exit } = use_app_default();
54069
- const [state, setState] = import_react33.useState("prompt");
54070
- const [error48, setError] = import_react33.useState(null);
54071
- const [isProcessing, setIsProcessing] = import_react33.useState(false);
54597
+ const [state, setState] = import_react34.useState("prompt");
54598
+ const [error48, setError] = import_react34.useState(null);
54599
+ const [isProcessing, setIsProcessing] = import_react34.useState(false);
54072
54600
  const shellInfo = detectShell();
54073
54601
  use_input_default(async (input, key) => {
54074
54602
  if (isProcessing)
@@ -54114,37 +54642,37 @@ function SetupFlow({ onComplete, onQuit }) {
54114
54642
  }
54115
54643
  });
54116
54644
  if (state === "success") {
54117
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54645
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54118
54646
  flexDirection: "column",
54119
54647
  padding: 1,
54120
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54648
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54121
54649
  borderStyle: "round",
54122
54650
  borderColor: theme.ui.success,
54123
54651
  paddingX: 2,
54124
54652
  paddingY: 1,
54125
54653
  flexDirection: "column",
54126
54654
  children: [
54127
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54655
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54128
54656
  bold: true,
54129
54657
  color: theme.ui.success,
54130
54658
  children: "✓ Shell integration installed!"
54131
54659
  }, undefined, false, undefined, this),
54132
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54660
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54133
54661
  marginTop: 1,
54134
54662
  flexDirection: "column",
54135
54663
  children: [
54136
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54664
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54137
54665
  children: [
54138
54666
  "Added to ",
54139
54667
  shellInfo.configPath
54140
54668
  ]
54141
54669
  }, undefined, true, undefined, this),
54142
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54670
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54143
54671
  dimColor: true,
54144
54672
  children: [
54145
54673
  "Restart your terminal or run:",
54146
54674
  " ",
54147
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54675
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54148
54676
  color: theme.accent,
54149
54677
  children: [
54150
54678
  "source ",
@@ -54155,9 +54683,9 @@ function SetupFlow({ onComplete, onQuit }) {
54155
54683
  }, undefined, true, undefined, this)
54156
54684
  ]
54157
54685
  }, undefined, true, undefined, this),
54158
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54686
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54159
54687
  marginTop: 1,
54160
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54688
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54161
54689
  dimColor: true,
54162
54690
  children: "Press any key to continue..."
54163
54691
  }, undefined, false, undefined, this)
@@ -54167,37 +54695,37 @@ function SetupFlow({ onComplete, onQuit }) {
54167
54695
  }, undefined, false, undefined, this);
54168
54696
  }
54169
54697
  if (state === "already-setup") {
54170
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54698
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54171
54699
  flexDirection: "column",
54172
54700
  padding: 1,
54173
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54701
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54174
54702
  borderStyle: "round",
54175
54703
  borderColor: theme.ui.warning,
54176
54704
  paddingX: 2,
54177
54705
  paddingY: 1,
54178
54706
  flexDirection: "column",
54179
54707
  children: [
54180
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54708
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54181
54709
  bold: true,
54182
54710
  color: theme.ui.warning,
54183
54711
  children: "Shell integration already configured"
54184
54712
  }, undefined, false, undefined, this),
54185
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54713
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54186
54714
  marginTop: 1,
54187
54715
  flexDirection: "column",
54188
54716
  children: [
54189
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54717
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54190
54718
  children: [
54191
54719
  'Found "wt shell-init" in ',
54192
54720
  shellInfo.configPath
54193
54721
  ]
54194
54722
  }, undefined, true, undefined, this),
54195
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54723
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54196
54724
  dimColor: true,
54197
54725
  children: [
54198
54726
  "Try restarting your terminal or run:",
54199
54727
  " ",
54200
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54728
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54201
54729
  color: theme.accent,
54202
54730
  children: [
54203
54731
  "source ",
@@ -54208,9 +54736,9 @@ function SetupFlow({ onComplete, onQuit }) {
54208
54736
  }, undefined, true, undefined, this)
54209
54737
  ]
54210
54738
  }, undefined, true, undefined, this),
54211
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54739
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54212
54740
  marginTop: 1,
54213
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54741
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54214
54742
  dimColor: true,
54215
54743
  children: "Press any key to continue..."
54216
54744
  }, undefined, false, undefined, this)
@@ -54220,48 +54748,48 @@ function SetupFlow({ onComplete, onQuit }) {
54220
54748
  }, undefined, false, undefined, this);
54221
54749
  }
54222
54750
  if (state === "error") {
54223
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54751
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54224
54752
  flexDirection: "column",
54225
54753
  padding: 1,
54226
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54754
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54227
54755
  borderStyle: "round",
54228
54756
  borderColor: theme.ui.error,
54229
54757
  paddingX: 2,
54230
54758
  paddingY: 1,
54231
54759
  flexDirection: "column",
54232
54760
  children: [
54233
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54761
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54234
54762
  bold: true,
54235
54763
  color: theme.ui.error,
54236
54764
  children: "✗ Failed to set up shell integration"
54237
54765
  }, undefined, false, undefined, this),
54238
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54766
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54239
54767
  marginTop: 1,
54240
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54768
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54241
54769
  color: theme.ui.error,
54242
54770
  children: error48
54243
54771
  }, undefined, false, undefined, this)
54244
54772
  }, undefined, false, undefined, this),
54245
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54773
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54246
54774
  marginTop: 1,
54247
54775
  flexDirection: "column",
54248
54776
  children: [
54249
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54777
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54250
54778
  children: [
54251
54779
  "You can manually add this to ",
54252
54780
  shellInfo.configPath,
54253
54781
  ":"
54254
54782
  ]
54255
54783
  }, undefined, true, undefined, this),
54256
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54784
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54257
54785
  color: theme.accent,
54258
54786
  children: shellInfo.command
54259
54787
  }, undefined, false, undefined, this)
54260
54788
  ]
54261
54789
  }, undefined, true, undefined, this),
54262
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54790
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54263
54791
  marginTop: 1,
54264
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54792
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54265
54793
  dimColor: true,
54266
54794
  children: "Press any key to continue..."
54267
54795
  }, undefined, false, undefined, this)
@@ -54270,56 +54798,56 @@ function SetupFlow({ onComplete, onQuit }) {
54270
54798
  }, undefined, true, undefined, this)
54271
54799
  }, undefined, false, undefined, this);
54272
54800
  }
54273
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54801
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54274
54802
  flexDirection: "column",
54275
54803
  padding: 1,
54276
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54804
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54277
54805
  borderStyle: "round",
54278
54806
  borderColor: theme.accent,
54279
54807
  paddingX: 2,
54280
54808
  paddingY: 1,
54281
54809
  flexDirection: "column",
54282
54810
  children: [
54283
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54811
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54284
54812
  bold: true,
54285
54813
  color: theme.accent,
54286
54814
  children: "Shell Integration Setup"
54287
54815
  }, undefined, false, undefined, this),
54288
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54816
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54289
54817
  marginTop: 1,
54290
54818
  flexDirection: "column",
54291
54819
  children: [
54292
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54820
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54293
54821
  children: [
54294
54822
  "Shell integration lets you ",
54295
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54823
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54296
54824
  bold: true,
54297
54825
  children: "cd"
54298
54826
  }, undefined, false, undefined, this),
54299
54827
  " into worktrees by selecting them in the TUI."
54300
54828
  ]
54301
54829
  }, undefined, true, undefined, this),
54302
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54830
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54303
54831
  dimColor: true,
54304
54832
  children: "Without it, selections just print the path."
54305
54833
  }, undefined, false, undefined, this)
54306
54834
  ]
54307
54835
  }, undefined, true, undefined, this),
54308
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54836
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54309
54837
  marginTop: 1,
54310
54838
  flexDirection: "column",
54311
54839
  children: [
54312
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54840
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54313
54841
  children: [
54314
54842
  "Detected shell:",
54315
54843
  " ",
54316
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54844
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54317
54845
  color: theme.ui.success,
54318
54846
  children: shellInfo.name
54319
54847
  }, undefined, false, undefined, this)
54320
54848
  ]
54321
54849
  }, undefined, true, undefined, this),
54322
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54850
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54323
54851
  dimColor: true,
54324
54852
  children: [
54325
54853
  "Will add to: ",
@@ -54328,72 +54856,72 @@ function SetupFlow({ onComplete, onQuit }) {
54328
54856
  }, undefined, true, undefined, this)
54329
54857
  ]
54330
54858
  }, undefined, true, undefined, this),
54331
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54859
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54332
54860
  marginTop: 1,
54333
54861
  flexDirection: "column",
54334
54862
  children: [
54335
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54863
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54336
54864
  dimColor: true,
54337
54865
  children: "Command to be added:"
54338
54866
  }, undefined, false, undefined, this),
54339
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54867
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54340
54868
  color: theme.accent,
54341
54869
  children: shellInfo.command
54342
54870
  }, undefined, false, undefined, this)
54343
54871
  ]
54344
54872
  }, undefined, true, undefined, this),
54345
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54873
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54346
54874
  marginTop: 1,
54347
54875
  flexDirection: "column",
54348
54876
  gap: 0,
54349
54877
  children: [
54350
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54878
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54351
54879
  children: [
54352
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54880
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54353
54881
  color: theme.accent,
54354
54882
  bold: true,
54355
54883
  children: "y"
54356
54884
  }, undefined, false, undefined, this),
54357
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54885
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54358
54886
  dimColor: true,
54359
54887
  children: " - Set up now (recommended)"
54360
54888
  }, undefined, false, undefined, this)
54361
54889
  ]
54362
54890
  }, undefined, true, undefined, this),
54363
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54891
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54364
54892
  children: [
54365
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54893
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54366
54894
  color: theme.accent,
54367
54895
  bold: true,
54368
54896
  children: "s"
54369
54897
  }, undefined, false, undefined, this),
54370
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54898
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54371
54899
  dimColor: true,
54372
54900
  children: " - Skip for now"
54373
54901
  }, undefined, false, undefined, this)
54374
54902
  ]
54375
54903
  }, undefined, true, undefined, this),
54376
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54904
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54377
54905
  children: [
54378
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54906
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54379
54907
  color: theme.accent,
54380
54908
  bold: true,
54381
54909
  children: "n"
54382
54910
  }, undefined, false, undefined, this),
54383
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54911
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54384
54912
  dimColor: true,
54385
54913
  children: " - Don't ask again"
54386
54914
  }, undefined, false, undefined, this)
54387
54915
  ]
54388
54916
  }, undefined, true, undefined, this),
54389
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54917
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54390
54918
  children: [
54391
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54919
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54392
54920
  color: theme.accent,
54393
54921
  bold: true,
54394
54922
  children: "q"
54395
54923
  }, undefined, false, undefined, this),
54396
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54924
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54397
54925
  dimColor: true,
54398
54926
  children: " - Quit"
54399
54927
  }, undefined, false, undefined, this)
@@ -54401,9 +54929,9 @@ function SetupFlow({ onComplete, onQuit }) {
54401
54929
  }, undefined, true, undefined, this)
54402
54930
  ]
54403
54931
  }, undefined, true, undefined, this),
54404
- isProcessing && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
54932
+ isProcessing && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
54405
54933
  marginTop: 1,
54406
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
54934
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
54407
54935
  dimColor: true,
54408
54936
  children: "Setting up..."
54409
54937
  }, undefined, false, undefined, this)
@@ -54412,14 +54940,14 @@ function SetupFlow({ onComplete, onQuit }) {
54412
54940
  }, undefined, true, undefined, this)
54413
54941
  }, undefined, false, undefined, this);
54414
54942
  }
54415
- var import_react33, jsx_dev_runtime9;
54943
+ var import_react34, jsx_dev_runtime10;
54416
54944
  var init_SetupFlow = __esm(async () => {
54417
54945
  init_preferences();
54418
54946
  init_compat();
54419
54947
  init_theme();
54420
54948
  await init_build2();
54421
- import_react33 = __toESM(require_react(), 1);
54422
- jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
54949
+ import_react34 = __toESM(require_react(), 1);
54950
+ jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
54423
54951
  });
54424
54952
 
54425
54953
  // src/tui/index.ts
@@ -54438,7 +54966,7 @@ function hasShellIntegration() {
54438
54966
  }
54439
54967
  async function showSetupFlow() {
54440
54968
  return new Promise((resolve2) => {
54441
- const { waitUntilExit } = render_default(import_react34.default.createElement(SetupFlow, {
54969
+ const { waitUntilExit } = render_default(import_react35.default.createElement(SetupFlow, {
54442
54970
  onComplete: () => resolve2(true),
54443
54971
  onQuit: () => resolve2(false)
54444
54972
  }), getRenderOptions());
@@ -54449,7 +54977,7 @@ async function showMainTui(repoName) {
54449
54977
  return new Promise((resolve2) => {
54450
54978
  let selectedPath = null;
54451
54979
  const currentPath = process.cwd();
54452
- const { waitUntilExit } = render_default(import_react34.default.createElement(App2, {
54980
+ const { waitUntilExit } = render_default(import_react35.default.createElement(App2, {
54453
54981
  repoName,
54454
54982
  currentPath,
54455
54983
  onSelect: (path) => {
@@ -54485,7 +55013,7 @@ async function launchTui() {
54485
55013
  }
54486
55014
  return showMainTui(repoInfo.repoId);
54487
55015
  }
54488
- var import_react34;
55016
+ var import_react35;
54489
55017
  var init_tui = __esm(async () => {
54490
55018
  init_source();
54491
55019
  init_repo();
@@ -54495,7 +55023,7 @@ var init_tui = __esm(async () => {
54495
55023
  init_App2(),
54496
55024
  init_SetupFlow()
54497
55025
  ]);
54498
- import_react34 = __toESM(require_react(), 1);
55026
+ import_react35 = __toESM(require_react(), 1);
54499
55027
  if (!process.env.NO_COLOR) {
54500
55028
  source_default.level = 3;
54501
55029
  }
@@ -54923,7 +55451,7 @@ wt() {
54923
55451
  # Check for cd handoff (TUI selection)
54924
55452
  # Output format is __wt_cd__"/path/to/dir" (quoted to handle spaces)
54925
55453
  if [[ "$output" == __wt_cd__* ]]; then
54926
- eval cd "\${output#__wt_cd__}"
55454
+ eval cd \${output#__wt_cd__}
54927
55455
  elif [[ -n "$output" ]]; then
54928
55456
  echo "$output"
54929
55457
  fi