Skip to content

Commit 1756b01

Browse files
Improve content compatibility messages for structured content matching
Co-authored-by: me <[email protected]>
1 parent 78fd894 commit 1756b01

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

client/src/components/ToolResults.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const checkContentCompatibility = (
2727
if (textBlocks.length === 0) {
2828
return {
2929
isCompatible: false,
30-
message: "No text blocks found",
30+
message: "No text blocks to match structured content",
3131
};
3232
}
3333

@@ -46,7 +46,7 @@ const checkContentCompatibility = (
4646
if (isEqual) {
4747
return {
4848
isCompatible: true,
49-
message: `Matching JSON found${textBlocks.length > 1 ? " (multiple blocks)" : ""}${unstructuredContent.length > textBlocks.length ? " + other content" : ""}`,
49+
message: `Structured content matches text block${textBlocks.length > 1 ? " (multiple blocks)" : ""}${unstructuredContent.length > textBlocks.length ? " + other content" : ""}`,
5050
};
5151
}
5252
} catch {
@@ -57,7 +57,7 @@ const checkContentCompatibility = (
5757

5858
return {
5959
isCompatible: false,
60-
message: "No matching JSON found",
60+
message: "No text block matches structured content",
6161
};
6262
};
6363

client/src/components/__tests__/ToolsTab.test.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ describe("ToolsTab", () => {
354354
});
355355

356356
// Should show compatibility result
357-
expect(screen.getByText(/matching json/i)).toBeInTheDocument();
357+
expect(
358+
screen.getByText(/structured content matches/i),
359+
).toBeInTheDocument();
358360
});
359361

360362
it("should accept multiple content blocks with structured output", () => {
@@ -374,7 +376,9 @@ describe("ToolsTab", () => {
374376
});
375377

376378
// Should show compatible result with multiple blocks
377-
expect(screen.getByText(/matching json.*multiple/i)).toBeInTheDocument();
379+
expect(
380+
screen.getByText(/structured content matches.*multiple/i),
381+
).toBeInTheDocument();
378382
});
379383

380384
it("should accept mixed content types with structured output", () => {
@@ -445,7 +449,9 @@ describe("ToolsTab", () => {
445449

446450
// Should not show any compatibility messages
447451
expect(
448-
screen.queryByText(/matching json|no text blocks|no matching/i),
452+
screen.queryByText(
453+
/structured content matches|no text blocks|no.*matches/i,
454+
),
449455
).not.toBeInTheDocument();
450456
});
451457
});

0 commit comments

Comments
 (0)