|
3 | 3 | assistantMessage, |
4 | 4 | setupTimeline, |
5 | 5 | shell, |
| 6 | + textPart, |
6 | 7 | toolPart, |
7 | 8 | userMessage, |
8 | 9 | } from "../performance/timeline-stability/fixture" |
@@ -119,6 +120,44 @@ test("keeps the patch card inside a fractionally short virtual row", async ({ pa |
119 | 120 | expect(geometry.clipMargin).toBe("0.5px") |
120 | 121 | }) |
121 | 122 |
|
| 123 | +test("allows paint rounding for every framed row but not fixed turn gaps", async ({ page }) => { |
| 124 | + const secondUserID = "msg_outline_second_user" |
| 125 | + await setupTimeline(page, { |
| 126 | + messages: [ |
| 127 | + userMessage(undefined, { |
| 128 | + summary: { |
| 129 | + diffs: [ |
| 130 | + { |
| 131 | + file: "src/summary.ts", |
| 132 | + additions: 1, |
| 133 | + deletions: 1, |
| 134 | + patch: "@@ -1 +1 @@\n-export const value = 1\n+export const value = 2", |
| 135 | + }, |
| 136 | + ], |
| 137 | + }, |
| 138 | + }), |
| 139 | + assistantMessage([textPart("prt_outline_text", "Assistant text")]), |
| 140 | + userMessage(undefined, { id: secondUserID, created: 1700000010000 }), |
| 141 | + assistantMessage([], { |
| 142 | + id: "msg_outline_second_assistant", |
| 143 | + parentID: secondUserID, |
| 144 | + created: 1700000011000, |
| 145 | + }), |
| 146 | + ], |
| 147 | + }) |
| 148 | + await expect(page.locator('[data-timeline-row="DiffSummary"]')).toBeVisible() |
| 149 | + await expect(page.locator('[data-timeline-row="TurnGap"]')).toBeVisible() |
| 150 | + |
| 151 | + const rows = await page.locator("[data-timeline-key]").evaluateAll((elements) => |
| 152 | + elements.map((element) => ({ |
| 153 | + tag: element.querySelector<HTMLElement>("[data-timeline-row]")?.dataset.timelineRow, |
| 154 | + clipMargin: getComputedStyle(element).overflowClipMargin, |
| 155 | + })), |
| 156 | + ) |
| 157 | + expect(rows.filter((row) => row.tag !== "TurnGap").every((row) => row.clipMargin === "0.5px")).toBe(true) |
| 158 | + expect(rows.filter((row) => row.tag === "TurnGap")).toEqual([{ tag: "TurnGap", clipMargin: "0px" }]) |
| 159 | +}) |
| 160 | + |
122 | 161 | async function captureCardEdges(page: Page, card: Locator) { |
123 | 162 | const box = await card.boundingBox() |
124 | 163 | if (!box) throw new Error("Tool card bounds are unavailable") |
|
0 commit comments