Skip to content

Commit 1ecb939

Browse files
committed
Fix modal stacking, improve change log notes, and relax deleted-user rejoin
1 parent c77022a commit 1ecb939

4 files changed

Lines changed: 30 additions & 9 deletions

File tree

functions/_lib/db.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ export const ensureUser = async (
376376
tokenPayload?: Record<string, unknown>,
377377
): Promise<void> => {
378378
await ensureSchema(env);
379-
const deleted = await env.DB.prepare("SELECT id FROM deleted_users WHERE id = ? LIMIT 1").bind(userId).first<{ id: string }>();
380-
if (deleted?.id) {
381-
throw new Error("Account removed by admin");
382-
}
383379
const now = new Date().toISOString();
384380
const username = deriveDefaultName(userId, tokenPayload);
385381
const email = deriveDefaultEmail(userId, tokenPayload);
@@ -695,7 +691,18 @@ const upsertOwnedResource = async (
695691
}
696692
}
697693

698-
await createResourceChange(env, kind, id, isCreate ? "created" : "updated", actorUserId, name);
694+
const changeDetails: string[] = [];
695+
if (isCreate) {
696+
changeDetails.push("initial record");
697+
} else {
698+
if (existing && existing.name !== name) changeDetails.push("name");
699+
if (existing && existing.visibility !== visibility) changeDetails.push("visibility");
700+
if (existing && existing.payload_json !== payload) changeDetails.push("content");
701+
}
702+
const note = isCreate
703+
? `Created "${name}" (${changeDetails.join(", ")})`
704+
: `Updated "${name}" (${changeDetails.join(", ") || "content"})`;
705+
await createResourceChange(env, kind, id, isCreate ? "created" : "updated", actorUserId, note);
699706

700707
return { ok: true };
701708
};

src/components/AppShell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export function AppShell() {
5252
<p className="field-help">To continue:</p>
5353
<ul className="field-help access-pending-list">
5454
<li>Open User Settings.</li>
55-
<li>Add your full name and valid email address.</li>
56-
<li>Add an access request note so admins know why you need access.</li>
55+
<li>Add your name and valid email address.</li>
56+
<li>Optionally add an access request note to explain why you need access.</li>
5757
<li>Wait for admin approval. You will keep profile access while pending.</li>
5858
</ul>
5959
</section>

src/components/Sidebar.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,12 @@ export function Sidebar() {
17531753
) : null}
17541754

17551755
{changeLogPopup ? (
1756-
<div aria-label="Change Log" aria-modal="true" className="library-manager-overlay" role="dialog">
1756+
<div
1757+
aria-label="Change Log"
1758+
aria-modal="true"
1759+
className="library-manager-overlay library-manager-overlay-top"
1760+
role="dialog"
1761+
>
17571762
<div className="library-manager-card">
17581763
<div className="library-manager-header">
17591764
<h2>Change Log · {changeLogPopup.label}</h2>
@@ -1788,7 +1793,12 @@ export function Sidebar() {
17881793
) : null}
17891794

17901795
{resourceDetailsPopup ? (
1791-
<div aria-label="Resource Details" aria-modal="true" className="library-manager-overlay" role="dialog">
1796+
<div
1797+
aria-label="Resource Details"
1798+
aria-modal="true"
1799+
className="library-manager-overlay library-manager-overlay-top"
1800+
role="dialog"
1801+
>
17921802
<div className="library-manager-card user-profile-popup">
17931803
<div className="library-manager-header">
17941804
<h2>Details · {resourceDetailsPopup.label}</h2>

src/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,10 @@ input {
11381138
padding: 18px;
11391139
}
11401140

1141+
.library-manager-overlay-top {
1142+
z-index: 60;
1143+
}
1144+
11411145
.library-manager-card {
11421146
width: min(1120px, 96vw);
11431147
max-height: min(86vh, 980px);

0 commit comments

Comments
 (0)