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

address review (claude): silent updateUniverse (single toast) + per-kind role test

[._.]/ Adam Eivy0af2808ba37f
diff --git a/client/src/components/universe/UniverseCanonSection.jsx b/client/src/components/universe/UniverseCanonSection.jsx
index f7a1d558f2..e11feac954 100644
--- a/client/src/components/universe/UniverseCanonSection.jsx
+++ b/client/src/components/universe/UniverseCanonSection.jsx
@@ -561,7 +561,9 @@ export default function UniverseCanonSection({
// Optimistic append so the new row shows immediately; the server response
// (with the minted entry id) replaces it.
onUniverseChange({ ...universe, [kindKey]: nextList });
- const updated = await updateUniverse(universeId, { [kindKey]: nextList })
+ // `{ silent: true }` because the .catch below owns the error toast — without
+ // it the apiCore request() helper would fire a second, duplicate toast.
+ const updated = await updateUniverse(universeId, { [kindKey]: nextList }, { silent: true })
.catch((err) => { toast.error(`Add from Catalog failed: ${err.message}`); return null; });
if (!updated) {
// Revert the optimistic append — the save didn't land, so the phantom
diff --git a/client/src/components/universe/UniverseCanonSection.picker.test.jsx b/client/src/components/universe/UniverseCanonSection.picker.test.jsx
index 5b272bed19..3051197688 100644
--- a/client/src/components/universe/UniverseCanonSection.picker.test.jsx
+++ b/client/src/components/universe/UniverseCanonSection.picker.test.jsx
@@ -139,6 +139,29 @@ describe('UniverseCanonSection — Pick from Catalog', () => {
));
});
+ it('derives the role per-kind: a picked place links as canon-place', async () => {
+ // Guards the `canon-${kind.apiKind}` derivation the backfill depends on —
+ // a regression that hard-coded "character" would otherwise pass CI.
+ const onUniverseChange = vi.fn();
+ updateUniverse.mockResolvedValue(baseUniverse({
+ places: [{ id: 'plc-server', name: 'The Hollow', ingredientId: 'cat-plc-1' }],
+ }));
+ listCatalogIngredients.mockResolvedValue({
+ items: [{ id: 'cat-plc-1', type: 'place', name: 'The Hollow', payload: { description: 'tunnel' } }],
+ });
+
+ renderSection({ onUniverseChange, kindFilter: 'places' });
+ fireEvent.click(screen.getByRole('button', { name: /pick place from catalog/i }));
+ const row = await screen.findByRole('button', { name: /the hollow/i });
+ fireEvent.click(row);
+
+ await waitFor(() => expect(linkCatalogIngredient).toHaveBeenCalledWith(
+ 'cat-plc-1',
+ { refKind: 'universe', refId: 'uni-1', role: 'canon-place' },
+ { silent: true },
+ ));
+ });
+
it('reverts the optimistic append when the save fails', async () => {
const onUniverseChange = vi.fn();
updateUniverse.mockRejectedValue(new Error('boom'));