Fix dataset-ref walk false positive and wire spec-mandated success toasts

- Prune the data payload and top-level datasets keys in all three ref walks
  (extractDatasetRefs, renameDatasetInSpec, resolveDatasetRefs) so a data row
  carrying a field named "data" is no longer misread as a library reference,
  spuriously rewritten, or made to throw DatasetNotFoundError. Adds tests,
  including a guard that lookup-transform refs (from.data) still resolve.
- Wire the deferred success toasts now the Toaster has landed: publish, revert,
  extract-to-dataset, and snippet/dataset delete. Copy follows the council
  title-vs-message rule (title states the action, message adds the consequence).
- Reconcile the spec's blanket toast mandate to "toast only what the user can't
  already see": no toast on visible-result creates (snippet, dataset form);
  Copy Reference stays inline and gains an aria-live announcement (new shared
  .visually-hidden utility) instead of a toast-per-copy.
- Move the toast region to bottom-right so it stops covering the header action
  cluster (Publish/Revert, theme/datasets).
- Update docs/spec 01F/02/05 and docs/architecture/07 + 10 to match.
This commit is contained in:
2026-06-05 16:34:58 +03:00
parent a4e4d96d3b
commit 693f5d7073
17 changed files with 263 additions and 67 deletions
+19
View File
@@ -214,6 +214,25 @@ describe('prepareSpecForRender — dataset resolution (spec §04 Rendering Contr
};
expect(out.data).toEqual({ values: [{ a: 1 }], foo: 1 });
});
test('a "data" field buried in inline rows is not resolved and does not throw', () => {
// The inline rows carry a column named `data` whose value looks like a
// reference object. It is payload; resolution must not descend into it.
const spec = { data: { values: [{ data: { name: 'Missing' } }] }, mark: 'bar' };
const out = prepareSpecForRender(spec, { datasets }) as { data: { values: unknown[] } };
expect(out.data.values).toEqual([{ data: { name: 'Missing' } }]);
});
test('resolves a reference inside a lookup transform (from.data)', () => {
const spec = {
data: { name: 'JsonDs' },
transform: [{ lookup: 'id', from: { data: { name: 'CsvDs' }, key: 'id', fields: ['x'] } }],
};
const out = prepareSpecForRender(spec, { datasets }) as unknown as {
transform: Array<{ from: { data: unknown } }>;
};
expect(out.transform[0].from.data).toEqual({ values: 'a,b\n1,2', format: { type: 'csv' } });
});
});
describe('escapeVegaField', () => {