Spaces:
Sleeping
Sleeping
feat: put invite links on hold; single brand header everywhere
Browse filesInvite links are dormant behind CCR_INVITES_ENABLED (default off): creation
409s, existing tokens stop redeeming with a clear message, /admin hides the
section. Pre-assigned roles remain the onboarding path; machinery and audit
history stay intact for re-enabling. Header: the CCR logo (which already
reads 'CCR') stands alone with the tagline 'Psychological Text Analysis with
Contextualized Construct Representation' - app, guide, and product topbars
now identical.
- backend/app/admin.py +9 -0
- backend/app/auth.py +8 -0
- backend/app/guide.html +3 -3
- backend/app/main.py +10 -1
- backend/app/product.html +15 -13
- backend/static/assets/{index-yUJ_ILdX.css → index-4rNvOlrh.css} +1 -1
- backend/static/assets/{index-BHSVf-_4.js → index-DXNnKweH.js} +0 -0
- backend/static/index.html +2 -2
- backend/tests/test_admin.py +36 -0
- frontend/src/AdminPage.jsx +5 -0
- frontend/src/App.jsx +4 -3
- frontend/src/styles.css +1 -1
backend/app/admin.py
CHANGED
|
@@ -99,6 +99,9 @@ def overview(db: Session = Depends(get_db), _admin: dict = Depends(require_admin
|
|
| 99 |
.filter(Construct.verification_status != "verified")
|
| 100 |
.filter_by(is_seed=True)
|
| 101 |
.count(),
|
|
|
|
|
|
|
|
|
|
| 102 |
}
|
| 103 |
|
| 104 |
|
|
@@ -230,6 +233,12 @@ def create_invite(
|
|
| 230 |
the invited tier (external/lab only - staff is granted, never invited).
|
| 231 |
Backed by an Invite row, so it can be revoked early and shows who
|
| 232 |
signed up through it."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
role = str(body.get("role", "")).strip().lower()
|
| 234 |
invite = Invite(id=uuid.uuid4().hex, role=auth.normalize_role(role),
|
| 235 |
token="", created_by=admin.get("email", ""), expires_at="")
|
|
|
|
| 99 |
.filter(Construct.verification_status != "verified")
|
| 100 |
.filter_by(is_seed=True)
|
| 101 |
.count(),
|
| 102 |
+
# Feature flags the admin UI adapts to (invites are on hold; the
|
| 103 |
+
# section hides when this is false).
|
| 104 |
+
"invites_enabled": auth.invites_enabled(),
|
| 105 |
}
|
| 106 |
|
| 107 |
|
|
|
|
| 233 |
the invited tier (external/lab only - staff is granted, never invited).
|
| 234 |
Backed by an Invite row, so it can be revoked early and shows who
|
| 235 |
signed up through it."""
|
| 236 |
+
if not auth.invites_enabled():
|
| 237 |
+
raise HTTPException(
|
| 238 |
+
409,
|
| 239 |
+
"Invite links are on hold on this instance. Pre-assign the "
|
| 240 |
+
"person's email a role instead (Access before sign-in).",
|
| 241 |
+
)
|
| 242 |
role = str(body.get("role", "")).strip().lower()
|
| 243 |
invite = Invite(id=uuid.uuid4().hex, role=auth.normalize_role(role),
|
| 244 |
token="", created_by=admin.get("email", ""), expires_at="")
|
backend/app/auth.py
CHANGED
|
@@ -131,6 +131,14 @@ def role_is_staff(role: str | None) -> bool:
|
|
| 131 |
return normalize_role(role) in STAFF_ROLES
|
| 132 |
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
# ---------------------------------------------------------- passwords
|
| 135 |
def hash_password(password: str) -> str:
|
| 136 |
salt = secrets.token_bytes(16)
|
|
|
|
| 131 |
return normalize_role(role) in STAFF_ROLES
|
| 132 |
|
| 133 |
|
| 134 |
+
def invites_enabled() -> bool:
|
| 135 |
+
"""Invite links are ON HOLD (maintainer decision 2026-07-31): creation and
|
| 136 |
+
redemption are disabled, existing links stop working, and the admin UI
|
| 137 |
+
hides the section. Email-bound pre-assigned roles are the supported way
|
| 138 |
+
to onboard people. Flip CCR_INVITES_ENABLED=1 to bring links back."""
|
| 139 |
+
return os.environ.get("CCR_INVITES_ENABLED", "0") == "1"
|
| 140 |
+
|
| 141 |
+
|
| 142 |
# ---------------------------------------------------------- passwords
|
| 143 |
def hash_password(password: str) -> str:
|
| 144 |
salt = secrets.token_bytes(16)
|
backend/app/guide.html
CHANGED
|
@@ -34,7 +34,7 @@
|
|
| 34 |
text-decoration: none; letter-spacing: .2px; white-space: nowrap;
|
| 35 |
}
|
| 36 |
.topbar .brand { display: inline-flex; align-items: center; gap: .6rem; }
|
| 37 |
-
.brand-logo { height:
|
| 38 |
.topbar .lab { color: rgba(255,255,255,.6); font-size: .82rem; }
|
| 39 |
.topbar .brand:hover { opacity: .88; }
|
| 40 |
.topbar nav { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
|
|
@@ -110,8 +110,8 @@
|
|
| 110 |
</g>
|
| 111 |
<circle cx="481" cy="624" r="15" fill="#339B98"/>
|
| 112 |
<circle cx="538" cy="624" r="15" fill="#339B98"/>
|
| 113 |
-
</svg>
|
| 114 |
-
<span class="lab">
|
| 115 |
<nav>
|
| 116 |
<a href="/">Dashboard</a>
|
| 117 |
<a href="/welcome">About</a>
|
|
|
|
| 34 |
text-decoration: none; letter-spacing: .2px; white-space: nowrap;
|
| 35 |
}
|
| 36 |
.topbar .brand { display: inline-flex; align-items: center; gap: .6rem; }
|
| 37 |
+
.brand-logo { height: 26px; width: auto; display: block; }
|
| 38 |
.topbar .lab { color: rgba(255,255,255,.6); font-size: .82rem; }
|
| 39 |
.topbar .brand:hover { opacity: .88; }
|
| 40 |
.topbar nav { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
|
|
|
|
| 110 |
</g>
|
| 111 |
<circle cx="481" cy="624" r="15" fill="#339B98"/>
|
| 112 |
<circle cx="538" cy="624" r="15" fill="#339B98"/>
|
| 113 |
+
</svg></a>
|
| 114 |
+
<span class="lab">Psychological Text Analysis with Contextualized Construct Representation</span>
|
| 115 |
<nav>
|
| 116 |
<a href="/">Dashboard</a>
|
| 117 |
<a href="/welcome">About</a>
|
backend/app/main.py
CHANGED
|
@@ -311,7 +311,10 @@ def auth_me(
|
|
| 311 |
def _live_invite(db: Session, invite_token: str | None) -> Invite | None:
|
| 312 |
"""The Invite row for a token that is well-signed, unexpired, and still
|
| 313 |
live (exists, not revoked). Tokens from before invites became stateful
|
| 314 |
-
have no row and are therefore dead.
|
|
|
|
|
|
|
|
|
|
| 315 |
verified = auth.verify_invite_token(invite_token)
|
| 316 |
if not verified:
|
| 317 |
return None
|
|
@@ -361,6 +364,12 @@ def register(body: RegisterIn, response: Response, db: Session = Depends(get_db)
|
|
| 361 |
# email anyway.
|
| 362 |
has_preassignment = db.query(RoleAssignment).filter_by(email=email).first() is not None
|
| 363 |
if body.invite_token and _live_invite(db, body.invite_token) is None and not has_preassignment:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
raise HTTPException(400, "This invite link is invalid, expired, or revoked. Ask for a new one.")
|
| 365 |
user = User(
|
| 366 |
email=email, name=body.name.strip(),
|
|
|
|
| 311 |
def _live_invite(db: Session, invite_token: str | None) -> Invite | None:
|
| 312 |
"""The Invite row for a token that is well-signed, unexpired, and still
|
| 313 |
live (exists, not revoked). Tokens from before invites became stateful
|
| 314 |
+
have no row and are therefore dead. While invites are on hold
|
| 315 |
+
(auth.invites_enabled), every token is dead."""
|
| 316 |
+
if not auth.invites_enabled():
|
| 317 |
+
return None
|
| 318 |
verified = auth.verify_invite_token(invite_token)
|
| 319 |
if not verified:
|
| 320 |
return None
|
|
|
|
| 364 |
# email anyway.
|
| 365 |
has_preassignment = db.query(RoleAssignment).filter_by(email=email).first() is not None
|
| 366 |
if body.invite_token and _live_invite(db, body.invite_token) is None and not has_preassignment:
|
| 367 |
+
if not auth.invites_enabled():
|
| 368 |
+
raise HTTPException(
|
| 369 |
+
400,
|
| 370 |
+
"Invite links are currently on hold. Ask an admin to grant your "
|
| 371 |
+
"email access instead - or register normally as an external user.",
|
| 372 |
+
)
|
| 373 |
raise HTTPException(400, "This invite link is invalid, expired, or revoked. Ask for a new one.")
|
| 374 |
user = User(
|
| 375 |
email=email, name=body.name.strip(),
|
backend/app/product.html
CHANGED
|
@@ -34,7 +34,7 @@
|
|
| 34 |
text-decoration: none; letter-spacing: .2px; white-space: nowrap;
|
| 35 |
}
|
| 36 |
.topbar .brand { display: inline-flex; align-items: center; gap: .6rem; }
|
| 37 |
-
.brand-logo { height:
|
| 38 |
.topbar .lab { color: rgba(255,255,255,.6); font-size: .82rem; }
|
| 39 |
.topbar .brand:hover { opacity: .88; }
|
| 40 |
.topbar nav { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
|
|
@@ -109,8 +109,8 @@
|
|
| 109 |
</g>
|
| 110 |
<circle cx="481" cy="624" r="15" fill="#339B98"/>
|
| 111 |
<circle cx="538" cy="624" r="15" fill="#339B98"/>
|
| 112 |
-
</svg>
|
| 113 |
-
<span class="lab">
|
| 114 |
<nav>
|
| 115 |
<a href="/">Dashboard</a>
|
| 116 |
<a href="/welcome">About</a>
|
|
@@ -128,9 +128,10 @@ page tells you how it <em>works</em>.</p>
|
|
| 128 |
|
| 129 |
<h2 id="access">1. Access model: four tiers + break-glass</h2>
|
| 130 |
<p>Every account has one of four roles. New sign-ups land as <b>external user</b>
|
| 131 |
-
unless
|
| 132 |
-
<a href="#prelogin">§2</a>
|
| 133 |
-
<code>/admin</code> page - no server
|
|
|
|
| 134 |
|
| 135 |
<figure>
|
| 136 |
<svg viewBox="0 0 760 330" xmlns="http://www.w3.org/2000/svg" role="img"
|
|
@@ -208,13 +209,14 @@ in increasing order of privilege:</p>
|
|
| 208 |
<ol>
|
| 209 |
<li><b>Anonymous use</b> - no account at all: 3 runs/day, small files, uploads
|
| 210 |
deleted right after analysis. The zero-commitment trial tier.</li>
|
| 211 |
-
<li><b>Invite links</b>
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
|
|
|
| 218 |
<li><b>Pre-assigned roles</b> - a role bound to a <em>specific email</em>
|
| 219 |
before the account exists. When that person first signs in - password or
|
| 220 |
Google - they land at the assigned tier, staff roles included. This is how
|
|
|
|
| 34 |
text-decoration: none; letter-spacing: .2px; white-space: nowrap;
|
| 35 |
}
|
| 36 |
.topbar .brand { display: inline-flex; align-items: center; gap: .6rem; }
|
| 37 |
+
.brand-logo { height: 26px; width: auto; display: block; }
|
| 38 |
.topbar .lab { color: rgba(255,255,255,.6); font-size: .82rem; }
|
| 39 |
.topbar .brand:hover { opacity: .88; }
|
| 40 |
.topbar nav { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
|
|
|
|
| 109 |
</g>
|
| 110 |
<circle cx="481" cy="624" r="15" fill="#339B98"/>
|
| 111 |
<circle cx="538" cy="624" r="15" fill="#339B98"/>
|
| 112 |
+
</svg></a>
|
| 113 |
+
<span class="lab">Psychological Text Analysis with Contextualized Construct Representation</span>
|
| 114 |
<nav>
|
| 115 |
<a href="/">Dashboard</a>
|
| 116 |
<a href="/welcome">About</a>
|
|
|
|
| 128 |
|
| 129 |
<h2 id="access">1. Access model: four tiers + break-glass</h2>
|
| 130 |
<p>Every account has one of four roles. New sign-ups land as <b>external user</b>
|
| 131 |
+
unless a pre-assigned role says otherwise (see
|
| 132 |
+
<a href="#prelogin">§2</a>; invite links are currently on hold). Roles are
|
| 133 |
+
managed entirely in the app, on the <code>/admin</code> page - no server
|
| 134 |
+
configuration involved.</p>
|
| 135 |
|
| 136 |
<figure>
|
| 137 |
<svg viewBox="0 0 760 330" xmlns="http://www.w3.org/2000/svg" role="img"
|
|
|
|
| 209 |
<ol>
|
| 210 |
<li><b>Anonymous use</b> - no account at all: 3 runs/day, small files, uploads
|
| 211 |
deleted right after analysis. The zero-commitment trial tier.</li>
|
| 212 |
+
<li><b>Invite links</b> <em>(currently on hold - creation and redemption are
|
| 213 |
+
disabled; use pre-assigned roles below)</em> - a signed URL an admin
|
| 214 |
+
copies from /admin into Slack or an email. Whoever registers through it
|
| 215 |
+
lands as a <b>lab member</b> (or external user). Bearer-style: anyone
|
| 216 |
+
with the link can use it, so it only carries non-staff roles and expires
|
| 217 |
+
after 7 days. Each link is tracked on /admin: revoke it any time (it
|
| 218 |
+
stops working immediately) and see exactly which accounts signed up
|
| 219 |
+
through it; creation, revocation, and every redemption are audited.</li>
|
| 220 |
<li><b>Pre-assigned roles</b> - a role bound to a <em>specific email</em>
|
| 221 |
before the account exists. When that person first signs in - password or
|
| 222 |
Google - they land at the assigned tier, staff roles included. This is how
|
backend/static/assets/{index-yUJ_ILdX.css → index-4rNvOlrh.css}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
:root{--brand-ink: #151515;--brand: #26736f;--brand-dark: #1d5a57;--accent: #339b98;--ink: #1d2129;--muted: #667085;--line: #e5e7eb;--bg: #f7f7f8;--card: #ffffff;--ok: #157f3d;--err: #b42318;--accent-soft: #e7f3f2;--control-height: 40px;--radius: 12px;--radius-sm: 9px;--shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);--shadow-md: 0 2px 6px rgba(16, 24, 40, .05), 0 12px 24px -16px rgba(16, 24, 40, .14);--shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, .26);--ring: 0 0 0 3px rgba(51, 155, 152, .18)}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,sans-serif;color:var(--ink);background:var(--bg);font-size:14.5px;line-height:1.5}@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 2dppx){body{-webkit-font-smoothing:antialiased}}*{scrollbar-width:thin;scrollbar-color:#c3c9d1 transparent}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-thumb{background:#c3c9d1;border-radius:999px}*::-webkit-scrollbar-track{background:transparent}.app{display:flex;flex-direction:column;min-height:100vh}a{color:var(--brand)}.header{background:linear-gradient(180deg,#1b1b1c,var(--brand-ink));color:#fff;padding:14px 28px;display:flex;align-items:center;flex-wrap:wrap;gap:14px;position:sticky;top:0;z-index:30;border-bottom:1px solid rgba(255,255,255,.07)}.header .brand{flex:0 0 auto;display:inline-flex;align-items:center;gap:10px;font-size:17px;font-weight:650;letter-spacing:.2px;white-space:nowrap;color:#fff;text-decoration:none}.brand-logo{height:24px;width:auto;display:block}.header .brand:hover{opacity:.88}.header .sub{flex:1 1 280px;min-width:0;font-size:12.5px;opacity:.85}.layout{display:flex;flex:1;min-width:0;min-height:0}.sidebar{width:250px;background:var(--card);border-right:1px solid var(--line);padding:18px 14px;flex-shrink:0;display:flex;flex-direction:column;min-height:0}.sidebar h2{font-size:11.5px;text-transform:uppercase;letter-spacing:.7px;color:var(--muted);margin:0 0 10px 4px;display:flex;align-items:center;gap:8px}.sidebar h2 .count{background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:0 8px;font-size:10.5px;letter-spacing:0;color:var(--muted)}.sidebar-filter{width:100%;padding:7px 10px;margin-bottom:10px;border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;font-size:13px;background:#fff;color:var(--ink)}.sidebar-filter:focus{outline:none;border-color:var(--brand)}.project-list{flex:1;min-height:0;overflow-y:auto;margin:0 -4px;padding:0 4px 4px}.group-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);margin:10px 4px 5px}div:first-child>.group-label{margin-top:2px}.project-item{display:block;width:100%;text-align:left;padding:9px 12px;margin-bottom:5px;border:1px solid transparent;border-radius:var(--radius-sm);background:none;cursor:pointer;font:inherit;color:var(--ink)}.project-item:hover{background:var(--bg)}.project-item.active{background:var(--accent-soft);border-color:var(--brand);font-weight:600}.project-item .project-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-item .date{display:block;font-size:11.5px;color:var(--muted);font-weight:400}.project-create{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.project-create>button{width:100%}.main{flex:1;padding:22px 28px;overflow-y:auto;min-width:0}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;margin-bottom:16px;box-shadow:var(--shadow-sm)}.card h3{margin:0 0 4px;font-size:15px}.card .hint{color:var(--muted);font-size:12.5px;margin:0 0 12px}.step-badge{display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;border-radius:50%;background:var(--brand);color:#fff;font-size:12px;font-weight:700;margin-right:8px;vertical-align:-3px}button{white-space:nowrap}button.primary{background:var(--brand);color:#fff;border:none;min-height:var(--control-height);display:inline-flex;align-items:center;justify-content:center;padding:0 18px;border-radius:var(--radius-sm);font:inherit;font-weight:600;cursor:pointer;line-height:1.2;transition:background-color .15s ease}button.primary:hover{background:var(--brand-dark)}button.primary:active{transform:translateY(1px)}button.primary:disabled{background:#c9ccd1;cursor:not-allowed;transform:none}a.google-btn{background:var(--brand);color:#fff;border:none;min-height:var(--control-height);display:flex;align-items:center;justify-content:center;padding:0 18px;border-radius:var(--radius-sm);font:inherit;font-weight:600;cursor:pointer;line-height:1.2;text-decoration:none;width:100%;box-sizing:border-box}a.google-btn:hover{background:var(--brand-dark)}button.ghost,a.ghost{background:none;border:1px solid var(--line);color:var(--ink);min-height:var(--control-height);display:inline-flex;align-items:center;justify-content:center;padding:0 14px;border-radius:var(--radius-sm);font:inherit;cursor:pointer;line-height:1.2;text-decoration:none;transition:border-color .15s ease,color .15s ease}button.ghost:hover,a.ghost:hover{border-color:var(--brand);color:var(--brand);background:var(--accent-soft)}button.ghost:active,a.ghost:active{transform:translateY(1px)}button.linkish{background:none;border:none;color:var(--brand);font:inherit;cursor:pointer;padding:0;text-decoration:underline}input[type=text],input[type=email],input[type=password],textarea,select{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;background:#fff;color:var(--ink)}input[type=text],input[type=email],input[type=password],select{height:var(--control-height)}input[type=text]:focus,input[type=email]:focus,input[type=password]:focus,textarea:focus,select:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid rgba(51,155,152,.5);outline-offset:2px}input[type=file]{display:block;max-width:100%;margin-top:6px;font-size:13px;color:var(--muted)}input[type=file]::file-selector-button{background:#fff;border:1px solid var(--line);color:var(--ink);padding:7px 14px;border-radius:var(--radius-sm);font:inherit;font-size:13px;cursor:pointer;margin-right:10px}input[type=file]::file-selector-button:hover{border-color:var(--brand);color:var(--brand)}.row>button{align-self:flex-end;margin-bottom:1px}textarea{resize:vertical}label.field{display:block;margin-bottom:10px;font-size:13px;font-weight:600}label.field>*{margin-top:4px;font-weight:400}.field-hint{margin-top:0;font-weight:400;color:var(--muted);font-size:12px}.row{display:flex;gap:14px;flex-wrap:wrap}.row>*{min-width:0}.row>.grow{flex:1;min-width:min(220px,100%)}.language-control{min-width:170px}.model-control{min-width:260px}.run-settings{display:grid;grid-template-columns:minmax(160px,230px) minmax(320px,720px) max-content;justify-content:start;gap:14px;align-items:end}.run-settings .field{margin-bottom:0}.run-button{min-width:180px;height:var(--control-height)}.construct-row{display:grid;grid-template-columns:minmax(320px,1120px) max-content;justify-content:start;align-items:end;gap:14px}.results-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px;flex-wrap:wrap}.result-actions{justify-content:flex-end}.result-actions a{display:inline-flex;text-decoration:none}.pill{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;font-size:11.5px;font-weight:600}.pill:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.75}.pill.running:before{animation:pill-pulse 1.2s ease-in-out infinite}@keyframes pill-pulse{50%{opacity:.2}}.pill.completed{background:#e6f4ea;color:var(--ok)}.pill.running{background:#fff3e0;color:#b45309}.pill.queued{background:#eef2f7;color:var(--muted)}.pill.failed{background:#fdecea;color:var(--err)}.progress-track{background:var(--line);border-radius:999px;height:7px;overflow:hidden}.progress-fill{background:linear-gradient(90deg,var(--brand),var(--accent));height:100%;transition:width .4s ease;border-radius:999px}.warnings{background:#fff8e6;border:1px solid #f2dfa8;color:#7a5b00;border-radius:var(--radius-sm);padding:10px 14px}.error-banner{background:#fdecea;color:var(--err);border:1px solid #f5c6c0;padding:10px 14px;border-radius:var(--radius-sm);margin-bottom:14px;font-size:13px}.table-wrap{width:100%;overflow-x:auto}table.docs{width:100%;border-collapse:collapse;font-size:13px}table.docs th{text-align:left;color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.5px;padding:6px 8px;border-bottom:1px solid var(--line)}table.docs td{padding:8px;border-bottom:1px solid #f0f1f3;vertical-align:top;overflow-wrap:anywhere}table.docs tbody tr:last-child td{border-bottom:none}table.docs td.score{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}table.docs tbody tr:hover td{background:var(--bg)}.stat-grid{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:4px}.stat{flex:1;min-width:110px;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:10px 14px}.stat .v{font-size:21px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.02em}.stat .k{font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}.item-bar-row{display:flex;align-items:center;gap:10px;margin-bottom:7px}.item-bar-label{flex:1;font-size:12.5px;min-width:0;overflow-wrap:anywhere}.item-bar-track{flex:1.2;background:var(--bg);border-radius:999px;height:10px}.item-bar-fill{background:var(--accent);opacity:.85;height:100%;border-radius:999px}.item-bar-val{width:52px;text-align:right;font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:600}.construct-items{margin:8px 0 0;padding-left:20px;color:var(--muted);font-size:12.5px}.construct-items li{margin-bottom:2px}.meta-footer{font-size:12px;color:var(--muted);background:var(--bg);border-radius:var(--radius-sm);padding:10px 14px;margin-top:14px;font-variant-numeric:tabular-nums}.meta-footer code{font-size:11.5px}.muted{color:var(--muted)}.small{font-size:12.5px}.mt{margin-top:12px}.header-nav{margin-left:auto;display:flex;align-items:center;gap:14px;color:#fff;flex-wrap:wrap}.header-link{background:none;border:none;padding:0;color:#ffffffd1;font:inherit;font-size:13px;cursor:pointer;text-decoration:none;transition:color .15s ease}.header-link:hover{color:#fff;text-decoration:underline}.header-link.current{color:#fff;font-weight:600}.header-btn{background:#ffffff1f;color:#fff;border:1px solid rgba(255,255,255,.45);padding:5px 14px;border-radius:7px;font:inherit;font-size:13px;cursor:pointer;text-decoration:none;transition:background-color .15s ease}.header-btn:hover{background:#ffffff38}.project-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}.project-title{font-size:17px;font-weight:650;margin-right:10px}button.danger{color:var(--err);border-color:#f0c4be}button.danger:hover{color:var(--err);border-color:var(--err)}button.danger-solid{background:var(--err)}button.danger-solid:hover{background:#93261b}button.danger-solid:disabled{background:#c9ccd1}.picker{position:relative}.picker-display{width:100%;display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;font:inherit;color:var(--ink);cursor:pointer;text-align:left}.picker-display:hover{border-color:var(--brand)}.picker-display .picker-caret{margin-left:auto;color:var(--muted);font-size:11px}.picker-search{width:100%;padding:8px 12px;border:1px solid var(--brand);border-radius:var(--radius-sm);font:inherit;background:#fff}.picker-search:focus{outline:none;box-shadow:0 0 0 3px #339b9826}.picker-panel{position:absolute;top:calc(100% + 6px);left:0;z-index:50;width:100%;max-width:640px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);max-height:340px;overflow-y:auto;padding:4px 0 6px;animation:float-in .14s ease-out}@keyframes float-in{0%{opacity:0;transform:translateY(-4px)}}.picker-group{font-size:10.5px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);padding:8px 12px 3px;position:sticky;top:0;background:var(--card)}.picker-option{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 12px;cursor:pointer;font-size:13.5px}.picker-option:hover,.picker-option.active{background:var(--accent-soft)}.picker-option.selected .picker-name{font-weight:650;color:var(--brand)}.picker-name{min-width:0}.picker-meta{flex-shrink:0;font-size:11.5px;color:var(--muted);white-space:nowrap}.picker-empty{padding:12px;margin:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#14161a66;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;z-index:40;padding:16px}.modal{background:var(--card);border-radius:14px;padding:26px 28px 24px;width:100%;max-width:460px;box-shadow:var(--shadow-lg);animation:modal-in .16s ease-out}@keyframes modal-in{0%{opacity:0;transform:translateY(6px) scale(.985)}}.modal h3{margin:0 0 8px;font-size:18px}.modal .hint{color:var(--muted);font-size:13px;line-height:1.5;margin:0 0 4px}.modal form.mt{margin-top:18px}.modal label.field{margin-bottom:16px}.modal label.field:last-of-type{margin-bottom:20px}.modal .row{gap:10px}.modal .row>.primary{flex:1}.modal p.small.muted.mt{margin-top:18px;padding-top:16px;border-top:1px solid var(--line);font-size:12.5px;line-height:1.6}@media (max-width: 820px){body{font-size:14px}.header{padding:12px 16px;align-items:flex-start;gap:2px 12px}.header .brand{font-size:16px}.header-nav{gap:10px 14px}.header .sub{flex:1 1 210px;font-size:12px;line-height:1.35}.layout{display:block}.sidebar{width:100%;border-right:0;border-bottom:1px solid var(--line);padding:14px}.project-list{max-height:220px;margin-right:0;flex:none}.project-create{border-top:0}.main{width:100%;padding:16px 14px 28px;overflow:visible}.card{padding:16px;margin-bottom:14px}.row,.run-settings,.construct-row,.results-toolbar,.result-actions{gap:10px}.row,.results-toolbar,.result-actions{flex-direction:column;align-items:stretch}.run-settings,.construct-row{grid-template-columns:1fr}.row>.grow,.construct-row>.grow,.language-control,.model-control{width:100%;min-width:0}.main .row>button,.main .row>a,.main .row>a>button,.results-toolbar>button{align-self:stretch;margin-bottom:0;width:100%}.run-button{width:100%;min-width:0}.stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.stat{min-width:0}.item-bar-row{display:grid;grid-template-columns:minmax(0,1fr) 56px;gap:6px 10px}.item-bar-track{grid-column:1 / -1;width:100%}.item-bar-val{width:auto}table.docs{min-width:520px}}@media (max-width: 460px){.header .sub{flex-basis:100%}.stat-grid{grid-template-columns:1fr}}.empty-state{text-align:center;max-width:560px;margin:48px auto 0;padding:36px 28px 28px}.empty-state h3{font-size:17px}.empty-state .hint{font-size:13px}.empty-actions{display:flex;gap:16px;align-items:center;justify-content:center;flex-wrap:wrap;margin:18px 0 16px}.ghost-link{color:var(--brand);font-weight:600;text-decoration:none}.ghost-link:hover{text-decoration:underline}.welcome{padding-top:1.2rem}.welcome-hero{padding:26px 28px;background:linear-gradient(135deg,#ffffff 55%,var(--accent-soft))}.welcome-hero h2{margin:0 0 .6rem;font-size:1.5rem}.welcome-hero p{max-width:62ch}.welcome-cta{display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin:1.1rem 0 .6rem}.welcome-cta .ghost-link{font-size:.95rem}.welcome-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.welcome-step h3{margin:.2rem 0 .3rem}.step-n{width:1.9rem;height:1.9rem;border-radius:50%;background:var(--brand);color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center}@media (max-width: 700px){.welcome-steps{grid-template-columns:1fr}}.construct-selected{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius-sm);padding:8px 12px;background:#fff}.construct-selected summary,.construct-results summary{cursor:pointer;display:flex;align-items:baseline;gap:8px;list-style:none}.construct-selected summary::-webkit-details-marker,.construct-results summary::-webkit-details-marker{display:none}.construct-selected summary:before,.construct-results summary:before{content:"▸";color:var(--muted);font-size:11px;transition:transform .15s ease;align-self:center}details[open]>summary:before{transform:rotate(90deg)}.construct-selected-name{font-weight:600;font-size:13.5px}.construct-remove{margin-left:auto;flex-shrink:0}.construct-results summary .picker-meta{margin-left:6px}.construct-results h4{margin:14px 0 4px;font-size:13.5px}@media (prefers-reduced-motion: reduce){.picker-panel,.modal{animation:none}.pill.running:before{animation:none}.construct-selected summary:before,.construct-results summary:before{transition:none}button.primary:active,button.ghost:active,a.ghost:active{transform:none}}
|
|
|
|
| 1 |
+
:root{--brand-ink: #151515;--brand: #26736f;--brand-dark: #1d5a57;--accent: #339b98;--ink: #1d2129;--muted: #667085;--line: #e5e7eb;--bg: #f7f7f8;--card: #ffffff;--ok: #157f3d;--err: #b42318;--accent-soft: #e7f3f2;--control-height: 40px;--radius: 12px;--radius-sm: 9px;--shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);--shadow-md: 0 2px 6px rgba(16, 24, 40, .05), 0 12px 24px -16px rgba(16, 24, 40, .14);--shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, .26);--ring: 0 0 0 3px rgba(51, 155, 152, .18)}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,sans-serif;color:var(--ink);background:var(--bg);font-size:14.5px;line-height:1.5}@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 2dppx){body{-webkit-font-smoothing:antialiased}}*{scrollbar-width:thin;scrollbar-color:#c3c9d1 transparent}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-thumb{background:#c3c9d1;border-radius:999px}*::-webkit-scrollbar-track{background:transparent}.app{display:flex;flex-direction:column;min-height:100vh}a{color:var(--brand)}.header{background:linear-gradient(180deg,#1b1b1c,var(--brand-ink));color:#fff;padding:14px 28px;display:flex;align-items:center;flex-wrap:wrap;gap:14px;position:sticky;top:0;z-index:30;border-bottom:1px solid rgba(255,255,255,.07)}.header .brand{flex:0 0 auto;display:inline-flex;align-items:center;gap:10px;font-size:17px;font-weight:650;letter-spacing:.2px;white-space:nowrap;color:#fff;text-decoration:none}.brand-logo{height:28px;width:auto;display:block}.header .brand:hover{opacity:.88}.header .sub{flex:1 1 280px;min-width:0;font-size:12.5px;opacity:.85}.layout{display:flex;flex:1;min-width:0;min-height:0}.sidebar{width:250px;background:var(--card);border-right:1px solid var(--line);padding:18px 14px;flex-shrink:0;display:flex;flex-direction:column;min-height:0}.sidebar h2{font-size:11.5px;text-transform:uppercase;letter-spacing:.7px;color:var(--muted);margin:0 0 10px 4px;display:flex;align-items:center;gap:8px}.sidebar h2 .count{background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:0 8px;font-size:10.5px;letter-spacing:0;color:var(--muted)}.sidebar-filter{width:100%;padding:7px 10px;margin-bottom:10px;border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;font-size:13px;background:#fff;color:var(--ink)}.sidebar-filter:focus{outline:none;border-color:var(--brand)}.project-list{flex:1;min-height:0;overflow-y:auto;margin:0 -4px;padding:0 4px 4px}.group-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);margin:10px 4px 5px}div:first-child>.group-label{margin-top:2px}.project-item{display:block;width:100%;text-align:left;padding:9px 12px;margin-bottom:5px;border:1px solid transparent;border-radius:var(--radius-sm);background:none;cursor:pointer;font:inherit;color:var(--ink)}.project-item:hover{background:var(--bg)}.project-item.active{background:var(--accent-soft);border-color:var(--brand);font-weight:600}.project-item .project-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-item .date{display:block;font-size:11.5px;color:var(--muted);font-weight:400}.project-create{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.project-create>button{width:100%}.main{flex:1;padding:22px 28px;overflow-y:auto;min-width:0}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;margin-bottom:16px;box-shadow:var(--shadow-sm)}.card h3{margin:0 0 4px;font-size:15px}.card .hint{color:var(--muted);font-size:12.5px;margin:0 0 12px}.step-badge{display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;border-radius:50%;background:var(--brand);color:#fff;font-size:12px;font-weight:700;margin-right:8px;vertical-align:-3px}button{white-space:nowrap}button.primary{background:var(--brand);color:#fff;border:none;min-height:var(--control-height);display:inline-flex;align-items:center;justify-content:center;padding:0 18px;border-radius:var(--radius-sm);font:inherit;font-weight:600;cursor:pointer;line-height:1.2;transition:background-color .15s ease}button.primary:hover{background:var(--brand-dark)}button.primary:active{transform:translateY(1px)}button.primary:disabled{background:#c9ccd1;cursor:not-allowed;transform:none}a.google-btn{background:var(--brand);color:#fff;border:none;min-height:var(--control-height);display:flex;align-items:center;justify-content:center;padding:0 18px;border-radius:var(--radius-sm);font:inherit;font-weight:600;cursor:pointer;line-height:1.2;text-decoration:none;width:100%;box-sizing:border-box}a.google-btn:hover{background:var(--brand-dark)}button.ghost,a.ghost{background:none;border:1px solid var(--line);color:var(--ink);min-height:var(--control-height);display:inline-flex;align-items:center;justify-content:center;padding:0 14px;border-radius:var(--radius-sm);font:inherit;cursor:pointer;line-height:1.2;text-decoration:none;transition:border-color .15s ease,color .15s ease}button.ghost:hover,a.ghost:hover{border-color:var(--brand);color:var(--brand);background:var(--accent-soft)}button.ghost:active,a.ghost:active{transform:translateY(1px)}button.linkish{background:none;border:none;color:var(--brand);font:inherit;cursor:pointer;padding:0;text-decoration:underline}input[type=text],input[type=email],input[type=password],textarea,select{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;background:#fff;color:var(--ink)}input[type=text],input[type=email],input[type=password],select{height:var(--control-height)}input[type=text]:focus,input[type=email]:focus,input[type=password]:focus,textarea:focus,select:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid rgba(51,155,152,.5);outline-offset:2px}input[type=file]{display:block;max-width:100%;margin-top:6px;font-size:13px;color:var(--muted)}input[type=file]::file-selector-button{background:#fff;border:1px solid var(--line);color:var(--ink);padding:7px 14px;border-radius:var(--radius-sm);font:inherit;font-size:13px;cursor:pointer;margin-right:10px}input[type=file]::file-selector-button:hover{border-color:var(--brand);color:var(--brand)}.row>button{align-self:flex-end;margin-bottom:1px}textarea{resize:vertical}label.field{display:block;margin-bottom:10px;font-size:13px;font-weight:600}label.field>*{margin-top:4px;font-weight:400}.field-hint{margin-top:0;font-weight:400;color:var(--muted);font-size:12px}.row{display:flex;gap:14px;flex-wrap:wrap}.row>*{min-width:0}.row>.grow{flex:1;min-width:min(220px,100%)}.language-control{min-width:170px}.model-control{min-width:260px}.run-settings{display:grid;grid-template-columns:minmax(160px,230px) minmax(320px,720px) max-content;justify-content:start;gap:14px;align-items:end}.run-settings .field{margin-bottom:0}.run-button{min-width:180px;height:var(--control-height)}.construct-row{display:grid;grid-template-columns:minmax(320px,1120px) max-content;justify-content:start;align-items:end;gap:14px}.results-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px;flex-wrap:wrap}.result-actions{justify-content:flex-end}.result-actions a{display:inline-flex;text-decoration:none}.pill{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;font-size:11.5px;font-weight:600}.pill:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.75}.pill.running:before{animation:pill-pulse 1.2s ease-in-out infinite}@keyframes pill-pulse{50%{opacity:.2}}.pill.completed{background:#e6f4ea;color:var(--ok)}.pill.running{background:#fff3e0;color:#b45309}.pill.queued{background:#eef2f7;color:var(--muted)}.pill.failed{background:#fdecea;color:var(--err)}.progress-track{background:var(--line);border-radius:999px;height:7px;overflow:hidden}.progress-fill{background:linear-gradient(90deg,var(--brand),var(--accent));height:100%;transition:width .4s ease;border-radius:999px}.warnings{background:#fff8e6;border:1px solid #f2dfa8;color:#7a5b00;border-radius:var(--radius-sm);padding:10px 14px}.error-banner{background:#fdecea;color:var(--err);border:1px solid #f5c6c0;padding:10px 14px;border-radius:var(--radius-sm);margin-bottom:14px;font-size:13px}.table-wrap{width:100%;overflow-x:auto}table.docs{width:100%;border-collapse:collapse;font-size:13px}table.docs th{text-align:left;color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.5px;padding:6px 8px;border-bottom:1px solid var(--line)}table.docs td{padding:8px;border-bottom:1px solid #f0f1f3;vertical-align:top;overflow-wrap:anywhere}table.docs tbody tr:last-child td{border-bottom:none}table.docs td.score{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}table.docs tbody tr:hover td{background:var(--bg)}.stat-grid{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:4px}.stat{flex:1;min-width:110px;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:10px 14px}.stat .v{font-size:21px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.02em}.stat .k{font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}.item-bar-row{display:flex;align-items:center;gap:10px;margin-bottom:7px}.item-bar-label{flex:1;font-size:12.5px;min-width:0;overflow-wrap:anywhere}.item-bar-track{flex:1.2;background:var(--bg);border-radius:999px;height:10px}.item-bar-fill{background:var(--accent);opacity:.85;height:100%;border-radius:999px}.item-bar-val{width:52px;text-align:right;font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:600}.construct-items{margin:8px 0 0;padding-left:20px;color:var(--muted);font-size:12.5px}.construct-items li{margin-bottom:2px}.meta-footer{font-size:12px;color:var(--muted);background:var(--bg);border-radius:var(--radius-sm);padding:10px 14px;margin-top:14px;font-variant-numeric:tabular-nums}.meta-footer code{font-size:11.5px}.muted{color:var(--muted)}.small{font-size:12.5px}.mt{margin-top:12px}.header-nav{margin-left:auto;display:flex;align-items:center;gap:14px;color:#fff;flex-wrap:wrap}.header-link{background:none;border:none;padding:0;color:#ffffffd1;font:inherit;font-size:13px;cursor:pointer;text-decoration:none;transition:color .15s ease}.header-link:hover{color:#fff;text-decoration:underline}.header-link.current{color:#fff;font-weight:600}.header-btn{background:#ffffff1f;color:#fff;border:1px solid rgba(255,255,255,.45);padding:5px 14px;border-radius:7px;font:inherit;font-size:13px;cursor:pointer;text-decoration:none;transition:background-color .15s ease}.header-btn:hover{background:#ffffff38}.project-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}.project-title{font-size:17px;font-weight:650;margin-right:10px}button.danger{color:var(--err);border-color:#f0c4be}button.danger:hover{color:var(--err);border-color:var(--err)}button.danger-solid{background:var(--err)}button.danger-solid:hover{background:#93261b}button.danger-solid:disabled{background:#c9ccd1}.picker{position:relative}.picker-display{width:100%;display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;font:inherit;color:var(--ink);cursor:pointer;text-align:left}.picker-display:hover{border-color:var(--brand)}.picker-display .picker-caret{margin-left:auto;color:var(--muted);font-size:11px}.picker-search{width:100%;padding:8px 12px;border:1px solid var(--brand);border-radius:var(--radius-sm);font:inherit;background:#fff}.picker-search:focus{outline:none;box-shadow:0 0 0 3px #339b9826}.picker-panel{position:absolute;top:calc(100% + 6px);left:0;z-index:50;width:100%;max-width:640px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);max-height:340px;overflow-y:auto;padding:4px 0 6px;animation:float-in .14s ease-out}@keyframes float-in{0%{opacity:0;transform:translateY(-4px)}}.picker-group{font-size:10.5px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);padding:8px 12px 3px;position:sticky;top:0;background:var(--card)}.picker-option{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 12px;cursor:pointer;font-size:13.5px}.picker-option:hover,.picker-option.active{background:var(--accent-soft)}.picker-option.selected .picker-name{font-weight:650;color:var(--brand)}.picker-name{min-width:0}.picker-meta{flex-shrink:0;font-size:11.5px;color:var(--muted);white-space:nowrap}.picker-empty{padding:12px;margin:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#14161a66;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;z-index:40;padding:16px}.modal{background:var(--card);border-radius:14px;padding:26px 28px 24px;width:100%;max-width:460px;box-shadow:var(--shadow-lg);animation:modal-in .16s ease-out}@keyframes modal-in{0%{opacity:0;transform:translateY(6px) scale(.985)}}.modal h3{margin:0 0 8px;font-size:18px}.modal .hint{color:var(--muted);font-size:13px;line-height:1.5;margin:0 0 4px}.modal form.mt{margin-top:18px}.modal label.field{margin-bottom:16px}.modal label.field:last-of-type{margin-bottom:20px}.modal .row{gap:10px}.modal .row>.primary{flex:1}.modal p.small.muted.mt{margin-top:18px;padding-top:16px;border-top:1px solid var(--line);font-size:12.5px;line-height:1.6}@media (max-width: 820px){body{font-size:14px}.header{padding:12px 16px;align-items:flex-start;gap:2px 12px}.header .brand{font-size:16px}.header-nav{gap:10px 14px}.header .sub{flex:1 1 210px;font-size:12px;line-height:1.35}.layout{display:block}.sidebar{width:100%;border-right:0;border-bottom:1px solid var(--line);padding:14px}.project-list{max-height:220px;margin-right:0;flex:none}.project-create{border-top:0}.main{width:100%;padding:16px 14px 28px;overflow:visible}.card{padding:16px;margin-bottom:14px}.row,.run-settings,.construct-row,.results-toolbar,.result-actions{gap:10px}.row,.results-toolbar,.result-actions{flex-direction:column;align-items:stretch}.run-settings,.construct-row{grid-template-columns:1fr}.row>.grow,.construct-row>.grow,.language-control,.model-control{width:100%;min-width:0}.main .row>button,.main .row>a,.main .row>a>button,.results-toolbar>button{align-self:stretch;margin-bottom:0;width:100%}.run-button{width:100%;min-width:0}.stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.stat{min-width:0}.item-bar-row{display:grid;grid-template-columns:minmax(0,1fr) 56px;gap:6px 10px}.item-bar-track{grid-column:1 / -1;width:100%}.item-bar-val{width:auto}table.docs{min-width:520px}}@media (max-width: 460px){.header .sub{flex-basis:100%}.stat-grid{grid-template-columns:1fr}}.empty-state{text-align:center;max-width:560px;margin:48px auto 0;padding:36px 28px 28px}.empty-state h3{font-size:17px}.empty-state .hint{font-size:13px}.empty-actions{display:flex;gap:16px;align-items:center;justify-content:center;flex-wrap:wrap;margin:18px 0 16px}.ghost-link{color:var(--brand);font-weight:600;text-decoration:none}.ghost-link:hover{text-decoration:underline}.welcome{padding-top:1.2rem}.welcome-hero{padding:26px 28px;background:linear-gradient(135deg,#ffffff 55%,var(--accent-soft))}.welcome-hero h2{margin:0 0 .6rem;font-size:1.5rem}.welcome-hero p{max-width:62ch}.welcome-cta{display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin:1.1rem 0 .6rem}.welcome-cta .ghost-link{font-size:.95rem}.welcome-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.welcome-step h3{margin:.2rem 0 .3rem}.step-n{width:1.9rem;height:1.9rem;border-radius:50%;background:var(--brand);color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center}@media (max-width: 700px){.welcome-steps{grid-template-columns:1fr}}.construct-selected{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius-sm);padding:8px 12px;background:#fff}.construct-selected summary,.construct-results summary{cursor:pointer;display:flex;align-items:baseline;gap:8px;list-style:none}.construct-selected summary::-webkit-details-marker,.construct-results summary::-webkit-details-marker{display:none}.construct-selected summary:before,.construct-results summary:before{content:"▸";color:var(--muted);font-size:11px;transition:transform .15s ease;align-self:center}details[open]>summary:before{transform:rotate(90deg)}.construct-selected-name{font-weight:600;font-size:13.5px}.construct-remove{margin-left:auto;flex-shrink:0}.construct-results summary .picker-meta{margin-left:6px}.construct-results h4{margin:14px 0 4px;font-size:13.5px}@media (prefers-reduced-motion: reduce){.picker-panel,.modal{animation:none}.pill.running:before{animation:none}.construct-selected summary:before,.construct-results summary:before{transition:none}button.primary:active,button.ghost:active,a.ghost:active{transform:none}}
|
backend/static/assets/{index-BHSVf-_4.js → index-DXNnKweH.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/static/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<link rel="icon" type="image/svg+xml" href="/ccr-logo.svg" />
|
| 7 |
<title>CCR Platform - Contextualized Construct Representations</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
| 10 |
</head>
|
| 11 |
<body>
|
| 12 |
<div id="root"></div>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<link rel="icon" type="image/svg+xml" href="/ccr-logo.svg" />
|
| 7 |
<title>CCR Platform - Contextualized Construct Representations</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-DXNnKweH.js"></script>
|
| 9 |
+
<link rel="stylesheet" crossorigin href="/assets/index-4rNvOlrh.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
| 12 |
<div id="root"></div>
|
backend/tests/test_admin.py
CHANGED
|
@@ -15,6 +15,10 @@ ADMIN_EMAIL = "admin@lab.test"
|
|
| 15 |
@pytest.fixture()
|
| 16 |
def client(monkeypatch):
|
| 17 |
monkeypatch.setenv("ADMIN_EMAILS", f"{ADMIN_EMAIL}, other-admin@lab.test")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
with TestClient(app) as c:
|
| 19 |
yield c
|
| 20 |
|
|
@@ -434,6 +438,38 @@ def test_revoked_invite_stops_working(client):
|
|
| 434 |
assert resp.status_code == 400 and "revoked" in resp.json()["detail"]
|
| 435 |
|
| 436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 437 |
def test_audit_trail_records_and_is_pi_only(client):
|
| 438 |
_as_admin(client)
|
| 439 |
audit = client.get("/api/admin/audit")
|
|
|
|
| 15 |
@pytest.fixture()
|
| 16 |
def client(monkeypatch):
|
| 17 |
monkeypatch.setenv("ADMIN_EMAILS", f"{ADMIN_EMAIL}, other-admin@lab.test")
|
| 18 |
+
# Invite links are on hold by default (2026-07-31); these tests cover the
|
| 19 |
+
# dormant machinery, so switch it on. The on-hold behavior itself is
|
| 20 |
+
# covered by test_invites_on_hold_by_default.
|
| 21 |
+
monkeypatch.setenv("CCR_INVITES_ENABLED", "1")
|
| 22 |
with TestClient(app) as c:
|
| 23 |
yield c
|
| 24 |
|
|
|
|
| 438 |
assert resp.status_code == 400 and "revoked" in resp.json()["detail"]
|
| 439 |
|
| 440 |
|
| 441 |
+
def test_invites_on_hold_by_default(client, monkeypatch):
|
| 442 |
+
"""Invite links are dormant unless CCR_INVITES_ENABLED=1 (2026-07-31):
|
| 443 |
+
creation is refused, previously minted tokens stop redeeming, and the
|
| 444 |
+
overview flag tells the admin UI to hide the section. Pre-assigned
|
| 445 |
+
roles keep working - they are the supported onboarding path."""
|
| 446 |
+
_as_admin(client)
|
| 447 |
+
live = client.post("/api/admin/invites", json={"role": "lab"}).json() # minted while enabled
|
| 448 |
+
|
| 449 |
+
monkeypatch.setenv("CCR_INVITES_ENABLED", "0")
|
| 450 |
+
assert client.get("/api/admin/overview").json()["invites_enabled"] is False
|
| 451 |
+
resp = client.post("/api/admin/invites", json={"role": "lab"})
|
| 452 |
+
assert resp.status_code == 409 and "on hold" in resp.json()["detail"]
|
| 453 |
+
client.post("/api/auth/logout")
|
| 454 |
+
|
| 455 |
+
resp = client.post("/api/auth/register", json={
|
| 456 |
+
"email": "held@lab.test", "password": "password123",
|
| 457 |
+
"name": "Held", "invite_token": live["token"],
|
| 458 |
+
})
|
| 459 |
+
assert resp.status_code == 400 and "on hold" in resp.json()["detail"]
|
| 460 |
+
|
| 461 |
+
# pre-assignment still lands the role even while links are frozen
|
| 462 |
+
_as_admin(client)
|
| 463 |
+
client.post("/api/admin/role-assignments", json={"email": "held@lab.test", "role": "lab"})
|
| 464 |
+
client.post("/api/auth/logout")
|
| 465 |
+
resp = client.post("/api/auth/register", json={
|
| 466 |
+
"email": "held@lab.test", "password": "password123", "name": "Held",
|
| 467 |
+
})
|
| 468 |
+
assert resp.status_code == 201
|
| 469 |
+
assert client.get("/api/auth/me").json()["role"] == "lab"
|
| 470 |
+
client.post("/api/auth/logout")
|
| 471 |
+
|
| 472 |
+
|
| 473 |
def test_audit_trail_records_and_is_pi_only(client):
|
| 474 |
_as_admin(client)
|
| 475 |
audit = client.get("/api/admin/audit")
|
frontend/src/AdminPage.jsx
CHANGED
|
@@ -306,6 +306,10 @@ export default function AdminPage({ auth }) {
|
|
| 306 |
</table>
|
| 307 |
</div>
|
| 308 |
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
<p className="hint" style={{ marginTop: "1rem" }}>
|
| 310 |
<b>Or create an invite link</b> (anyone with the link; lab member /
|
| 311 |
external only - staff is granted per person above): paste it in Slack,
|
|
@@ -378,6 +382,7 @@ export default function AdminPage({ auth }) {
|
|
| 378 |
</table>
|
| 379 |
</div>
|
| 380 |
)}
|
|
|
|
| 381 |
</Section>
|
| 382 |
|
| 383 |
{/* Audit trail - PI/env-admin only (404s/403s hide it for maintainers) */}
|
|
|
|
| 306 |
</table>
|
| 307 |
</div>
|
| 308 |
)}
|
| 309 |
+
{/* Invite links are ON HOLD (2026-07-31): the server refuses creation
|
| 310 |
+
and redemption while overview.invites_enabled is false, and this
|
| 311 |
+
whole block stays hidden. Pre-assignments above are the way in. */}
|
| 312 |
+
{overview?.invites_enabled && (<>
|
| 313 |
<p className="hint" style={{ marginTop: "1rem" }}>
|
| 314 |
<b>Or create an invite link</b> (anyone with the link; lab member /
|
| 315 |
external only - staff is granted per person above): paste it in Slack,
|
|
|
|
| 382 |
</table>
|
| 383 |
</div>
|
| 384 |
)}
|
| 385 |
+
</>)}
|
| 386 |
</Section>
|
| 387 |
|
| 388 |
{/* Audit trail - PI/env-admin only (404s/403s hide it for maintainers) */}
|
frontend/src/App.jsx
CHANGED
|
@@ -195,11 +195,12 @@ export default function App() {
|
|
| 195 |
}
|
| 196 |
}}
|
| 197 |
>
|
| 198 |
-
|
| 199 |
-
|
|
|
|
| 200 |
</a>
|
| 201 |
<span className="sub">
|
| 202 |
-
|
| 203 |
</span>
|
| 204 |
<nav className="header-nav">
|
| 205 |
{IS_ADMIN_PATH ? (
|
|
|
|
| 195 |
}
|
| 196 |
}}
|
| 197 |
>
|
| 198 |
+
{/* The logo already reads "CCR" - no wordmark next to it, and the
|
| 199 |
+
tagline says what the tool does instead of re-expanding the acronym. */}
|
| 200 |
+
<img className="brand-logo" src="/ccr-logo-white.svg" alt="CCR Platform" />
|
| 201 |
</a>
|
| 202 |
<span className="sub">
|
| 203 |
+
Psychological Text Analysis with Contextualized Construct Representation
|
| 204 |
</span>
|
| 205 |
<nav className="header-nav">
|
| 206 |
{IS_ADMIN_PATH ? (
|
frontend/src/styles.css
CHANGED
|
@@ -78,7 +78,7 @@ a { color: var(--brand); }
|
|
| 78 |
color: #fff;
|
| 79 |
text-decoration: none;
|
| 80 |
}
|
| 81 |
-
.brand-logo { height:
|
| 82 |
.header .brand:hover { opacity: 0.88; }
|
| 83 |
.header .sub { flex: 1 1 280px; min-width: 0; font-size: 12.5px; opacity: 0.85; }
|
| 84 |
|
|
|
|
| 78 |
color: #fff;
|
| 79 |
text-decoration: none;
|
| 80 |
}
|
| 81 |
+
.brand-logo { height: 28px; width: auto; display: block; } /* sole brand mark - no wordmark */
|
| 82 |
.header .brand:hover { opacity: 0.88; }
|
| 83 |
.header .sub { flex: 1 1 280px; min-width: 0; font-size: 12.5px; opacity: 0.85; }
|
| 84 |
|