Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(frontend): fit the access grants to their scroller, and pin the kept space

zchpeter3ea289759c00
diff --git a/frontend/src/components/HumanizeTs.test.tsx b/frontend/src/components/HumanizeTs.test.tsx
index be058135fc..6e803a3fea 100644
--- a/frontend/src/components/HumanizeTs.test.tsx
+++ b/frontend/src/components/HumanizeTs.test.tsx
@@ -165,6 +165,8 @@ describe("HumanizeTs", () => {
});
// Each piece of a fitted label, and whether it keeps its width or gives way.
+ // A kept space must also be preformatted: a flex item drops the space at its
+ // edge, and the cut time then runs into the date.
const pieces = (box: Element | null) =>
Array.from(box?.children ?? []).map((piece) => {
const fit = piece.classList.contains("truncate")
@@ -172,7 +174,8 @@ describe("HumanizeTs", () => {
: piece.classList.contains("shrink-0")
? "kept"
: "loose";
- return `${piece.textContent}:${fit}`;
+ const pre = piece.classList.contains("whitespace-pre") ? " pre" : "";
+ return `${piece.textContent}:${fit}${pre}`;
});
test.each([
@@ -184,12 +187,12 @@ describe("HumanizeTs", () => {
[
"after the date and a space",
{ date: "2026年9月21日", rest: " 23:28", dateFirst: true },
- ["2026年9月21日:kept", " :kept", "23:28:cut"],
+ ["2026年9月21日:kept", " :kept pre", "23:28:cut"],
],
[
"before the date",
{ date: "21 thg 9, 2026", rest: "23:28 GMT+8 ", dateFirst: false },
- ["23:28 GMT+8:cut", " :kept", "21 thg 9, 2026:kept"],
+ ["23:28 GMT+8:cut", " :kept pre", "21 thg 9, 2026:kept"],
],
])(
"keeps a narrowed date whole and cuts the time written %s",
diff --git a/frontend/src/components/HumanizeTs.tsx b/frontend/src/components/HumanizeTs.tsx
index 2ad4912c7c..a74124b797 100644
--- a/frontend/src/components/HumanizeTs.tsx
+++ b/frontend/src/components/HumanizeTs.tsx
@@ -35,8 +35,9 @@ interface HumanizeTsProps {
mode?: TimeDisplayMode;
className?: string;
/**
- * Keep the label on one line inside its box. Where the box is narrower than
- * the label, the time and zone ellipsize and the date stays whole.
+ * Keep the label on one line inside its box. Where the box is too narrow, a
+ * date-time keeps its date whole and ellipsizes its time and zone; any
+ * other label ellipsizes from its end.
*/
truncate?: boolean;
/**
diff --git a/frontend/src/routes/project/ProjectAccessGrantsPage.tsx b/frontend/src/routes/project/ProjectAccessGrantsPage.tsx
index c8cbdcb57d..0c8bcdd8dc 100644
--- a/frontend/src/routes/project/ProjectAccessGrantsPage.tsx
+++ b/frontend/src/routes/project/ProjectAccessGrantsPage.tsx
@@ -626,8 +626,12 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {
{t("common.no-data")}
</div>
) : (
- <ProjectPageContent ref={fitTableContainer}>
- <div className="border rounded-sm overflow-x-auto">
+ <ProjectPageContent>
+ {/* Fitted to the scroller, inside its border, not the page. */}
+ <div
+ ref={fitTableContainer}
+ className="border rounded-sm overflow-x-auto"
+ >
<Table
className="w-auto table-fixed"
style={{ width: `${totalWidth}px` }}