Files
beardrive/internal/webapp/static/style.css
T
Snow LeeandClaude Fable 5 94ef66a4a9 feat(hub): organizations — projects walled by team membership, with invites
Every hub project now belongs to exactly one org (file-backed orgs.json,
same load-at-open + atomic-rewrite discipline as the other registries).
Membership (email -> owner|member) gates every per-project route: the
viewer APIs, uploads, history, blobs, shares management, and the device
sync store proxy; /api/projects lists only your orgs' projects, and
project names are now scoped per org. Public share links (/s/) stay
public by design.

Design choices, per the simplest-consistent rule:
- Migration: a pre-org hub sweeps all org-less projects into a "default"
  org at startup; ALL existing accounts join it (they could all see every
  project before, so anything narrower would lock someone out), oldest
  account as owner. Zero manual steps.
- An account in no org that creates a project gets a fresh org named
  after itself, so nobody is ever blocked from starting to sync.
- Invites are expiring multi-use links (default 7 days): an owner mints
  /#join/<token>, any signed-in account that opens it joins as member.
  The web UI shows the org in a sidebar footer (members on click,
  Invite button for owners).

bdrive init needed no changes: its connect-existing flow lists projects
through the now-filtered API.

Tests: OrgDB + migration units; a 403/access matrix over every
per-project route; invite mint/redeem flow; and a multi-device syncer
test proving a device holding an org-B token can neither pull org A's
files nor push into its store (sync degrades to Offline, never partial).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Q9ZKSZRTdvrSJkYLUmYs
2026-07-08 17:03:48 -07:00

273 lines
8.4 KiB
CSS

