Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
cd48546
spatial type refactoring
emilbon99 Apr 29, 2026
40638b5
more tuning with spatial types
emilbon99 Apr 29, 2026
01f9780
Restore unrelated generated files to rc state
emilbon99 Apr 29, 2026
0779ec7
Drop unreachable defensive numeric handling in Go emitter
emilbon99 Apr 29, 2026
54a08a1
updated copyrights
emilbon99 Apr 29, 2026
f55bada
wip: port pluto Diagram/Arc/Symbol/Schematic + console arc to sy-4140
emilbon99 Apr 29, 2026
461800e
Fix soft-optional struct round-trip and acronym pluralization in Go p…
emilbon99 Apr 29, 2026
5fde4ba
wip: schematic v6 migration, slice + selectors typed-change adoption,…
emilbon99 Apr 29, 2026
a7ff7b0
invert Schematic factory: pluto owns rendering, console provides hooks
emilbon99 Apr 29, 2026
0e0dadb
fix pluto build: ConnectionLine import, CornerXYString rename, restor…
emilbon99 Apr 29, 2026
3bb7a60
Preserve schema field casing in Go JSON / msgpack tags
emilbon99 Apr 29, 2026
e733d08
fix v6 CopyBuffer shape, allow onNodeClick on Diagram, slice.spec.ts …
emilbon99 Apr 29, 2026
40e1064
schematic reorganization
emilbon99 Apr 29, 2026
59a9279
extract schematic Controller component
emilbon99 Apr 29, 2026
935baea
tighten schematic prop types: drop unsafe casts in console hooks
emilbon99 Apr 29, 2026
2681085
more tuning
emilbon99 Apr 29, 2026
e61399d
addressed pull request comments
emilbon99 Apr 29, 2026
df1a65b
cleanup
emilbon99 Apr 29, 2026
e401963
checkpoint
emilbon99 Apr 29, 2026
5d8ee47
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-413…
emilbon99 Apr 29, 2026
3dc5222
Merge branch 'sy-4138-prepare-oracle-generated-spatial-primitives-for…
emilbon99 Apr 29, 2026
c6aa34b
Merge branch 'sy-4140-schematic-type-re-organization-and-diagram-opti…
emilbon99 Apr 29, 2026
fcbf75b
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-383…
emilbon99 Apr 29, 2026
58a075c
checkpoint
emilbon99 Apr 30, 2026
c588ffb
checkpoint
emilbon99 Apr 30, 2026
7f26d82
cleaned up pluto queries tests
emilbon99 Apr 30, 2026
206f626
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-413…
emilbon99 Apr 30, 2026
b1ba041
Merge branch 'sy-4138-prepare-oracle-generated-spatial-primitives-for…
emilbon99 Apr 30, 2026
1470541
Always emit snake_case JSON / msgpack tags in Go generator
emilbon99 Apr 30, 2026
09e34c7
checkpoint
emilbon99 Apr 30, 2026
5ef9ed1
temporary fix with arc
emilbon99 Apr 30, 2026
8679701
updated spatial schemas
emilbon99 Apr 30, 2026
9870ddd
Merge branch 'sy-4138-prepare-oracle-generated-spatial-primitives-for…
emilbon99 Apr 30, 2026
c841c47
updated schematic slice
emilbon99 Apr 30, 2026
7d8b917
Merge branch 'sy-4140-schematic-type-re-organization-and-diagram-opti…
emilbon99 Apr 30, 2026
f77f626
checkpoint
emilbon99 Apr 30, 2026
8dd9b1c
updated console specs
emilbon99 Apr 30, 2026
8ed883c
arc types checkpoint
emilbon99 Apr 30, 2026
5737764
reverting bad changes to oracle plugins
emilbon99 Apr 30, 2026
bab622e
updated bounds
emilbon99 Apr 30, 2026
74bf02a
checkpoint
emilbon99 Apr 30, 2026
df60282
Merge branch 'sy-4138-prepare-oracle-generated-spatial-primitives-for…
emilbon99 May 1, 2026
f0aeea8
Merge branch 'sy-4140-schematic-type-re-organization-and-diagram-opti…
emilbon99 May 1, 2026
d9568ec
improvements to schematic migration tooling
emilbon99 May 1, 2026
e3989f7
pull request tuning
emilbon99 May 1, 2026
6d6beb1
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-413…
emilbon99 May 1, 2026
7198fe2
Merge branch 'sy-4138-prepare-oracle-generated-spatial-primitives-for…
emilbon99 May 1, 2026
b8e687c
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-383…
emilbon99 May 1, 2026
d9903e2
Merge branch 'sy-4140-schematic-type-re-organization-and-diagram-opti…
emilbon99 May 1, 2026
9234436
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-413…
emilbon99 May 1, 2026
e705a92
Merge branch 'sy-4138-prepare-oracle-generated-spatial-primitives-for…
emilbon99 May 1, 2026
a9c11ea
Merge branch 'sy-4140-schematic-type-re-organization-and-diagram-opti…
emilbon99 May 1, 2026
b0e84fc
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-414…
emilbon99 May 1, 2026
136888a
addressed pull request comments
emilbon99 May 2, 2026
46b6a8b
Merge branch 'rc' of https://github.com/synnaxlabs/synnax into sy-414…
emilbon99 May 2, 2026
9ec21e9
Merge branch 'sy-4140-schematic-type-re-organization-and-diagram-opti…
emilbon99 May 2, 2026
c788b6e
SY-3833: Refresh schematic migration golden files
emilbon99 May 2, 2026
93662a3
SY-3833: Compare migration goldens semantically with MatchJSON
emilbon99 May 2, 2026
1ccb3ce
SY-3833: Address review comments
emilbon99 May 2, 2026
582d9ce
SY-3833: Set remoteCreated on navigateToLinkedSchematic
emilbon99 May 2, 2026
c236196
Merge remote-tracking branch 'origin/rc' into sy-3833-strongly-type-s…
emilbon99 May 5, 2026
7d2654a
improved core side translation
emilbon99 May 5, 2026
dfaf73c
removed currently useless schematic types
emilbon99 May 5, 2026
d5ed762
tuning
emilbon99 May 5, 2026
79b3aa1
addressed pull request comments
emilbon99 May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions arc/go/graph/codec_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions client/ts/src/schematic/access.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ describe("schematic", () => {
layout: {},
});
const randomSchematic = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "test",
data: {},
});
await expect(
userClient.schematics.retrieve({ key: randomSchematic.key }),
Expand All @@ -48,8 +48,8 @@ describe("schematic", () => {
layout: {},
});
const randomSchematic = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "test",
data: {},
});
const retrieved = await userClient.schematics.retrieve({
key: randomSchematic.key,
Expand All @@ -69,8 +69,8 @@ describe("schematic", () => {
layout: {},
});
await userClient.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "test",
data: {},
});
});

