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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(brain): add done status for inbox items
Adam Eivy5bbddc56fe8c
diff --git a/.changelog/v0.12.x.md b/.changelog/v0.12.x.mdindex ea85835799..0902c422fa 100644--- a/.changelog/v0.12.x.md+++ b/.changelog/v0.12.x.md@@ -258,6 +258,23 @@ This release adds branch management and automated release workflow capabilities- `client/src/components/city/CitySettingsPanel.jsx` — Replaced fog slider with time-of-day preset buttons- `client/src/hooks/useCitySettings.js` — Removed fogDensity, added timeOfDay setting+### Brain — Mark Inbox Items as Done+- **Done status**: Inbox items can now be marked as "done" from both the Filed and Needs Review sections, adding a new terminal state for processed thoughts+- **API endpoint**: `POST /api/brain/inbox/:id/done` sets status to `done` with a `doneAt` timestamp, usable by both the UI and the CoS agent+- **Done section**: Collapsed "Done" section at the bottom of the inbox shows completed items with strikethrough text, destination badges, and memory links+- **Needs Review done**: Items in Needs Review can be marked done without filing — useful for fleeting thoughts that don't need to be stored++**Server changes**:+- `server/lib/brainValidation.js` — Added `done` to `inboxStatusEnum`+- `server/services/brainStorage.js` — Added `done` count to `getInboxLogCounts()`+- `server/services/brain.js` — Added `markInboxDone()` function+- `server/routes/brain.js` — Added `POST /inbox/:id/done` endpoint++**Client changes**:+- `client/src/services/api.js` — Added `markBrainInboxDone()` API function+- `client/src/components/brain/constants.js` — Added `done` status color+- `client/src/components/brain/tabs/InboxTab.jsx` — Done buttons on Filed and Needs Review entries, collapsible Done section+## Fixes### ClinVar Header Parsing — Zero Variants Parseddiff --git a/client/src/components/brain/constants.js b/client/src/components/brain/constants.jsindex b76f3616c8..2d15e1c6c6 100644--- a/client/src/components/brain/constants.js+++ b/client/src/components/brain/constants.js@@ -53,6 +53,7 @@ export const STATUS_COLORS = {filed: 'bg-port-success/20 text-port-success border-port-success/30',needs_review: 'bg-port-warning/20 text-port-warning border-port-warning/30',corrected: 'bg-blue-500/20 text-blue-400 border-blue-500/30',+ done: 'bg-gray-500/20 text-gray-400 border-gray-500/30',error: 'bg-port-error/20 text-port-error border-port-error/30'};diff --git a/client/src/components/brain/tabs/InboxTab.jsx b/client/src/components/brain/tabs/InboxTab.jsxindex 5214bce142..ac3b2d6292 100644--- a/client/src/components/brain/tabs/InboxTab.jsx+++ b/client/src/components/brain/tabs/InboxTab.jsx@@ -6,6 +6,7 @@ import {RefreshCw,AlertCircle,CheckCircle,+ CheckCheck,Edit2,ChevronDown,ChevronRight,@@ -36,6 +37,7 @@ export default function InboxTab({ onRefresh, settings }) {const [fixDestination, setFixDestination] = useState('');const [editingId, setEditingId] = useState(null);const [editText, setEditText] = useState('');+ const [showDone, setShowDone] = useState(false);const [confirmingDeleteId, setConfirmingDeleteId] = useState(null);const inputRef = useRef(null);@@ -175,9 +177,23 @@ export default function InboxTab({ onRefresh, settings }) {onRefresh?.();};+ const handleMarkDone = async (entryId) => {+ const result = await api.markBrainInboxDone(entryId).catch(err => {+ toast.error(err.message || 'Failed to mark done');+ return null;+ });++ if (result) {+ toast.success('Marked as done');+ fetchInbox();+ onRefresh?.();+ }+ };+const classifyingEntries = entries.filter(e => e.status === 'classifying');const needsReviewEntries = entries.filter(e => e.status === 'needs_review');const filedEntries = entries.filter(e => e.status === 'filed' || e.status === 'corrected');+ const doneEntries = entries.filter(e => e.status === 'done');const errorEntries = entries.filter(e => e.status === 'error');if (loading) {@@ -366,6 +382,14 @@ export default function InboxTab({ onRefresh, settings }) {</button>);})}+ <button+ onClick={() => handleMarkDone(entry.id)}+ className="flex items-center gap-1 px-2 py-1 text-xs rounded border border-port-border text-gray-400 hover:text-port-success transition-colors"+ title="Mark as done without filing"+ >+ <CheckCheck size={12} />+ Done+ </button><buttononClick={() => handleRetry(entry.id)}className="flex items-center gap-1 px-2 py-1 text-xs rounded border border-port-border text-gray-400 hover:text-white transition-colors"@@ -579,6 +603,16 @@ export default function InboxTab({ onRefresh, settings }) {</button>)}+ {/* Done button */}+ <button+ onClick={() => handleMarkDone(entry.id)}+ className="flex items-center gap-1 px-2 py-1 text-xs rounded border border-port-border text-gray-400 hover:text-port-success transition-colors"+ title="Mark as done"+ >+ <CheckCheck size={12} />+ Done+ </button>+{/* Fix button */}{fixingId === entry.id ? (<div className="flex items-center gap-2">@@ -631,6 +665,98 @@ export default function InboxTab({ onRefresh, settings }) {</div>)}</div>++ {/* Done entries */}+ {doneEntries.length > 0 && (+ <div className="mt-4">+ <button+ onClick={() => setShowDone(!showDone)}+ className="flex items-center gap-2 text-gray-400 font-medium mb-2"+ >+ {showDone ? <ChevronDown size={16} /> : <ChevronRight size={16} />}+ <CheckCheck size={16} />+ Done ({doneEntries.length})+ </button>++ {showDone && (+ <div className="space-y-2">+ {doneEntries.map(entry => {+ const destInfo = DESTINATIONS[entry.classification?.destination || 'unknown'];+ const DestIcon = destInfo.icon;++ return (+ <div+ key={entry.id}+ className="p-3 bg-port-card border border-port-border/50 rounded-lg opacity-60"+ >+ <div className="flex items-start justify-between gap-2 mb-2">+ <div className="flex-1">+ <p className="text-gray-400 line-through">{entry.capturedText}</p>+ {entry.classification?.title && (+ <p className="text-sm text-gray-500 mt-1">+ → {entry.classification.title}+ </p>+ )}+ </div>+ <div className="flex gap-1">+ <button+ onClick={() => setConfirmingDeleteId(entry.id)}+ className="p-1 text-gray-500 hover:text-port-error transition-colors"+ title="Delete entry"+ >+ <Trash2 size={14} />+ </button>+ <span className="text-xs text-gray-600 whitespace-nowrap">+ {formatRelativeTime(entry.doneAt || entry.capturedAt)}+ </span>+ </div>+ </div>++ {confirmingDeleteId === entry.id && (+ <div className="flex items-center gap-2 p-2 bg-port-error/10 border border-port-error/30 rounded mb-2">+ <span className="text-xs text-white flex-1">Delete this entry? This cannot be undone.</span>+ <button+ onClick={() => handleDelete(entry.id)}+ className="px-2 py-1 text-xs bg-port-error text-white rounded hover:bg-port-error/80 transition-colors"+ title="Confirm delete"+ >+ Delete+ </button>+ <button+ onClick={() => setConfirmingDeleteId(null)}+ className="px-2 py-1 text-xs text-gray-400 hover:text-white transition-colors"+ title="Cancel delete"+ >+ Cancel+ </button>+ </div>+ )}++ <div className="flex items-center gap-2">+ <span className={`flex items-center gap-1 px-2 py-1 text-xs rounded border ${destInfo.color}`}>+ <DestIcon size={12} />+ {destInfo.label}+ </span>+ {entry.filed?.destinationId && (+ <button+ onClick={() => {+ window.location.href = `/brain/memory?type=${entry.filed.destination}&id=${entry.filed.destinationId}`;+ }}+ className="flex items-center gap-1 px-2 py-1 text-xs rounded border border-port-border text-gray-500 hover:text-white transition-colors"+ title="View in Memory"+ >+ <ExternalLink size={12} />+ View+ </button>+ )}+ </div>+ </div>+ );+ })}+ </div>+ )}+ </div>+ )}</div>);}diff --git a/client/src/services/api.js b/client/src/services/api.jsindex b3fbe14791..bc035b0efc 100644--- a/client/src/services/api.js+++ b/client/src/services/api.js@@ -715,6 +715,7 @@ export const updateBrainInboxEntry = (id, capturedText) => request(`/brain/inboxbody: JSON.stringify({ capturedText })});export const deleteBrainInboxEntry = (id) => request(`/brain/inbox/${id}`, { method: 'DELETE' });+export const markBrainInboxDone = (id) => request(`/brain/inbox/${id}/done`, { method: 'POST' });// Brain - Peopleexport const getBrainPeople = () => request('/brain/people');diff --git a/server/lib/brainValidation.js b/server/lib/brainValidation.jsindex 630ee405b1..8af8c79de5 100644--- a/server/lib/brainValidation.js+++ b/server/lib/brainValidation.js@@ -10,7 +10,7 @@ export const projectStatusEnum = z.enum(['active', 'waiting', 'blocked', 'somedaexport const adminStatusEnum = z.enum(['open', 'waiting', 'done']);// Inbox log status enum-export const inboxStatusEnum = z.enum(['classifying', 'filed', 'needs_review', 'corrected', 'error']);+export const inboxStatusEnum = z.enum(['classifying', 'filed', 'needs_review', 'corrected', 'done', 'error']);// AI configuration schemaexport const aiConfigSchema = z.object({diff --git a/server/routes/brain.js b/server/routes/brain.jsindex 2526303551..a57b152461 100644--- a/server/routes/brain.js+++ b/server/routes/brain.js@@ -136,6 +136,18 @@ router.post('/inbox/:id/retry', asyncHandler(async (req, res) => {res.json(result);}));+/**+ * POST /api/brain/inbox/:id/done+ * Mark an inbox entry as done+ */+router.post('/inbox/:id/done', asyncHandler(async (req, res) => {+ const result = await brainService.markInboxDone(req.params.id);+ if (!result) {+ throw new ServerError('Inbox entry not found', { status: 404, code: 'NOT_FOUND' });+ }+ res.json(result);+}));+/*** PUT /api/brain/inbox/:id* Update an inbox entry (edit captured text)diff --git a/server/services/brain.js b/server/services/brain.jsindex c92d5ec2ee..9a88e0ad6b 100644--- a/server/services/brain.js+++ b/server/services/brain.js@@ -659,6 +659,24 @@ export async function retryClassification(inboxLogId, providerOverride, modelOve};}+/**+ * Mark inbox entry as done+ */+export async function markInboxDone(inboxLogId) {+ const inboxLog = await storage.getInboxLogById(inboxLogId);+ if (!inboxLog) {+ return null;+ }++ const updated = await storage.updateInboxLog(inboxLogId, {+ status: 'done',+ doneAt: new Date().toISOString()+ });++ console.log(`🧠 Marked inbox entry done: ${inboxLogId}`);+ return updated;+}+/*** Update inbox entry (edit captured text)*/diff --git a/server/services/brainStorage.js b/server/services/brainStorage.jsindex 0160cdd0b1..d9d52e07ba 100644--- a/server/services/brainStorage.js+++ b/server/services/brainStorage.js@@ -406,6 +406,7 @@ export async function getInboxLogCounts() {filed: 0,needs_review: 0,corrected: 0,+ done: 0,error: 0};