{"draft":null,"from":82,"to":83,"files":[{"path":"worker/project/project.ts","added":14,"removed":3,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -391,10 +391,21 @@\n \t\treturn [...this.#agents.keys()].sort();\n \t}\n \n-\t/** An agent's unpublished changes, oldest first, and its view (its space at its base plus its changes). Read only. */\n-\tdraftOf(agentName: string): { atoms: AtomId[]; view: View } | undefined {\n+\t/**\n+\t * An agent's unpublished changes, oldest first, and its view (its space at its base plus its changes). Read only.\n+\t * The view is laid out on first use: where asks every agent, most have no changes, and a big project has more\n+\t * agents than the view cache holds, so building every view cost each call about 0.7 s.\n+\t */\n+\tdraftOf(agentName: string): { atoms: AtomId[]; readonly view: View } | undefined {\n \t\tconst agent = this.#agents.get(agentName);\n-\t\treturn agent && { atoms: this.#draft(agent), view: this.#agentView(agent) };\n+\t\tif (!agent) return undefined;\n+\t\tconst view = () => this.#agentView(agent);\n+\t\treturn {\n+\t\t\tatoms: this.#draft(agent),\n+\t\t\tget view() {\n+\t\t\t\treturn view();\n+\t\t\t},\n+\t\t};\n \t}\n \n \t/** The shared version an atom was published in, or undefined while it's only in a draft. */"}],"unmatched":[]}