gitforest 1.0.0 → 1.1.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitforest",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "TUI for managing multiple Git repositories and GitHub integration",
5
5
  "module": "src/index.tsx",
6
6
  "type": "module",
@@ -323,8 +323,8 @@ export function HybridDirectoryBrowser({ startingPath, onSelect, onCancel }: Hyb
323
323
  return;
324
324
  }
325
325
 
326
- // Space or Enter: select folder from filtered list or navigate current path
327
- if (input === " " || key.return) {
326
+ // Space: select folder from filtered list and navigate
327
+ if (input === " ") {
328
328
  // If there's a selected folder in filtered list, navigate into it
329
329
  if (filteredEntries.length > 0 && browser.selectedFolderIndex < filteredEntries.length) {
330
330
  const selectedEntry = filteredEntries[browser.selectedFolderIndex]!;
@@ -346,26 +346,26 @@ export function HybridDirectoryBrowser({ startingPath, onSelect, onCancel }: Hyb
346
346
  return;
347
347
  }
348
348
 
349
- // Otherwise, accept current path
350
- if (key.return) {
351
- const targetPath = browser.inputBuffer.replace(/\/$/, "") || browser.currentPath;
352
- const validation = validateDirectoryPath(targetPath);
353
- if (validation.valid) {
354
- onSelect(targetPath);
355
- } else {
356
- setBrowser((prev) => ({
357
- ...prev,
358
- error: validation.error || "Invalid path",
359
- }));
360
- }
361
- return;
362
- }
363
-
364
349
  // Space on current path with no selection
365
350
  onSelect(browser.currentPath);
366
351
  return;
367
352
  }
368
353
 
354
+ // Enter: accept current path and continue
355
+ if (key.return) {
356
+ const targetPath = browser.inputBuffer.replace(/\/$/, "") || browser.currentPath;
357
+ const validation = validateDirectoryPath(targetPath);
358
+ if (validation.valid) {
359
+ onSelect(targetPath);
360
+ } else {
361
+ setBrowser((prev) => ({
362
+ ...prev,
363
+ error: validation.error || "Invalid path",
364
+ }));
365
+ }
366
+ return;
367
+ }
368
+
369
369
  // Ctrl+U: clear input back to ~
370
370
  if (key.ctrl && input === 'u') {
371
371
  setBrowser((prev) => ({
@@ -474,7 +474,7 @@ export function HybridDirectoryBrowser({ startingPath, onSelect, onCancel }: Hyb
474
474
  <Box flexDirection="column" marginTop={1}>
475
475
  <Box gap={2}>
476
476
  <Text dimColor>Tab:</Text>
477
- <Text dimColor>complete</Text>
477
+ <Text dimColor>autocomplete</Text>
478
478
  <Text dimColor>j/k:</Text>
479
479
  <Text dimColor>navigate</Text>
480
480
  <Text dimColor>Space:</Text>
@@ -482,7 +482,7 @@ export function HybridDirectoryBrowser({ startingPath, onSelect, onCancel }: Hyb
482
482
  </Box>
483
483
  <Box gap={2}>
484
484
  <Text dimColor>Enter:</Text>
485
- <Text dimColor>select</Text>
485
+ <Text dimColor>select & continue</Text>
486
486
  <Text dimColor>Esc:</Text>
487
487
  <Text dimColor>go back</Text>
488
488
  </Box>
@@ -6,7 +6,7 @@ import { DirectoriesStep } from "./DirectoriesStep.tsx";
6
6
  import { GitHubAuthStep } from "./GitHubAuthStep.tsx";
7
7
  import { CompleteStep } from "./CompleteStep.tsx";
8
8
 
9
- type Step = "welcome" | "directories" | "github" | "complete";
9
+ type Step = "welcome" | "directories" | "github" | "complete" | "done";
10
10
 
11
11
  interface DirectoryConfig {
12
12
  path: string;
@@ -27,6 +27,7 @@ export interface OnboardingWizardProps {
27
27
 
28
28
  export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps) {
29
29
  const [currentStep, setCurrentStep] = useState<Step>("welcome");
30
+ const [shouldExit, setShouldExit] = useState(false);
30
31
  const [directories, setDirectories] = useState<DirectoryConfig[]>([]);
31
32
  const [githubAuth, setGithubAuth] = useState<GitHubAuthState>({
32
33
  authenticated: false,
@@ -66,9 +67,10 @@ export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps
66
67
  // Config created successfully, show complete step
67
68
  setCurrentStep("complete");
68
69
  setIsCreatingConfig(false);
69
- // Auto-complete after showing success
70
+ // Auto-complete after showing success, then exit
70
71
  setTimeout(() => {
71
72
  onComplete(config);
73
+ setShouldExit(true);
72
74
  }, 2000);
73
75
  } catch (error) {
74
76
  setConfigError(error instanceof Error ? error.message : "Failed to create config");
@@ -96,6 +98,11 @@ export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps
96
98
  }
97
99
  };
98
100
 
101
+ // Exit the wizard when shouldExit is true
102
+ if (shouldExit) {
103
+ return null;
104
+ }
105
+
99
106
  return (
100
107
  <Box flexDirection="column">
101
108
  {currentStep === "welcome" && (
package/src/index.tsx CHANGED
@@ -261,6 +261,7 @@ async function runOnboardingWizard(): Promise<void> {
261
261
  />
262
262
  );
263
263
 
264
+ // Wait for completion or cancellation
264
265
  await waitUntilExit();
265
266
 
266
267
  if (cancelled) {