Skip to content

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

fix(frontend): date an access grant's creation and expiry in one form

zchpeter3ec920a158dc
diff --git a/docs/design/timestamp-display.md b/docs/design/timestamp-display.md
index e7477d2006..7aaf82c16f 100644
--- a/docs/design/timestamp-display.md
+++ b/docs/design/timestamp-display.md
@@ -135,20 +135,20 @@ Objective divider: **exportable-as-evidence or a detail view → full; scannable
compact.**
**Column width follows the form.** Every form has a width it needs on one line
-(`TIMESTAMP_COLUMN_WIDTH`), measured over every time zone and shipped locale: 184 for the
-work-queue form, whose widest is Spanish in the future tense, and 192, 270 and 292 for the
-compact, operational and full date-time forms. Moving a surface off relative wording lengthens its
-value, so a column sized for the old wording breaks the new one across two lines or cuts it off.
-The columns this design sizes never open narrower than their form's width, so nothing is cut
-unless the reader chooses it; a queue-form column elsewhere may still be sized for the past tense
-alone. How the width is kept depends on the table. Where the browser spreads spare width across
-every sized column, the open-ended column — a title, a run's detail — is left unsized to take it,
-so the date neither wraps nor swells; the audit log does not do this yet, and its date grows with
-the rest. Where a table fits its columns to the container itself, a date column does not grow, so
-its minimum floors a drag without also flooring the width it opens at, and a column raised to its
-floor takes that width from the others rather than overrunning the container. That minimum is one
-value for every form, room for the date; narrower than its form a cell ellipsizes, and one drag
-gives the rest back.
+(`TIMESTAMP_COLUMN_WIDTH`), measured over every time zone and shipped locale: 192, 270 and 292 for
+the compact, operational and full date-time forms. Moving a surface off relative wording lengthens
+its value, so a column sized for the old wording breaks the new one across two lines or cuts it
+off. The columns this design sizes never open narrower than their form's width, so nothing is cut
+unless the reader chooses it. The work-queue form has no sized column here; its widest reading is
+Spanish in the future tense, 183px, so a queue-form column elsewhere may be sized for the past
+tense alone. How the width is kept depends on the table. Where the browser spreads spare width
+across every sized column, the open-ended column — a title, a run's detail — is left unsized to
+take it, so the date neither wraps nor swells; the audit log does not do this yet, and its date
+grows with the rest. Where a table fits its columns to the container itself, a date column does
+not grow, so its minimum floors a drag without also flooring the width it opens at, and a column
+raised to its floor takes that width from the others rather than overrunning the container. That
+minimum is one value for every form, room for the date; narrower than its form a cell ellipsizes,
+and one drag gives the rest back.
## Surface classification
@@ -167,7 +167,7 @@ Every current `HumanizeTs` call site, classified under the principle:
| Schema sync status | `modules/sql-editor/components/SchemaPane/SyncSchemaButton.tsx`, `routes/project/ProjectSyncSchemaPage.tsx`, `components/database/DatabaseOverviewInfo.tsx` | Freshness | 30d switch |
| Agent chat | `modules/agent/components/AgentWindow.tsx` | Feed | 30d switch |
| Plan-check run time | `components/plan-check/PlanCheckSection.tsx` (bare `toLocaleString()` today — adopts `HumanizeTs`) | Freshness | 30d switch |
-| Access-grant creation time | `routes/project/ProjectAccessGrantsPage.tsx` (`AccessGrantRow`; full absolute today — adopts `HumanizeTs`). Creation meta on a management roster; the grant's operational fact is its *expiration*, which stays operational mode | Work queue / meta | 30d switch |
+| Access-grant creation time | `routes/project/ProjectAccessGrantsPage.tsx` (`AccessGrantRow`; full absolute today — adopts `HumanizeTs`). Shares the operational form with the expiration beside it: two dates in one row read in one format, and consistency outranks the freshness a relative age would add. The row's status, statement and creator carry what a reader acts on — the status turns Expired by itself — so the dates hold their width and the spare goes to those columns | Operational | Operational (D6 tooltip) |
| **Database changelog** | `routes/project/database-detail/changelog/DatabaseChangelogTable.tsx` | **History view** | **Absolute always — compact tier (D7)** |
| **Database revisions** | `routes/project/database-detail/revision/DatabaseRevisionTable.tsx` | **History view** | **Absolute always — compact tier (D7)** |
| **Task-run history** | `routes/project/plan-detail/components/deploy/DeployTaskRunHistorySheet.tsx`, `routes/project/issue-detail/components/IssueDetailTaskRunTable.tsx` | **History view** | **Absolute always — compact tier (D7)** |
diff --git a/frontend/src/components/timestampColumn.test.ts b/frontend/src/components/timestampColumn.test.ts
index e8ec379589..00eb9a0f79 100644
--- a/frontend/src/components/timestampColumn.test.ts
+++ b/frontend/src/components/timestampColumn.test.ts
@@ -8,12 +8,7 @@ import {
// jsdom has no font metrics, so these were measured in a browser: every IANA
// zone, the five shipped locales, and every month and local hour of a year,
// at 14px in the macOS system font, plus 32px of cell padding.
-const MEASURED_FORM = {
- queue: 183,
- compact: 191,
- operational: 269,
- datetime: 291,
-};
+const MEASURED_FORM = { compact: 191, operational: 269, datetime: 291 };
const MEASURED_DATE = 140;
const forms = Object.keys(MEASURED_FORM) as (keyof typeof MEASURED_FORM)[];
diff --git a/frontend/src/components/timestampColumn.ts b/frontend/src/components/timestampColumn.ts
index b5a71a3f20..090941a894 100644
--- a/frontend/src/components/timestampColumn.ts
+++ b/frontend/src/components/timestampColumn.ts
@@ -5,12 +5,10 @@
* The width a table column opens at to hold a form on one line: the widest
* rendering across every time zone and shipped locale at a table's 14px, plus
* a cell's 32px of padding. For the forms that show a zone that is en-US in
- * Chatham, GMT+12:45; for compact, en-US at a two-digit hour in any zone; for
- * the work-queue form, es-ES in the future tense. Measured with the macOS
- * system font; Segoe UI is not.
+ * Chatham, GMT+12:45; for compact, en-US at a two-digit hour in any zone.
+ * Measured with the macOS system font; Segoe UI is not.
*/
export const TIMESTAMP_COLUMN_WIDTH = {
- queue: 184,
compact: 192,
operational: 270,
datetime: 292,
diff --git a/frontend/src/routes/project/ProjectAccessGrantsPage.test.tsx b/frontend/src/routes/project/ProjectAccessGrantsPage.test.tsx
index edd87ad7e9..bce5e45385 100644
--- a/frontend/src/routes/project/ProjectAccessGrantsPage.test.tsx
+++ b/frontend/src/routes/project/ProjectAccessGrantsPage.test.tsx
@@ -40,7 +40,7 @@ describe("grantColumns", () => {
"opens both dates whole in a %ipx table",
(containerWidth) => {
const widths = distributeColumnWidths(columns, containerWidth);
- expect(widths[at("created")]).toBe(TIMESTAMP_COLUMN_WIDTH.queue);
+ expect(widths[at("created")]).toBe(TIMESTAMP_COLUMN_WIDTH.operational);
expect(widths[at("expiration")]).toBe(TIMESTAMP_COLUMN_WIDTH.operational);
}
);
@@ -60,7 +60,7 @@ describe("grantColumns", () => {
columns.forEach((column, i) => {
expect(widths[i]).toBeGreaterThanOrEqual(column.minWidth);
});
- expect(widths[at("created")]).toBe(TIMESTAMP_COLUMN_WIDTH.queue);
+ expect(widths[at("created")]).toBe(TIMESTAMP_COLUMN_WIDTH.operational);
expect(widths[at("expiration")]).toBe(TIMESTAMP_COLUMN_WIDTH.operational);
}
});
@@ -79,7 +79,7 @@ describe("AccessGrantRow", () => {
}
});
- test("dates a grant in its forms, each ellipsizing when narrowed", () => {
+ test("dates a grant's creation and expiry in one form, each ellipsizing", () => {
const container = document.createElement("div");
const root = createRoot(container);
roots.push(root);
@@ -109,7 +109,10 @@ describe("AccessGrantRow", () => {
)
);
- expect(shownTimestampModes(container)).toEqual(["queue", "operational"]);
+ expect(shownTimestampModes(container)).toEqual([
+ "operational",
+ "operational",
+ ]);
expect(shownTimestampInstants(container)).toEqual([
String(nowMs - 60_000),
String(nowMs + 86_400_000),
diff --git a/frontend/src/routes/project/ProjectAccessGrantsPage.tsx b/frontend/src/routes/project/ProjectAccessGrantsPage.tsx
index 72ab221a88..19fefb101c 100644
--- a/frontend/src/routes/project/ProjectAccessGrantsPage.tsx
+++ b/frontend/src/routes/project/ProjectAccessGrantsPage.tsx
@@ -107,7 +107,7 @@ export const grantColumns = (t: (key: string) => string): GrantColumn[] => [
{
key: "created",
title: t("common.created-at"),
- defaultWidth: TIMESTAMP_COLUMN_WIDTH.queue,
+ defaultWidth: TIMESTAMP_COLUMN_WIDTH.operational,
minWidth: TIMESTAMP_COLUMN_MIN_WIDTH,
grow: false,
sortKey: "create_time",
@@ -759,7 +759,11 @@ export function AccessGrantRow({
</TableCell>
<TableCell>
{createdTimeMs !== undefined ? (
- <HumanizeTs className="block truncate" tsMs={createdTimeMs} />
+ <HumanizeTs
+ className="block truncate"
+ mode="operational"
+ tsMs={createdTimeMs}
+ />
) : (
"-"
)}