mintree 0.3.1 → 0.3.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.
|
@@ -988,14 +988,19 @@ export default function Dashboard() {
|
|
|
988
988
|
// Surface the spinner BEFORE the heavy sync work. runCreate /
|
|
989
989
|
// runCreateDetached both block the event loop (execSync: git fetch +
|
|
990
990
|
// worktree add + optional .mintree/init.sh — easily several seconds on
|
|
991
|
-
// slow remotes or a repo with a real init script). Without
|
|
992
|
-
//
|
|
993
|
-
//
|
|
991
|
+
// slow remotes or a repo with a real init script). Without yielding
|
|
992
|
+
// here, Ink wouldn't get to paint the spinner before execSync blocks
|
|
993
|
+
// the event loop, leaving the user staring at a frozen overlay.
|
|
994
|
+
//
|
|
995
|
+
// A single setImmediate isn't enough: React 19 commits the state on
|
|
996
|
+
// the next microtask, then Ink schedules its stdout write on a later
|
|
997
|
+
// macrotask. A ~32ms setTimeout (two frames at 60fps) covers both
|
|
998
|
+
// phases reliably without being perceptible.
|
|
994
999
|
setState({
|
|
995
1000
|
...state,
|
|
996
1001
|
overlay: { ...overlay, error: null, pending: "Creating worktree..." },
|
|
997
1002
|
});
|
|
998
|
-
await new Promise((resolve) =>
|
|
1003
|
+
await new Promise((resolve) => setTimeout(resolve, 32));
|
|
999
1004
|
const prompt = overlay.prompt.trim();
|
|
1000
1005
|
const issueId = overlay.issue.issue.id;
|
|
1001
1006
|
let result;
|
package/package.json
CHANGED