mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-25 02:32:47 +00:00
* perf(app): keep large diffs responsive Render file headers on the canvas and bound expensive text shaping to the active viewport while preserving sticky, hover, and horizontal-scroll behavior. Let native scroll cancellation arbitrate header presses so finger scrolling cannot expand files. * test(app): assert canvas diff header accessibility * test(app): assert canvas diff header semantics
23 lines
873 B
TypeScript
23 lines
873 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { allocateDiffHeaderTextWidths } from "./file-header-presentation";
|
|
|
|
describe("diff file header text allocation", () => {
|
|
it("gives the filename its full width before truncating the directory", () => {
|
|
expect(
|
|
allocateDiffHeaderTextWidths({ available: 120, nameWidth: 80, directoryWidth: 100 }),
|
|
).toEqual({ name: 80, directory: 36 });
|
|
});
|
|
|
|
it("uses all available width for a filename that cannot fit", () => {
|
|
expect(
|
|
allocateDiffHeaderTextWidths({ available: 60, nameWidth: 80, directoryWidth: 100 }),
|
|
).toEqual({ name: 60, directory: 0 });
|
|
});
|
|
|
|
it("does not truncate a fitting filename merely to reserve the gap", () => {
|
|
expect(
|
|
allocateDiffHeaderTextWidths({ available: 82, nameWidth: 80, directoryWidth: 100 }),
|
|
).toEqual({ name: 80, directory: 0 });
|
|
});
|
|
});
|