Skip to content

Commit f095a4f

Browse files
test(web): keep Markdown gutter styling private
1 parent 0c200c5 commit f095a4f

2 files changed

Lines changed: 1 addition & 43 deletions

File tree

‎apps/web/src/components/ChatMarkdown.test.tsx‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ vi.mock("~/lib/openPullRequestLink", () => ({
6060
import ChatMarkdown, {
6161
canUseMarkdownFileShellActions,
6262
hasMarkdownFilePrimaryAction,
63-
orderedListGutterStyle,
6463
shouldUseMarkdownFileBrowserPrimaryAction,
6564
} from "./ChatMarkdown";
6665

@@ -640,47 +639,6 @@ describe("shouldUseMarkdownFileBrowserPrimaryAction", () => {
640639
});
641640
});
642641

643-
describe("orderedListGutterStyle", () => {
644-
it("leaves the default gutter alone for single-digit lists", () => {
645-
expect(orderedListGutterStyle(9, undefined)).toBeUndefined();
646-
});
647-
648-
it("widens the gutter for two-digit lists", () => {
649-
expect(orderedListGutterStyle(99, undefined)).toEqual({ "--list-gutter": "3ch" });
650-
});
651-
652-
it("widens the gutter for a two-digit list that starts above 1", () => {
653-
// start=50 + 49 items => last marker is "98", still two digits.
654-
expect(orderedListGutterStyle(49, 50)).toEqual({ "--list-gutter": "3ch" });
655-
});
656-
657-
it("widens the gutter once the last marker reaches three digits", () => {
658-
// item 100 is the bug from #6512: a 100-item list starting at 1.
659-
expect(orderedListGutterStyle(100, undefined)).toEqual({ "--list-gutter": "4ch" });
660-
});
661-
662-
it("accounts for a non-default start attribute", () => {
663-
// start=95 + 9 items => last marker is "103", three digits.
664-
expect(orderedListGutterStyle(9, 95)).toEqual({ "--list-gutter": "4ch" });
665-
expect(orderedListGutterStyle(5, "999995")).toEqual({ "--list-gutter": "7ch" });
666-
});
667-
668-
it("scales further for four-digit markers", () => {
669-
expect(orderedListGutterStyle(1000, undefined)).toEqual({ "--list-gutter": "5ch" });
670-
});
671-
672-
it("uses the widest marker and includes a negative start's minus sign", () => {
673-
expect(orderedListGutterStyle(1001, -1000)).toEqual({ "--list-gutter": "6ch" });
674-
expect(orderedListGutterStyle(3, -15)).toEqual({ "--list-gutter": "4ch" });
675-
expect(orderedListGutterStyle(3, -5)).toEqual({ "--list-gutter": "3ch" });
676-
});
677-
678-
it("treats a missing/zero item count as a single item", () => {
679-
expect(orderedListGutterStyle(0, undefined)).toBeUndefined();
680-
expect(orderedListGutterStyle(0, 100)).toEqual({ "--list-gutter": "4ch" });
681-
});
682-
});
683-
684642
describe("ChatMarkdown Windows file links", () => {
685643
const environmentId = EnvironmentId.make("env-windows");
686644

‎apps/web/src/components/ChatMarkdown.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function findTaskListMarkerOffset(markdown: string, listItemStart: number): numb
340340
* message's overflow. Widen the gutter to fit the widest marker, including a
341341
* negative marker's minus sign.
342342
*/
343-
export function orderedListGutterStyle(
343+
function orderedListGutterStyle(
344344
itemCount: number,
345345
start: unknown,
346346
): { "--list-gutter": string } | undefined {

0 commit comments

Comments
 (0)