fix: update split into parts max params

This commit is contained in:
2026-10-05 09:12:19 +05:00
parent a9327eaa27
commit 2a282b48f8
5 changed files with 21 additions and 10 deletions
@@ -102,6 +102,10 @@
display: flex;
align-items: center;
justify-content: center;
/* Вложен в PreviewTile.canvas: без растяжения сжимался по контенту и
ломал parts-grid в одну колонку. */
width: 100%;
align-self: stretch;
min-height: clamp(var(--space-brand), 30vh, 60vh);
border: var(--size-border) solid var(--color-border);
border-radius: var(--radius-s);
@@ -309,7 +309,7 @@
const base = toDisplayError(e);
const msg = base.kind === "i18n" ? t(base.key, base.vars) : base.text;
throw new Error(
t("chain.stepError", {
t("steps.stepError", {
n: i + 1,
title: stepTitle(stepTool.id),
msg,
+4 -4
View File
@@ -699,18 +699,18 @@ describe("split-into-parts", () => {
}
});
it("работает максимум 6x6 = 36 частей", async () => {
it("принимает максимальную сетку 32x32 = 1024 части (потолок стража)", async () => {
const tool = TOOLS.find((t) => t.id === "split-into-parts")!;
const files = asFiles(
await tool.run({
source: solid(120, 120),
params: sanitizeSchemaParams(tool.schema, {
columns: 6,
rows: 6,
columns: 32,
rows: 32,
}),
}),
).files;
expect(files).toHaveLength(36);
expect(files).toHaveLength(1024);
});
it("выбрасывает errors.tooManyParts при переполнении", () => {
+3 -3
View File
@@ -402,7 +402,7 @@ const tileTool: Tool<TileParams> = {
run: imgTool((img, p) => tile(img, p.columns, p.rows)),
};
const MAX_SPLIT_PARTS = 1000;
const MAX_SPLIT_PARTS = 1024;
interface SplitPartsParams {
columns: number;
@@ -413,14 +413,14 @@ export const splitPartsSchema = toolSchema<SplitPartsParams>({
columns: field.number({
label: "fields.columns",
min: 1,
max: 6,
max: 32,
step: 1,
default: 2,
}),
rows: field.number({
label: "fields.rows",
min: 1,
max: 6,
max: 32,
step: 1,
default: 2,
}),