Expand All @@ -86,8 +86,8 @@ describe("schematic", () => {
});
await expect(
userClient.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "test",
data: {},
}),
).rejects.toThrow(AuthError);
});
Expand All @@ -103,8 +103,8 @@ describe("schematic", () => {
layout: {},
});
const randomSchematic = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "test",
data: {},
});
await userClient.schematics.delete(randomSchematic.key);
await expect(
Expand All @@ -123,8 +123,8 @@ describe("schematic", () => {
layout: {},
});
const randomSchematic = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "test",
data: {},
});
await expect(userClient.schematics.delete(randomSchematic.key)).rejects.toThrow(
AuthError,
Expand Down
26 changes: 20 additions & 6 deletions client/ts/src/schematic/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
// included in the file licenses/APL.txt.

import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
import { array, caseconv, record } from "@synnaxlabs/x";
import { array } from "@synnaxlabs/x";
import { z } from "zod";

import { symbol } from "@/schematic/symbol";
import {
type Key,
keyZ,
type Legend,
type New,
newZ,
type Schematic,
Expand All @@ -25,10 +26,9 @@ import { workspace } from "@/workspace";

const renameReqZ = z.object({ key: keyZ, name: z.string() });

const setDataReqZ = z.object({
key: keyZ,
data: caseconv.preserveCase(record.unknownZ()),
});
const setDataBodyZ = schematicZ.omit({ key: true, name: true, snapshot: true });
export type SetDataBody = z.input<typeof setDataBodyZ>;
const setDataReqZ = z.object({ key: keyZ, data: setDataBodyZ });
const deleteReqZ = z.object({ keys: keyZ.array() });

const copyReqZ = z.object({
Expand Down Expand Up @@ -95,7 +95,7 @@ export class Client {
);
}

async setData(key: Key, data: record.Unknown): Promise<void> {
async setData(key: Key, data: SetDataBody): Promise<void> {
await sendRequired(
this.client,
"/schematic/set-data",
Expand Down Expand Up @@ -143,3 +143,17 @@ export class Client {
return res.schematic;
}
}

export const ZERO_LEGEND: Legend = {
visible: true,
position: { x: 50, y: 50 },
colors: {},
};
Comment thread
greptile-apps[bot] marked this conversation as resolved.

export const ZERO_NEW: New = {
name: "",
legend: ZERO_LEGEND,
nodes: [],
edges: [],
props: {},
};
136 changes: 66 additions & 70 deletions client/ts/src/schematic/schematic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { uuid } from "@synnaxlabs/x";
import { describe, expect, it, test } from "vitest";

import { NotFoundError, ValidationError } from "@/errors";
import { schematic } from "@/schematic";
import { createTestClient } from "@/testutil/client";

const client = createTestClient();
Expand All @@ -22,17 +23,14 @@ describe("Schematic", () => {
name: "Schematic",
layout: { one: 1 },
});
const schematic = await client.schematics.create(ws.key, {
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "Schematic",
data: { One: 1 },
});
expect(schematic.name).toEqual("Schematic");
expect(schematic.key).not.toEqual(uuid.ZERO);
expect(schematic.data.One).toEqual(1);
const retrieved = await client.schematics.retrieve({
key: schematic.key,
});
expect(retrieved.data.One).toEqual(1);
expect(schem.name).toEqual("Schematic");
expect(schem.key).not.toEqual(uuid.ZERO);
const retrieved = await client.schematics.retrieve({ key: schem.key });
expect(retrieved.key).toEqual(schem.key);
});
});

Expand All @@ -42,33 +40,38 @@ describe("Schematic", () => {
name: "Schematic",
layout: { one: 1 },
});
const schematic = await client.schematics.create(ws.key, {
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "Schematic",
data: { one: 1 },
});
await client.schematics.rename(schematic.key, "Schematic2");
const res = await client.schematics.retrieve({
key: schematic.key,
});
await client.schematics.rename(schem.key, "Schematic2");
const res = await client.schematics.retrieve({ key: schem.key });
expect(res.name).toEqual("Schematic2");
});
});

