Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
import { type Accessor, createEffect, untrack } from 'solid-js';
/** Reconcile saved scope only against successfully loaded accounts, independently of UI. */
export function createInboxSelectionReconciliation(options: {
selectedIds: Accessor<readonly string[] | undefined>;
loadedLinks: Accessor<readonly { id: string }[] | undefined>;
clearSelection: () => void;
}) {
createEffect(() => {
const links = options.loadedLinks();
if (links === undefined) return;
if (
options.selectedIds()?.some((id) => !links.some((link) => link.id === id))
) {
untrack(options.clearSelection);
}
});
}