Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

refactor: silence double toasts in apps/github/misc client sites (#2669)

[._.]/ Adam Eivy2547962bbd28
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 7680525bd8..c15fedb9c9 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -18,6 +18,7 @@
- The Chief of Staff status panel's Learning card no longer spills its skipped-task count outside the card on mobile. The "(3 skipped)" note used to sit beside the success rate on one line, where it was too wide to fit a narrow card and rendered past the border; it now sits on its own line under the percentage and truncates if it can't fit.
- The Brain **Graph** tab is now usable on a phone. The graph canvas sizes itself to the viewport instead of a fixed 500px (which overflowed a landscape phone entirely and left no room to scroll past a canvas that swallows drags), the controls bar stacks into readable rows instead of cramming a breadcrumb, seven type filters, and both buttons into one line, and the type filters wrap with a proper tap target. The legend — ten rows that blanketed a phone-sized graph — now shows automatically only when there's room for it and collapses behind a "Legend" toggle everywhere else, including a landscape phone (which is wide enough to look like a desktop but far too short). The hover tooltip no longer flashes under your finger advertising a double-click that touch can't do (tap the node and use the detail panel's "Explore connections" instead), and it no longer runs off the right edge in a narrow window. "Explore connections" moved out of a cramped side column onto its own full-width row, above the record text so it stays reachable on a long entry.
+- [issue-2669] The Apps, GitHub, Tribe, Authors, Ask, and Browser screens no longer show two stacked error toasts when an action fails — the custom-catch callers now pass `{ silent: true }` so only their own toast fires, not the shared `request()` helper's default one too. Swept the apps/GitHub/misc area (the app Git tab's branch delete/merge/checkout/cleanup, the reference-repos panel, app build, the GitHub repo sync/flag/archive and secret save/sync actions, Tribe person + touchpoint + memory-link CRUD, the Authors list and CRUD, Ask turn promotion and conversation delete, and Browser navigate) and threaded a backward-compatible `options` arg into the affected API wrappers (`deleteBranch`, `mergeBranch`, `checkoutRemoteBranch`, `cleanupMergedBranches`, the GitHub repo/secret calls, the reference-repo calls, `buildApp`, the Tribe person/touchpoint/memory calls, `promoteAskTurn`, and `deleteAskConversation`).
- [issue-2669] The Series Pipeline no longer shows two stacked error toasts when a stage or arc action fails — the custom-catch callers now pass `{ silent: true }` so only their own toast fires, not the shared `request()` helper's default one too. Swept the pipeline stages/canvas area (ArcCanvas, the Audio/ComicPages/ComicScript/Storyboards/Idea stages, and the Pipeline series/issue/manuscript-editor pages, including the `useLockToggle` volume lock and the `useAsyncAction` editorial review) and threaded a backward-compatible `options` arg into the affected API wrappers (arc generate/verify/resolve/derive, volume beats + episodes, season and issue CRUD, stage generate/extract/render/refine, manuscript fetch + completeness, and the audio line/music-library calls).
- **The Review Hub no longer files alerts for browser-extension errors.** Extensions (crypto wallets, password managers, ad blockers) inject scripts into the page, so anything they throw — "Failed to connect to MetaMask" and friends — used to surface as an actionable PortOS alert even though nothing in the app can fix it. Those errors are now identified by their provenance (the failing script lives at a `chrome-extension://` / `moz-extension://` / Safari-extension URL) and dropped both in the browser and on the server, with a narrow message check for wallet rejections that arrive with no stack at all. Any such alerts already sitting in your hub are dismissed once on upgrade, so you don't have to clear them by hand. This also stops extension noise from crowding out real errors: each end accepts at most one error per second, so an extension error used to silently swallow a genuine PortOS failure that happened a moment later.
- **Every toast crashed when PortOS was reached over plain HTTP.** Toast ids were minted with `crypto.randomUUID()`, which browsers only expose on secure origins — so over Tailscale on `http://`, any toast threw `crypto.randomUUID is not a function`, including the error toasts meant to tell you a request had failed. Ids now come from a shared `uuidv4()` helper that falls back to `crypto.getRandomValues` (available on insecure origins) and still yields a spec-valid v4. This is what produced the `crypto.randomUUID` alerts in the Review Hub — it was PortOS's own bug, not an extension, so it is deliberately still reported.
diff --git a/client/src/components/apps/AppDetailView.jsx b/client/src/components/apps/AppDetailView.jsx
index 8a2fa5b896..bc8e9cbdcf 100644
--- a/client/src/components/apps/AppDetailView.jsx
+++ b/client/src/components/apps/AppDetailView.jsx
@@ -107,7 +107,7 @@ export default function AppDetailView() {
const handleBuild = async () => {
setBuildLoading(true);
const isSelfBuild = appId === api.PORTOS_APP_ID;
- const result = await api.buildApp(appId).catch(err => {
+ const result = await api.buildApp(appId, { silent: true }).catch(err => {
// Self-build may cause a socket hangup as the server restarts — that's expected
if (isSelfBuild) return { selfBuildTriggered: true };
toast.error(`Build failed: ${err.message}`);
diff --git a/client/src/components/apps/ReferenceReposPanel.jsx b/client/src/components/apps/ReferenceReposPanel.jsx
index e49495e74f..4bf0b722c3 100644
--- a/client/src/components/apps/ReferenceReposPanel.jsx
+++ b/client/src/components/apps/ReferenceReposPanel.jsx
@@ -84,7 +84,7 @@ export default function ReferenceReposPanel({ appId, appName }) {
}, [appId]);
const handleAdd = async (form) => {
- const created = await api.addReferenceRepo(appId, form).catch((e) => { toast.error(e.message || 'Add failed'); return null; });
+ const created = await api.addReferenceRepo(appId, form, { silent: true }).catch((e) => { toast.error(e.message || 'Add failed'); return null; });
if (!created) return;
toast.success(`Added "${created.name}"`);
setShowAdd(false);
@@ -105,7 +105,7 @@ export default function ReferenceReposPanel({ appId, appName }) {
// Only mutate local state on success — otherwise the row vanishes from
// the UI while the server still has the ref, leaving the user confused
// about why "delete failed" appeared next to a now-empty list.
- const ok = await api.deleteReferenceRepo(appId, ref.id)
+ const ok = await api.deleteReferenceRepo(appId, ref.id, { silent: true })
.then(() => true)
.catch((e) => { toast.error(e.message || 'Delete failed'); return false; });
if (!ok) return;
@@ -117,7 +117,7 @@ export default function ReferenceReposPanel({ appId, appName }) {
// Add this ref's id to the in-flight set so its spinner stays on
// while it runs, even if a different ref's check completes first.
setCheckingIds((prev) => { const n = new Set(prev); n.add(ref.id); return n; });
- const snap = await api.checkReferenceRepo(appId, ref.id).catch((e) => {
+ const snap = await api.checkReferenceRepo(appId, ref.id, { silent: true }).catch((e) => {
toast.error(e.message || 'Check failed');
return null;
});
@@ -159,7 +159,7 @@ export default function ReferenceReposPanel({ appId, appName }) {
// PATCH. Otherwise the UI claims the ref was reviewed while the server
// still has the old lastReviewedSha — which gets confusing fast since
// the next "Check" rediscovers the same commits.
- const ok = await api.markReferenceRepoReviewed(appId, ref.id, sha)
+ const ok = await api.markReferenceRepoReviewed(appId, ref.id, sha, { silent: true })
.then(() => true)
.catch((e) => { toast.error(e.message || 'Mark reviewed failed'); return false; });
if (!ok) return;
@@ -172,7 +172,7 @@ export default function ReferenceReposPanel({ appId, appName }) {
// Keep the editor open on a failed PATCH — losing the user's draft on
// a transient network blip is the worst possible outcome here. They
// can re-click Save, or click Cancel to discard.
- const ok = await api.updateReferenceRepo(appId, ref.id, { notes: nextNotes })
+ const ok = await api.updateReferenceRepo(appId, ref.id, { notes: nextNotes }, { silent: true })
.then(() => true)
.catch((e) => { toast.error(e.message || 'Update failed'); return false; });
if (!ok) return;
diff --git a/client/src/components/apps/tabs/GitTab.jsx b/client/src/components/apps/tabs/GitTab.jsx
index af0c7195ab..7d847581ce 100644
--- a/client/src/components/apps/tabs/GitTab.jsx
+++ b/client/src/components/apps/tabs/GitTab.jsx
@@ -263,7 +263,7 @@ export default function GitTab({ appId: _appId, appName, repoPath }) {
if (!repoPath || deleting) return;
setDeleting(branchName);
setDeleteConfirm(null);
- const result = await api.deleteBranch(repoPath, branchName, { local, remote }).catch((err) => {
+ const result = await api.deleteBranch(repoPath, branchName, { local, remote }, { silent: true }).catch((err) => {
toast.error(`Delete failed: ${err.message}`);
return null;
});
@@ -299,7 +299,7 @@ export default function GitTab({ appId: _appId, appName, repoPath }) {
if (!repoPath || merging) return;
setMerging(branchName);
setMergeConfirm(null);
- const result = await api.mergeBranch(repoPath, branchName).catch((err) => {
+ const result = await api.mergeBranch(repoPath, branchName, { silent: true }).catch((err) => {
toast.error(`Merge failed: ${err.message}`);
return null;
});
@@ -313,7 +313,7 @@ export default function GitTab({ appId: _appId, appName, repoPath }) {
const handleCheckoutRemote = async (branchName) => {
if (!repoPath || checkingOutRemote) return;
setCheckingOutRemote(branchName);
- const result = await api.checkoutRemoteBranch(repoPath, branchName).catch((err) => {
+ const result = await api.checkoutRemoteBranch(repoPath, branchName, { silent: true }).catch((err) => {
toast.error(`Checkout failed: ${err.message}`);
return null;
});
@@ -337,7 +337,7 @@ export default function GitTab({ appId: _appId, appName, repoPath }) {
if (!repoPath || cleaningUp) return;
setCleaningUp(true);
setCleanupConfirm(false);
- const result = await api.cleanupMergedBranches(repoPath).catch((err) => {
+ const result = await api.cleanupMergedBranches(repoPath, { silent: true }).catch((err) => {
toast.error(`Cleanup failed: ${err.message}`);
return null;
});
diff --git a/client/src/pages/Ask.jsx b/client/src/pages/Ask.jsx
index e024cfa00b..ae9681437d 100644
--- a/client/src/pages/Ask.jsx
+++ b/client/src/pages/Ask.jsx
@@ -132,7 +132,7 @@ function PromoteBar({ conversationId, turn, goals, onPromoted }) {
const promote = useCallback(async (payload) => {
setPending(payload.target);
- const data = await api.promoteAskTurn(conversationId, turn.id, payload).catch((err) => {
+ const data = await api.promoteAskTurn(conversationId, turn.id, payload, { silent: true }).catch((err) => {
toast.error(err?.message || 'Promote failed');
return null;
});
@@ -436,7 +436,7 @@ export default function Ask() {
// Only mutate local state if the server confirms the delete — otherwise
// a transient failure would hide a row that's still on disk and would
// pop back on the next list refresh.
- const ok = await api.deleteAskConversation(id).then(() => true, (err) => {
+ const ok = await api.deleteAskConversation(id, { silent: true }).then(() => true, (err) => {
toast.error(err?.message || 'Failed to delete conversation');
return false;
});
diff --git a/client/src/pages/Authors.jsx b/client/src/pages/Authors.jsx
index d7a757c0ef..a040182959 100644
--- a/client/src/pages/Authors.jsx
+++ b/client/src/pages/Authors.jsx
@@ -182,7 +182,7 @@ export default function Authors() {
};
useEffect(() => {
- listAuthors()
+ listAuthors({ silent: true })
.then((list) => setAuthors(Array.isArray(list) ? list : []))
.catch((err) => toast.error(err.message || 'Failed to load authors'))
.finally(() => setLoading(false));
@@ -226,7 +226,7 @@ export default function Authors() {
setSaving(true);
const payload = { ...form, name };
if (isCreate) {
- const created = await createAuthor(payload).catch((err) => {
+ const created = await createAuthor(payload, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to create author');
return null;
});
@@ -236,7 +236,7 @@ export default function Authors() {
navigate(`/authors/${encodeURIComponent(created.id)}`);
toast.success(`Created "${created.name}"`);
} else {
- const updated = await updateAuthor(authorId, payload).catch((err) => {
+ const updated = await updateAuthor(authorId, payload, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to save author');
return null;
});
@@ -255,7 +255,7 @@ export default function Authors() {
setAuthors((prev) => prev.filter((a) => a.id !== selected.id));
setConfirmDelete(false);
navigate('/authors');
- await deleteAuthor(selected.id).catch((err) => {
+ await deleteAuthor(selected.id, { silent: true }).catch((err) => {
toast.error(err.message || 'Delete failed');
setAuthors(prior);
});
diff --git a/client/src/pages/Browser.jsx b/client/src/pages/Browser.jsx
index ecdd6e4b76..01ea5d7a50 100644
--- a/client/src/pages/Browser.jsx
+++ b/client/src/pages/Browser.jsx
@@ -129,7 +129,7 @@ export default function BrowserPage() {
if (!trimmed) return;
const url = /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
setActionLoading('navigate');
- const result = await navigateBrowser(url).catch(err => {
+ const result = await navigateBrowser(url, { silent: true }).catch(err => {
toast.error(`Failed to navigate: ${err.message}`);
return null;
});
diff --git a/client/src/pages/GitHub.jsx b/client/src/pages/GitHub.jsx
index 0ad403b23a..baf42c23d8 100644
--- a/client/src/pages/GitHub.jsx
+++ b/client/src/pages/GitHub.jsx
@@ -51,7 +51,7 @@ export default function GitHub() {
const handleSync = async () => {
setSyncing(true);
- const result = await syncGitHubRepos().catch((err) => {
+ const result = await syncGitHubRepos({ silent: true }).catch((err) => {
toast.error(`Sync failed: ${err.message}`);
return null;
});
@@ -66,7 +66,7 @@ export default function GitHub() {
const handleToggleNpm = async (fullName, currentValue) => {
const updated = await updateGitHubRepo(fullName, {
flags: { npmProject: !currentValue }
- }).catch((err) => {
+ }, { silent: true }).catch((err) => {
toast.error(`Update failed: ${err.message}`);
return null;
});
@@ -78,7 +78,7 @@ export default function GitHub() {
const handleSaveSecret = async () => {
if (!newSecretName.trim() || !newSecretValue) return;
setSavingSecret(true);
- const result = await setGitHubSecret(newSecretName.trim(), newSecretValue).catch((err) => {
+ const result = await setGitHubSecret(newSecretName.trim(), newSecretValue, { silent: true }).catch((err) => {
toast.error(`Failed to save secret: ${err.message}`);
return null;
});
@@ -95,7 +95,7 @@ export default function GitHub() {
const handleSyncSecret = async (name) => {
setSyncingSecret(name);
- const result = await syncGitHubSecret(name).catch((err) => {
+ const result = await syncGitHubSecret(name, { silent: true }).catch((err) => {
toast.error(`Sync failed: ${err.message}`);
return null;
});
@@ -114,7 +114,7 @@ export default function GitHub() {
setArchiveConfirm(null);
setArchiving(fullName);
const fn = action === 'archive' ? archiveGitHubRepo : unarchiveGitHubRepo;
- const updated = await fn(fullName).catch((err) => {
+ const updated = await fn(fullName, { silent: true }).catch((err) => {
toast.error(`Failed to ${action}: ${err.message}`);
return null;
});
diff --git a/client/src/pages/Tribe.jsx b/client/src/pages/Tribe.jsx
index c746064126..7dbaad7936 100644
--- a/client/src/pages/Tribe.jsx
+++ b/client/src/pages/Tribe.jsx
@@ -402,7 +402,7 @@ function MemoryLinksPanel({ personId }) {
const linkMemory = async () => {
if (!memoryId) return;
- const result = await api.linkTribeMemory(personId, { memoryId, note }).catch((err) => {
+ const result = await api.linkTribeMemory(personId, { memoryId, note }, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to link memory');
return null;
});
@@ -413,7 +413,7 @@ function MemoryLinksPanel({ personId }) {
};
const unlinkMemory = async (id) => {
- const result = await api.unlinkTribeMemory(personId, id).catch((err) => {
+ const result = await api.unlinkTribeMemory(personId, id, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to unlink memory');
return null;
});
@@ -828,11 +828,11 @@ export default function Tribe() {
const isCreate = !draft.id;
setSaving(true);
const saved = draft.id
- ? await api.updateTribePerson(draft.id, payload).catch((err) => {
+ ? await api.updateTribePerson(draft.id, payload, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to save relationship');
return null;
})
- : await api.createTribePerson(payload).catch((err) => {
+ : await api.createTribePerson(payload, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to save relationship');
return null;
});
@@ -856,7 +856,7 @@ export default function Tribe() {
const deleteDraft = async () => {
if (!draft.id) return;
- const result = await api.deleteTribePerson(draft.id).catch((err) => {
+ const result = await api.deleteTribePerson(draft.id, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to delete relationship');
return null;
});
@@ -872,7 +872,7 @@ export default function Tribe() {
channel: contacts.find((contact) => contact.id === id)?.channel || '',
summary: 'Manual touchpoint',
source: 'user',
- }).catch((err) => {
+ }, { silent: true }).catch((err) => {
toast.error(err.message || 'Failed to log touchpoint');
return null;
});
diff --git a/client/src/services/apiApps.js b/client/src/services/apiApps.js
index 27073713a9..3a52466e6d 100644
--- a/client/src/services/apiApps.js
+++ b/client/src/services/apiApps.js
@@ -72,7 +72,9 @@ export const openAppInClaude = (id) => request(`/apps/${id}/open-claude`, { meth
export const openAppFolder = (id) => request(`/apps/${id}/open-folder`, { method: 'POST' });
export const refreshAppConfig = (id) => request(`/apps/${id}/refresh-config`, { method: 'POST' });
export const pullAndUpdateApp = (id) => request(`/apps/${id}/update`, { method: 'POST' });
-export const buildApp = (id) => request(`/apps/${id}/build`, { method: 'POST' });
+// `options` lets a caller suppress request()'s auto-toast with `{ silent: true }`
+// when it already renders its own error UI.
+export const buildApp = (id, options = {}) => request(`/apps/${id}/build`, { method: 'POST', ...options });
export const getAppStatus = (id) => request(`/apps/${id}/status`);
export const getAppTaskTypes = (id) => request(`/apps/${id}/task-types`);
export const toggleAllAppTaskTypes = (id, enabled, options = {}) => request(`/apps/${id}/task-types/all`, {
diff --git a/client/src/services/apiAsk.js b/client/src/services/apiAsk.js
index 49c0e26860..c0387ea3d9 100644
--- a/client/src/services/apiAsk.js
+++ b/client/src/services/apiAsk.js
@@ -2,7 +2,9 @@ import { request, API_BASE } from './apiCore.js';
export const listAskConversations = () => request('/ask');
export const getAskConversation = (id) => request(`/ask/${encodeURIComponent(id)}`);
-export const deleteAskConversation = (id) => request(`/ask/${encodeURIComponent(id)}`, { method: 'DELETE' });
+// `options` lets a caller suppress request()'s auto-toast with `{ silent: true }`
+// when it already renders its own error UI.
+export const deleteAskConversation = (id, options = {}) => request(`/ask/${encodeURIComponent(id)}`, { method: 'DELETE', ...options });
export const promoteAskConversation = (id, promoted = true) => request(`/ask/${encodeURIComponent(id)}/promote`, {
method: 'POST',
body: JSON.stringify({ promoted }),
@@ -13,10 +15,11 @@ export const promoteAskConversation = (id, promoted = true) => request(`/ask/${e
// { target: 'brain' }
// { target: 'task', priority?: 'LOW'|'MEDIUM'|'HIGH' }
// { target: 'goal', goalId: string }
-export const promoteAskTurn = (conversationId, turnId, payload) =>
+export const promoteAskTurn = (conversationId, turnId, payload, options = {}) =>
request(`/ask/${encodeURIComponent(conversationId)}/turns/${encodeURIComponent(turnId)}/promote`, {
method: 'POST',
body: JSON.stringify(payload),
+ ...options,
});
/**
diff --git a/client/src/services/apiGit.js b/client/src/services/apiGit.js
index ef3b310200..3be57e56c2 100644
--- a/client/src/services/apiGit.js
+++ b/client/src/services/apiGit.js
@@ -65,22 +65,28 @@ export const getRemoteBranches = (path) => request('/git/remote-branches', {
method: 'POST',
body: JSON.stringify({ path })
});
-export const deleteBranch = (path, branch, { local = false, remote = false } = {}) =>
+// `options` lets a caller suppress request()'s auto-toast with `{ silent: true }`
+// when it already renders its own error UI.
+export const deleteBranch = (path, branch, { local = false, remote = false } = {}, options = {}) =>
request('/git/delete-branch', {
method: 'POST',
- body: JSON.stringify({ path, branch, local, remote })
+ body: JSON.stringify({ path, branch, local, remote }),
+ ...options
});
-export const cleanupMergedBranches = (path) => request('/git/cleanup-merged', {
+export const cleanupMergedBranches = (path, options = {}) => request('/git/cleanup-merged', {
method: 'POST',
- body: JSON.stringify({ path })
+ body: JSON.stringify({ path }),
+ ...options
});
-export const mergeBranch = (path, branch) => request('/git/merge', {
+export const mergeBranch = (path, branch, options = {}) => request('/git/merge', {
method: 'POST',
- body: JSON.stringify({ path, branch })
+ body: JSON.stringify({ path, branch }),
+ ...options
});
-export const checkoutRemoteBranch = (path, branch) => request('/git/checkout-remote', {
+export const checkoutRemoteBranch = (path, branch, options = {}) => request('/git/checkout-remote', {
method: 'POST',
- body: JSON.stringify({ path, branch })
+ body: JSON.stringify({ path, branch }),
+ ...options
});
export const getSubmodules = () => request('/git/submodules/status');
export const updateSubmodule = (path) => request('/git/submodules/update', {
diff --git a/client/src/services/apiGithub.js b/client/src/services/apiGithub.js
index 4c7d4a6d26..6ac5e6b162 100644
--- a/client/src/services/apiGithub.js
+++ b/client/src/services/apiGithub.js
@@ -1,16 +1,18 @@
import { request } from './apiCore.js';
// GitHub Repos
-export const getGitHubRepos = () => request('/github/repos');
-export const syncGitHubRepos = () => request('/github/repos/sync', { method: 'POST' });
-export const updateGitHubRepo = (fullName, data) =>
- request(`/github/repos/${encodeURIComponent(fullName)}`, { method: 'PUT', body: JSON.stringify(data) });
-export const archiveGitHubRepo = (fullName) =>
- request(`/github/repos/${encodeURIComponent(fullName)}/archive`, { method: 'POST' });
-export const unarchiveGitHubRepo = (fullName) =>
- request(`/github/repos/${encodeURIComponent(fullName)}/unarchive`, { method: 'POST' });
-export const getGitHubSecrets = () => request('/github/secrets');
-export const setGitHubSecret = (name, value) =>
- request(`/github/secrets/${encodeURIComponent(name)}`, { method: 'PUT', body: JSON.stringify({ value }) });
-export const syncGitHubSecret = (name) =>
- request(`/github/secrets/${encodeURIComponent(name)}/sync`, { method: 'POST' });
+// `options` lets a caller suppress request()'s auto-toast with `{ silent: true }`
+// when it already renders its own error UI.
+export const getGitHubRepos = (options = {}) => request('/github/repos', options);
+export const syncGitHubRepos = (options = {}) => request('/github/repos/sync', { method: 'POST', ...options });
+export const updateGitHubRepo = (fullName, data, options = {}) =>
+ request(`/github/repos/${encodeURIComponent(fullName)}`, { method: 'PUT', body: JSON.stringify(data), ...options });
+export const archiveGitHubRepo = (fullName, options = {}) =>
+ request(`/github/repos/${encodeURIComponent(fullName)}/archive`, { method: 'POST', ...options });
+export const unarchiveGitHubRepo = (fullName, options = {}) =>
+ request(`/github/repos/${encodeURIComponent(fullName)}/unarchive`, { method: 'POST', ...options });
+export const getGitHubSecrets = (options = {}) => request('/github/secrets', options);
+export const setGitHubSecret = (name, value, options = {}) =>
+ request(`/github/secrets/${encodeURIComponent(name)}`, { method: 'PUT', body: JSON.stringify({ value }), ...options });
+export const syncGitHubSecret = (name, options = {}) =>
+ request(`/github/secrets/${encodeURIComponent(name)}/sync`, { method: 'POST', ...options });
diff --git a/client/src/services/apiReferenceRepos.js b/client/src/services/apiReferenceRepos.js
index 3e8f058211..725ae496ff 100644
--- a/client/src/services/apiReferenceRepos.js
+++ b/client/src/services/apiReferenceRepos.js
@@ -7,33 +7,40 @@ import { request } from './apiCore.js';
export const listReferenceRepos = (appId) =>
request(`/apps/${appId}/reference-repos`);
-export const addReferenceRepo = (appId, body) =>
+// `options` lets a caller suppress request()'s auto-toast with `{ silent: true }`
+// when it already renders its own error UI.
+export const addReferenceRepo = (appId, body, options = {}) =>
request(`/apps/${appId}/reference-repos`, {
method: 'POST',
body: JSON.stringify(body),
+ ...options,
});
-export const updateReferenceRepo = (appId, refId, body) =>
+export const updateReferenceRepo = (appId, refId, body, options = {}) =>
request(`/apps/${appId}/reference-repos/${refId}`, {
method: 'PATCH',
body: JSON.stringify(body),
+ ...options,
});
-export const deleteReferenceRepo = (appId, refId) =>
+export const deleteReferenceRepo = (appId, refId, options = {}) =>
request(`/apps/${appId}/reference-repos/${refId}`, {
method: 'DELETE',
+ ...options,
});
// Run a check now — returns { head, headShort, commitCount, commits, ... }.
// Does NOT advance lastReviewedSha.
-export const checkReferenceRepo = (appId, refId) =>
+export const checkReferenceRepo = (appId, refId, options = {}) =>
request(`/apps/${appId}/reference-repos/${refId}/check`, {
method: 'POST',
+ ...options,
});
// Pin lastReviewedSha after the user / agent has processed the changes.
-export const markReferenceRepoReviewed = (appId, refId, sha) =>
+export const markReferenceRepoReviewed = (appId, refId, sha, options = {}) =>
request(`/apps/${appId}/reference-repos/${refId}/reviewed`, {
method: 'POST',
body: JSON.stringify({ sha }),
+ ...options,
});
diff --git a/client/src/services/apiTribe.js b/client/src/services/apiTribe.js
index d59f188087..fc603c44d3 100644
--- a/client/src/services/apiTribe.js
+++ b/client/src/services/apiTribe.js
@@ -15,24 +15,29 @@ export const getTribeCareSummary = (options = {}) => {
return request(`/tribe/care${qs ? `?${qs}` : ''}`, { silent: options.silent });
};
-export const createTribePerson = (data) => request('/tribe/people', {
+// `options` lets a caller suppress request()'s auto-toast with `{ silent: true }`
+// when it already renders its own error UI.
+export const createTribePerson = (data, options = {}) => request('/tribe/people', {
method: 'POST',
body: JSON.stringify(data),
+ ...options,
});
-export const updateTribePerson = (id, data) => request(`/tribe/people/${id}`, {
+export const updateTribePerson = (id, data, options = {}) => request(`/tribe/people/${id}`, {
method: 'PUT',
body: JSON.stringify(data),
+ ...options,
});
-export const deleteTribePerson = (id) => request(`/tribe/people/${id}`, { method: 'DELETE' });
+export const deleteTribePerson = (id, options = {}) => request(`/tribe/people/${id}`, { method: 'DELETE', ...options });
export const getTribeTouchpoints = (personId, limit = 50) =>
request(`/tribe/people/${personId}/touchpoints?limit=${limit}`);
-export const createTribeTouchpoint = (personId, data = {}) => request(`/tribe/people/${personId}/touchpoints`, {
+export const createTribeTouchpoint = (personId, data = {}, options = {}) => request(`/tribe/people/${personId}/touchpoints`, {
method: 'POST',
body: JSON.stringify(data),
+ ...options,
});
export const createTribeCalendarTouchpoint = (personId, data) =>
@@ -43,10 +48,11 @@ export const createTribeCalendarTouchpoint = (personId, data) =>
export const getTribeMemoryLinks = (personId) => request(`/tribe/people/${personId}/memories`);
-export const linkTribeMemory = (personId, data) => request(`/tribe/people/${personId}/memories`, {
+export const linkTribeMemory = (personId, data, options = {}) => request(`/tribe/people/${personId}/memories`, {
method: 'POST',
body: JSON.stringify(data),
+ ...options,
});
-export const unlinkTribeMemory = (personId, memoryId) =>
- request(`/tribe/people/${personId}/memories/${memoryId}`, { method: 'DELETE' });
+export const unlinkTribeMemory = (personId, memoryId, options = {}) =>
+ request(`/tribe/people/${personId}/memories/${memoryId}`, { method: 'DELETE', ...options });