MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / touchDesignActivity

Function touchDesignActivity

apps/desktop/src/main/snapshots-db.ts:192–207  ·  view source on GitHub ↗
(
  db: Database,
  id: string,
  updatedAt: string = nowIso(),
)

Source from the content-addressed store, hash-verified

190}
191
192export function touchDesignActivity(
193 db: Database,
194 id: string,
195 updatedAt: string = nowIso(),
196): Design | null {
197 return mutateStore(db, (data) => {
198 const idx = data.designs.findIndex((design) => design.id === id);
199 if (idx < 0) return null;
200 const current = data.designs[idx];
201 if (current === undefined) return null;
202 const nextUpdatedAt = updatedAt > current.updatedAt ? updatedAt : current.updatedAt;
203 const updated: Design = { ...current, updatedAt: nextUpdatedAt };
204 data.designs[idx] = updated;
205 return updated;
206 });
207}
208
209export function renameDesign(db: Database, id: string, name: string): Design | null {
210 const trimmed = name.trim();

Callers 6

registerWorkspaceIpcFunction · 0.90
appendCommentEventFunction · 0.90
appendSessionChatMessageFunction · 0.90
appendSessionToolStatusFunction · 0.90
upsertDesignFileFunction · 0.85

Calls 2

nowIsoFunction · 0.85
mutateStoreFunction · 0.85

Tested by

no test coverage detected