inplan 0.3.10 → 0.3.11
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/app/main/index.cjs
CHANGED
|
@@ -1695,6 +1695,13 @@ ${body.replace(/\s*$/, "")}
|
|
|
1695
1695
|
}
|
|
1696
1696
|
});
|
|
1697
1697
|
let restarting = false;
|
|
1698
|
+
const logRestart = (msg) => {
|
|
1699
|
+
try {
|
|
1700
|
+
node_fs.appendFileSync(node_path.join(node_os.homedir(), ".inplan", "restart.log"), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
|
|
1701
|
+
`);
|
|
1702
|
+
} catch {
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1698
1705
|
electron.ipcMain.handle("app:restart", async () => {
|
|
1699
1706
|
const file = session?.paths.file;
|
|
1700
1707
|
const cli = process.env.INPLAN_CLI;
|
|
@@ -1705,19 +1712,31 @@ ${body.replace(/\s*$/, "")}
|
|
|
1705
1712
|
dir = node_fs.mkdtempSync(node_path.join(node_os.tmpdir(), "inplan-restart-"));
|
|
1706
1713
|
const readyPath = node_path.join(dir, "ready");
|
|
1707
1714
|
const { ELECTRON_RUN_AS_NODE: _runAsNode, ...env } = process.env;
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
}
|
|
1715
|
+
const attempts = [];
|
|
1716
|
+
if (process.env.INPLAN_NODE) attempts.push([process.env.INPLAN_NODE, {}]);
|
|
1717
|
+
attempts.push(["node", {}], [process.execPath, { ELECTRON_RUN_AS_NODE: "1" }]);
|
|
1718
|
+
let launched = false;
|
|
1719
|
+
for (const [exe, extra] of attempts) {
|
|
1720
|
+
launched = await new Promise((done) => {
|
|
1721
|
+
node_child_process.execFile(exe, [cli, "launch-editor", file], { env: { ...env, ...extra, INPLAN_RESTART_READY: readyPath }, timeout: 2e4 }, (err, stdout, stderr) => {
|
|
1722
|
+
try {
|
|
1723
|
+
done(!err && JSON.parse(stdout.trim()).status === "launched");
|
|
1724
|
+
} catch {
|
|
1725
|
+
done(false);
|
|
1726
|
+
} finally {
|
|
1727
|
+
if (err) logRestart(`launch via ${exe} failed: ${err.message} ${stderr.trim()}`);
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1715
1730
|
});
|
|
1716
|
-
|
|
1731
|
+
if (launched) break;
|
|
1732
|
+
}
|
|
1717
1733
|
if (!launched) return { ok: false };
|
|
1718
1734
|
const deadline = Date.now() + 15e3;
|
|
1719
1735
|
while (!node_fs.existsSync(readyPath)) {
|
|
1720
|
-
if (Date.now() >= deadline)
|
|
1736
|
+
if (Date.now() >= deadline) {
|
|
1737
|
+
logRestart("the replacement started but never reported ready");
|
|
1738
|
+
return { ok: false };
|
|
1739
|
+
}
|
|
1721
1740
|
await new Promise((done) => setTimeout(done, 100));
|
|
1722
1741
|
}
|
|
1723
1742
|
} catch {
|
|
@@ -47324,13 +47324,17 @@ function App(props = {}) {
|
|
|
47324
47324
|
reactExports.useEffect(() => {
|
|
47325
47325
|
if (!loaded || !pendingFocusCommentId) return;
|
|
47326
47326
|
const id2 = pendingFocusCommentId;
|
|
47327
|
-
setPendingFocusCommentId(null);
|
|
47328
47327
|
const c = doc2.comments.find((x2) => x2.id === id2);
|
|
47329
47328
|
const rootId = c?.parentId ?? id2;
|
|
47330
47329
|
if (!visible.some((o) => o.thread.root.id === rootId)) setShowResolvedOrphaned(true);
|
|
47331
|
-
|
|
47330
|
+
if (panes === 1) setCommentOverlay(true);
|
|
47331
|
+
if (panes === 2 && rightTab !== "comments") setRightTab("comments");
|
|
47332
|
+
const raf = requestAnimationFrame(() => {
|
|
47333
|
+
focusComment(id2);
|
|
47334
|
+
setPendingFocusCommentId(null);
|
|
47335
|
+
});
|
|
47332
47336
|
return () => cancelAnimationFrame(raf);
|
|
47333
|
-
}, [loaded, pendingFocusCommentId, focusComment, doc2.comments, visible]);
|
|
47337
|
+
}, [loaded, pendingFocusCommentId, focusComment, doc2.comments, visible, panes, rightTab]);
|
|
47334
47338
|
const revealTip = resolvedCount > 0 && orphanedCount > 0 ? t2("rail.showResolved", { resolved: resolvedCount, orphaned: orphanedCount }) : resolvedCount > 0 ? t2("rail.showResolvedOnly", { resolved: resolvedCount }) : t2("rail.showOrphanedOnly", { orphaned: orphanedCount });
|
|
47335
47339
|
const selBlocker = reactExports.useMemo(() => {
|
|
47336
47340
|
const sel = window.getSelection();
|
package/app/renderer/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' inplan-plugin:; img-src 'self' file: https:; connect-src 'self' inplan-plugin: ws://127.0.0.1:* ws://localhost:*; frame-src https://inplan.ai http://127.0.0.1:* http://localhost:*"
|
|
22
22
|
/>
|
|
23
23
|
<title>inplan</title>
|
|
24
|
-
<script type="module" crossorigin src="./assets/index-
|
|
24
|
+
<script type="module" crossorigin src="./assets/index-ZIjVITZE.js"></script>
|
|
25
25
|
<link rel="stylesheet" crossorigin href="./assets/index-CD5LIK6f.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
package/bin/cli.js
CHANGED
|
@@ -2888,7 +2888,7 @@ function resolveBundledApp() {
|
|
|
2888
2888
|
}
|
|
2889
2889
|
function spawnApp(file) {
|
|
2890
2890
|
const { ELECTRON_RUN_AS_NODE: _runAsNode, ...inherited } = process.env;
|
|
2891
|
-
const env = { ...inherited, INPLAN_CLI: process.argv[1] ?? "" };
|
|
2891
|
+
const env = { ...inherited, INPLAN_CLI: process.argv[1] ?? "", ...process.versions.electron ? {} : { INPLAN_NODE: process.execPath } };
|
|
2892
2892
|
const override = process.env.INPLAN_APP_CMD;
|
|
2893
2893
|
if (override) {
|
|
2894
2894
|
const child = spawn3(override, [file], { detached: true, stdio: "ignore", shell: true, env });
|