/* Obsidian-inspired dark theme */
:root {
--bg: #1e1e1e;
--bg-side: #262626;
--bg-hover: #333333;
--bg-active: #3f3550;
--border: #363636;
--text: #dadada;
--text-dim: #9a9a9a;
--text-faint: #6e6e6e;
--accent: #a882ff;
--accent-dim: #7c5cd6;
--code-bg: #2a2a2a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
display: flex;
background: var(--bg);
color: var(--text);
font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* ---- sidebar ---- */
#sidebar {
width: 280px;
min-width: 200px;
background: var(--bg-side);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
}
#vault {
padding: 14px 16px 10px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}
#vault-name { font-weight: 600; font-size: 14px; }
#signout { color: var(--text-faint); text-decoration: none; font-size: 13px; }
#signout:hover { color: var(--text); }
#upload-btn {
border: none;
cursor: pointer;
font: inherit;
font-size: 12.5px;
}
#projects {
flex: none;
max-height: 30%;
overflow-y: auto;
padding: 8px 6px;
font-size: 13.5px;
border-bottom: 1px solid var(--border);
}
#projects ul { list-style: none; margin: 0; padding-left: 4px; }
#projects .row {
padding: 3px 8px;
border-radius: 5px;
cursor: pointer;
color: var(--text-dim);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#projects .row::before { content: "▣ "; color: var(--text-faint); }
#projects .row:hover { background: var(--bg-hover); color: var(--text); }
#projects .row.active { background: var(--bg-active); color: var(--accent); }
#tree { flex: 1; overflow-y: auto; padding: 8px 6px 24px; font-size: 13.5px; }
#orgbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 9px 16px;
border-top: 1px solid var(--border);
font-size: 12.5px;
color: var(--text-dim);
}
#orgbar[hidden] { display: none; }
#org-name { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#org-name::before { content: "⛛ "; color: var(--text-faint); }
#org-name:hover { color: var(--text); }
#invite-btn {
border: none; cursor: pointer; font: inherit; font-size: 11.5px;
padding: 2px 10px; border-radius: 5px;
background: var(--bg-active); color: var(--text-dim);
}
#invite-btn:hover { color: var(--text); background: var(--bg-hover); }
#tree ul { list-style: none; margin: 0; padding-left: 14px; }
#tree > ul { padding-left: 4px; }
#tree li > .row {
display: flex;
align-items: center;
gap: 5px;
padding: 2px 8px;
border-radius: 5px;
cursor: pointer;
color: var(--text-dim);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#tree li > .row:hover { background: var(--bg-hover); color: var(--text); }
#tree li > .row.active { background: var(--bg-active); color: var(--accent); }
#tree .chev { width: 12px; flex: none; font-size: 10px; color: var(--text-faint); transition: transform .12s; }
#tree li.collapsed > ul { display: none; }
#tree li.collapsed > .row .chev { transform: rotate(-90deg); }
#tree .file .chev { visibility: hidden; }
/* ---- main pane ---- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 24px;
border-bottom: 1px solid var(--border);
min-height: 46px;
}
#crumb { font-size: 13px; color: var(--text-dim); }
#meta { flex: 1; font-size: 12px; color: var(--text-faint); text-align: right; }
.btn {
flex: none;
padding: 4px 12px;
border-radius: 6px;
background: var(--accent-dim);
color: #fff;
font-size: 12.5px;
text-decoration: none;
}
.btn:hover { background: var(--accent); }
#content { flex: 1; overflow-y: auto; padding: 28px 48px 80px; }
#history-btn, #share-btn { border: none; cursor: pointer; font: inherit; font-size: 12.5px; background: var(--bg-active); color: var(--text-dim); }
#history-btn:hover, #share-btn:hover { color: var(--text); background: var(--bg-hover); }
.dir-history { margin-left: auto; padding: 0 4px; visibility: hidden; color: var(--text-faint); font-size: 11px; }
#tree li > .row:hover .dir-history { visibility: visible; }
.dir-history:hover { color: var(--text); }
.history { max-width: 860px; }
.hentry { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.hentry .hline { display: flex; gap: 10px; align-items: baseline; }
.hkind { color: var(--accent); font-size: 11px; }
.hentry.delete .hkind { color: #ff7b72; }
.hpath { font-weight: 500; cursor: pointer; }
.hpath:hover { color: var(--accent); }
.htime { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.hmeta { display: flex; gap: 16px; margin-top: 3px; font-size: 12px; color: var(--text-dim); }
.hdev, .hsize { color: var(--text-faint); }
.hact { margin-left: auto; }
.hact a { color: var(--accent); text-decoration: none; margin-left: 8px; }
.empty { color: var(--text-faint); text-align: center; margin-top: 20vh; }
/* ---- command palette (⌘K) ---- */
#palette-overlay[hidden] { display: none; }
#palette-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, .45);
display: flex;
justify-content: center;
align-items: flex-start;
padding-top: 12vh;
z-index: 100;
}
#palette {
width: min(560px, 90vw);
background: var(--bg-side);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
overflow: hidden;
}
#palette-input {
width: 100%;
box-sizing: border-box;
padding: 14px 16px;
border: none;
border-bottom: 1px solid var(--border);
background: transparent;
color: var(--text);
font: inherit;
font-size: 15px;
outline: none;
}
#palette-results {
list-style: none;
margin: 0;
padding: 6px;
max-height: 46vh;
overflow-y: auto;
}
#palette-results li {
display: flex;
align-items: center;
gap: 10px;
padding: 7px 10px;
border-radius: 7px;
cursor: pointer;
color: var(--text-dim);
font-size: 13.5px;
}
#palette-results li.selected { background: var(--bg-active); color: var(--text); }
#palette-results li .picon { width: 18px; flex: none; text-align: center; color: var(--text-faint); }
#palette-results li .plabel { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#palette-results li .plabel b { color: var(--accent); font-weight: 600; }
#palette-results li .pkind { flex: none; font-size: 11px; color: var(--text-faint); }
#palette-results .pempty { color: var(--text-faint); cursor: default; justify-content: center; }
#palette-hint {
padding: 7px 14px;
border-top: 1px solid var(--border);
font-size: 11px;
color: var(--text-faint);
}
/* ---- markdown ---- */
.markdown { max-width: 820px; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
color: #f0f0f0;
line-height: 1.3;
margin: 1.4em 0 .5em;
}
.markdown h1:first-child { margin-top: 0; }
.markdown h1 { font-size: 1.7em; }
.markdown h2 { font-size: 1.35em; border-bottom: 1px solid var(--border); padding-bottom: .25em; }
.markdown a { color: var(--accent); text-decoration: none; }
.markdown a:hover { text-decoration: underline; }
.markdown code {
background: var(--code-bg);
padding: .15em .4em;
border-radius: 4px;
font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.markdown pre {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 16px;
overflow-x: auto;
}
.markdown pre code { background: none; padding: 0; }
.markdown blockquote {
margin: 1em 0;
padding: .1em 1em;
border-left: 3px solid var(--accent-dim);
color: var(--text-dim);
}
.markdown table { border-collapse: collapse; margin: 1em 0; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 12px; }
.markdown th { background: var(--bg-side); }
.markdown img { max-width: 100%; border-radius: 6px; }
.markdown hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.markdown input[type="checkbox"] { accent-color: var(--accent); }
/* plain file / binary views */
pre.plain {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 16px;
overflow-x: auto;
font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
white-space: pre-wrap;
}
.filecard {
margin-top: 15vh;
text-align: center;
color: var(--text-dim);
}
.filecard .name { font-size: 1.2em; color: var(--text); margin-bottom: .3em; }