describe("setData", () => {
test("set data", async () => {
test("set data replaces body fields while preserving key and name", async () => {
const ws = await client.workspaces.create({
name: "Schematic",
layout: { one: 1 },
});
const schematic = await client.schematics.create(ws.key, {
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "Schematic",
data: { one: 1 },
});
await client.schematics.setData(schematic.key, { two: 2 });
const res = await client.schematics.retrieve({
key: schematic.key,
});
expect(res.data.two).toEqual(2);
await client.schematics.setData(schem.key, {
...schematic.ZERO_NEW,
authority: 5,
nodes: [{ key: "n1", position: { x: 10, y: 20 }, zIndex: 0 }],
props: { n1: { variant: "valve" } },
});
const res = await client.schematics.retrieve({ key: schem.key });
expect(res.name).toEqual("Schematic");
expect(res.authority).toEqual(5);
expect(res.nodes).toHaveLength(1);
expect(res.nodes[0].key).toEqual("n1");
expect((res.props.n1 as Record<string, unknown>).variant).toEqual("valve");
});
});

Expand All @@ -78,57 +81,48 @@ describe("Schematic", () => {
name: "Schematic",
layout: { one: 1 },
});
const schematic = await client.schematics.create(ws.key, {
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "Schematic",
data: { one: 1 },
});
await client.schematics.delete(schematic.key);
await expect(client.schematics.retrieve({ key: schematic.key })).rejects.toThrow(
await client.schematics.delete(schem.key);
await expect(client.schematics.retrieve({ key: schem.key })).rejects.toThrow(
NotFoundError,
);
});
});
describe("case preservation", () => {
test("should preserve key casing in data field on create/retrieve cycle", async () => {
const ws = await client.workspaces.create({
name: "CaseTest",
layout: {},
});
const schematic = await client.schematics.create(ws.key, {
name: "CaseTest",
data: {
camelCaseKey: "value1",
PascalCaseKey: "value2",
snake_case_key: "value3",
nested: {
innerCamelCase: 123,
InnerPascalCase: { deepKey: true },

describe("props case preservation", () => {
test("preserves arbitrary key casing within prop values", async () => {
const ws = await client.workspaces.create({ name: "CaseTest", layout: {} });
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
props: {
n1: {
camelCaseKey: "value1",
PascalCaseKey: "value2",
snake_case_key: "value3",
nested: {
innerCamelCase: 123,
InnerPascalCase: { deepKey: true },
},
},
},
});

const retrieved = await client.schematics.retrieve({
key: schematic.key,
});

const data = retrieved.data as Record<string, unknown>;
expect(data.camelCaseKey).toEqual("value1");
expect(data.PascalCaseKey).toEqual("value2");
expect(data.snake_case_key).toEqual("value3");
expect((data.nested as Record<string, unknown>).innerCamelCase).toEqual(123);
const retrieved = await client.schematics.retrieve({ key: schem.key });
const props = retrieved.props.n1 as Record<string, unknown>;
expect(props.camelCaseKey).toEqual("value1");
expect(props.PascalCaseKey).toEqual("value2");
expect(props.snake_case_key).toEqual("value3");
expect((props.nested as Record<string, unknown>).innerCamelCase).toEqual(123);
expect(
(
(data.nested as Record<string, unknown>).InnerPascalCase as Record<
(props.nested as Record<string, unknown>).InnerPascalCase as Record<
string,
unknown
>
).deepKey,
).toEqual(true);
expect(Object.keys(data)).toContain("camelCaseKey");
expect(Object.keys(data)).toContain("PascalCaseKey");
expect(Object.keys(data)).toContain("snake_case_key");
expect(Object.keys(data)).not.toContain("camel_case_key");
expect(Object.keys(data)).not.toContain("pascal_case_key");
});
});

Expand All @@ -138,18 +132,17 @@ describe("Schematic", () => {
name: "Schematic",
layout: { one: 1 },
});
const schematic = await client.schematics.create(ws.key, {
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "Schematic",
data: { one: 1 },
});
const schematic2 = await client.schematics.copy({
key: schematic.key,
const schem2 = await client.schematics.copy({
key: schem.key,
name: "Schematic2",
snapshot: false,
});
expect(schematic2.name).toEqual("Schematic2");
expect(schematic2.key).not.toEqual(uuid.ZERO);
expect(schematic2.data.one).toEqual(1);
expect(schem2.name).toEqual("Schematic2");
expect(schem2.key).not.toEqual(uuid.ZERO);
});

describe("snapshot", () => {
Expand All @@ -158,17 +151,20 @@ describe("Schematic", () => {
name: "Schematic",
layout: { one: 1 },
});
const schematic = await client.schematics.create(ws.key, {
const schem = await client.schematics.create(ws.key, {
...schematic.ZERO_NEW,
name: "Schematic",
data: { one: 1 },
});
const schematic2 = await client.schematics.copy({
key: schematic.key,
const schem2 = await client.schematics.copy({
key: schem.key,
name: "Schematic2",
snapshot: true,
});
await expect(
client.schematics.setData(schematic2.key, { two: 2 }),
client.schematics.setData(schem2.key, {
...schematic.ZERO_NEW,
authority: 2,
}),
).rejects.toThrow(ValidationError);
});
});
Expand Down
Loading
Loading