feat: apikey alias field + markdown/patch authorship display

- ApiKeyCreationModal: required Alias input (reuse alias = renew, with
  banner); align roles to backend allowlist (guest -> user, default
  user); fix copy bug (generatedKey.key).
- MarkdownContent + PatchCards: show author / created / last modified
  (+ by whom); formatDateTime helper (null -> "—").

Branched off fix/buildconfig-cachebust (carries the contenthash +
BuildConfig fix already deployed to prod).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
h z
2026-05-16 22:51:47 +01:00
parent ba08bba7de
commit 3ec528701e
4 changed files with 79 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
import React, { useState } from "react";
import { Plus, Pencil, Trash2, Save, Layers } from "lucide-react";
import { Plus, Pencil, Trash2, Save, Layers, User, Clock } from "lucide-react";
import { formatDateTime } from "../../lib/utils";
import MarkdownView from "./MarkdownView";
import PermissionGuard from "../PermissionGuard";
import {
@@ -137,6 +138,22 @@ const PatchCards = ({ markdownId }) => {
</div>
</PermissionGuard>
</div>
<div className="flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-border/40 px-5 py-1.5 font-mono text-[11px] text-muted-foreground">
<span className="inline-flex items-center gap-1">
<User className="h-3 w-3 text-secondary" />
{patch.author || "—"}
</span>
<span className="inline-flex items-center gap-1">
<Clock className="h-3 w-3" />
{formatDateTime(patch.created_at)}
</span>
<span className="inline-flex items-center gap-1">
edited {formatDateTime(patch.updated_at)}
{patch.last_modified_by
? ` by ${patch.last_modified_by}`
: ""}
</span>
</div>
<div className="px-5 py-4">
<MarkdownView content={{ markdown: patch.content }} />
</div>