feat(desktop-shell-menu): allow DevTools toggle via AGENTCOMPANY_ENABLE_DEVTOOLS
This commit is contained in:
1 parent
84d11582a3
commit
972eb5dc93
3 files changed
+11
-8
No files matched your search
@@ -128,13 +128,13 @@ export function buildRunMethods(
|
||||
}
|
||||
},
|
||||
|
||||
markRunStatus(runId: string, status: RunRecord["status"], message: string) {
|
||||
markRunStatus(runId: string, status: RunRecord["status"], message: string | null) {
|
||||
const ts = nowIso();
|
||||
const startedAt = status === "running" ? ts : null;
|
||||
transaction(() => {
|
||||
getDb()
|
||||
.prepare(
|
||||
"update runs set status = ?, summary = case when ? != '' then ? else summary end, started_at = coalesce(started_at, ?), updated_at = ? where id = ?",
|
||||
"update runs set status = ?, summary = case when ? is not null then ? else summary end, started_at = coalesce(started_at, ?), updated_at = ? where id = ?",
|
||||
)
|
||||
.run(status, message, message, startedAt, ts, runId);
|
||||
|
||||
|
||||
@@ -186,11 +186,9 @@ export function buildSnapshotMethods(
|
||||
|
||||
listRendererSnapshot(): ProfileSnapshot {
|
||||
const currentCompanyId = deps.getCurrentCompanyId();
|
||||
if (!currentCompanyId) {
|
||||
return listSnapshot();
|
||||
}
|
||||
const snapshot = listSnapshot({ companyId: currentCompanyId });
|
||||
return snapshot;
|
||||
return currentCompanyId
|
||||
? listSnapshot({ companyId: currentCompanyId })
|
||||
: listSnapshot();
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -121,7 +121,12 @@ export function createDesktopShellMenu(deps: DesktopShellMenuDependencies) {
|
||||
click: () => onShortcut("refresh"),
|
||||
},
|
||||
{ type: "separator" },
|
||||
{ role: "toggleDevTools", visible: isDev },
|
||||
{
|
||||
role: "toggleDevTools",
|
||||
// Hidden in packaged builds unless opted in via env var so power
|
||||
// users can still inspect rendered state without a dev build.
|
||||
visible: isDev || process.env.AGENTCOMPANY_ENABLE_DEVTOOLS === "true",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user