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

fix(dashboard): suppress Not Found toast errors for optional dashboard widgets

Adam Eivy570a99cbedb8
diff --git a/.changelog/v0.13.x.md b/.changelog/v0.13.x.md
index f28ba0d709..714105ff0c 100644
--- a/.changelog/v0.13.x.md
+++ b/.changelog/v0.13.x.md
@@ -166,3 +166,10 @@ This release expands the genome dashboard with comprehensive cancer predispositi
- **Sticky category quick-nav bar** — horizontal scrollable bar that sticks to the top when scrolling, with emoji-labeled buttons for each category
- **Scroll-to-category** — clicking any category in the overview grid or quick-nav bar smooth-scrolls to that category's marker cards
- Unblocks downstream Chronotype, Aesthetic Taste, and Goal Tracker implementations by establishing the genome section as a navigable, category-organized reference
+
+## Fixes
+
+### Dashboard — Suppress "Not Found" Toast Errors for Optional Widgets
+- **Fixed multiple "Not found" toast errors** appearing when navigating to the dashboard — the CosDashboardWidget and GoalProgressWidget fire API calls for supplementary data (activity calendar, learning summary, goal progress, etc.) that correctly handle missing data via `.catch(() => null)`, but the centralized `api.request()` function was showing error toasts before the error was thrown and caught
+- **Added `silent` option to `api.request()`** — callers can pass `{ silent: true }` to suppress automatic toast notifications for non-critical requests, while still throwing errors for programmatic handling
+- Updated CosDashboardWidget (4 API calls) and GoalProgressWidget (1 API call) to use `{ silent: true }` since these widgets gracefully degrade when data is unavailable
diff --git a/client/src/components/CosDashboardWidget.jsx b/client/src/components/CosDashboardWidget.jsx
index 67b7d127df..7a0295d075 100644
--- a/client/src/components/CosDashboardWidget.jsx
+++ b/client/src/components/CosDashboardWidget.jsx
@@ -30,11 +30,12 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {
useEffect(() => {
const loadData = async () => {
+ const silent = { silent: true };
const [quickData, learningData, tasksData, calendarData] = await Promise.all([
- api.getCosQuickSummary().catch(() => null),
- api.getCosLearningSummary().catch(() => null),
- api.getCosRecentTasks(5).catch(() => null),
- api.getCosActivityCalendar(8).catch(() => null)
+ api.getCosQuickSummary(silent).catch(() => null),
+ api.getCosLearningSummary(silent).catch(() => null),
+ api.getCosRecentTasks(5, silent).catch(() => null),
+ api.getCosActivityCalendar(8, silent).catch(() => null)
]);
setSummary(quickData);
setLearningSummary(learningData);
diff --git a/client/src/components/GoalProgressWidget.jsx b/client/src/components/GoalProgressWidget.jsx
index 4a587a7bca..abfd93ed20 100644
--- a/client/src/components/GoalProgressWidget.jsx
+++ b/client/src/components/GoalProgressWidget.jsx
@@ -18,7 +18,7 @@ const GoalProgressWidget = memo(function GoalProgressWidget() {
useEffect(() => {
const loadData = async () => {
- const data = await api.getCosGoalProgressSummary().catch(() => null);
+ const data = await api.getCosGoalProgressSummary({ silent: true }).catch(() => null);
setProgress(data);
setLoading(false);
};
diff --git a/client/src/services/api.js b/client/src/services/api.js
index 54a7d5c9c7..62f733ba0a 100644
--- a/client/src/services/api.js
+++ b/client/src/services/api.js
@@ -3,13 +3,14 @@ import toast from 'react-hot-toast';
const API_BASE = '/api';
async function request(endpoint, options = {}) {
+ const { silent, ...fetchOptions } = options;
const url = `${API_BASE}${endpoint}`;
const config = {
headers: {
'Content-Type': 'application/json',
- ...options.headers
+ ...fetchOptions.headers
},
- ...options
+ ...fetchOptions
};
const response = await fetch(url, config);
@@ -17,11 +18,13 @@ async function request(endpoint, options = {}) {
if (!response.ok) {
const error = await response.json().catch(() => ({ error: 'Request failed' }));
const errorMessage = error.error || `HTTP ${response.status}`;
- // Platform unavailability is a warning, not an error
- if (error.code === 'PLATFORM_UNAVAILABLE') {
- toast(errorMessage, { icon: '⚠️' });
- } else {
- toast.error(errorMessage);
+ if (!silent) {
+ // Platform unavailability is a warning, not an error
+ if (error.code === 'PLATFORM_UNAVAILABLE') {
+ toast(errorMessage, { icon: '⚠️' });
+ } else {
+ toast.error(errorMessage);
+ }
}
throw new Error(errorMessage);
}
@@ -556,7 +559,7 @@ export const getCosLearningDurations = () => request('/cos/learning/durations');
export const getCosLearningSkipped = () => request('/cos/learning/skipped');
export const getCosLearningPerformance = () => request('/cos/learning/performance');
export const getCosLearningRouting = () => request('/cos/learning/routing');
-export const getCosLearningSummary = () => request('/cos/learning/summary');
+export const getCosLearningSummary = (options) => request('/cos/learning/summary', options);
export const backfillCosLearning = () => request('/cos/learning/backfill', { method: 'POST' });
export const resetCosTaskTypeLearning = (taskType) => request(`/cos/learning/reset/${encodeURIComponent(taskType)}`, { method: 'POST' });
@@ -617,12 +620,12 @@ export const getCosProductivity = () => request('/cos/productivity');
export const getCosProductivitySummary = () => request('/cos/productivity/summary');
export const recalculateCosProductivity = () => request('/cos/productivity/recalculate', { method: 'POST' });
export const getCosProductivityTrends = (days = 30) => request(`/cos/productivity/trends?days=${days}`);
-export const getCosActivityCalendar = (weeks = 12) => request(`/cos/productivity/calendar?weeks=${weeks}`);
-export const getCosQuickSummary = () => request('/cos/quick-summary');
-export const getCosRecentTasks = (limit = 10) => request(`/cos/recent-tasks?limit=${limit}`);
+export const getCosActivityCalendar = (weeks = 12, options) => request(`/cos/productivity/calendar?weeks=${weeks}`, options);
+export const getCosQuickSummary = (options) => request('/cos/quick-summary', options);
+export const getCosRecentTasks = (limit = 10, options) => request(`/cos/recent-tasks?limit=${limit}`, options);
export const getCosActionableInsights = () => request('/cos/actionable-insights');
export const getCosGoalProgress = () => request('/cos/goal-progress');
-export const getCosGoalProgressSummary = () => request('/cos/goal-progress/summary');
+export const getCosGoalProgressSummary = (options) => request('/cos/goal-progress/summary', options);
// Task Schedule (Configurable Intervals)
export const getCosSchedule = () => request('/cos/schedule');