Wire the app like the boilerplate: door, queue, schedules, eight tabs
app/main.py assembles it in the boilerplate's order, auth.connect first, then the queue with the scheduler and the pages. TABS is Roles, Applications, Agents, Companies, Jobs, Schedules, Messages and Account: the alpha page's three views become templates on the boilerplate's base.html, driven by static/roles.js (the old app.js) through api() and toasts.js, over the unchanged JSON routes. Companies lists every board with its open roles and the affinity control. A 422 is one sentence, so a toast never reads [object Object]. Config takes the boilerplate's shape: APP_CONFIG or config.yaml, a missing file is the defaults, an unknown key is an error. roles.yaml is gone; config.yaml is the committed default and carries the starter agents. pull is now a job that asks for the pull cascade, because a schedule enqueues a job kind; its default schedule, every 6h, is declared beside it in app/jobs/cascade.py. pull_batch's targets are keyword-only so the Jobs tab offers no batch button. `app worker` is the boilerplate's; `app job` still drains a queue of its own and fires no schedules. test_coupling holds pipeline, auth and desk apart (desk may import pipeline) and plugins to desk; test_architecture keeps app's layers, now with main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
24508dd6fc
commit
59a301c351
42 files changed
+2407
-998
No files matched your search
@@ -0,0 +1,381 @@
|
||||
/* The whole stylesheet: the boilerplate's, with roledesk's palette in the
|
||||
* custom properties (a quiet UI face and newsdesk's teal signal colour) and
|
||||
* roledesk's own tabs in the section at the bottom. No build step.
|
||||
*
|
||||
* The `--desk-jobs-*` block at the bottom is how `<desk-jobs>` is themed. The
|
||||
* element keeps to a shadow root and reads those properties, so an app skins
|
||||
* it without forking it -- which is the deal that lets the queue ship its own
|
||||
* UI and still look like it belongs here.
|
||||
*/
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
|
||||
--bg: #eceff1;
|
||||
--panel: #ffffff;
|
||||
--fg: #1a2027;
|
||||
--dim: #505c67;
|
||||
--line: #d6dbdf;
|
||||
--accent: #14655b;
|
||||
--accent-fg: #ffffff;
|
||||
--good: #15803d;
|
||||
--warn: #b45309;
|
||||
--error: #b91c1c;
|
||||
|
||||
--radius: 10px;
|
||||
--gap: 1rem;
|
||||
--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto,
|
||||
"Helvetica Neue", Arial, sans-serif;
|
||||
--mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #14181c;
|
||||
--panel: #1b2126;
|
||||
--fg: #e3e7ea;
|
||||
--dim: #a8b2ba;
|
||||
--line: #2a3238;
|
||||
--accent: #4fb3a3;
|
||||
--accent-fg: #14181c;
|
||||
--good: #4ade80;
|
||||
--warn: #fbbf24;
|
||||
--error: #f87171;
|
||||
}
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font: 16px/1.55 var(--font);
|
||||
}
|
||||
|
||||
code, pre { font-family: var(--mono); font-size: 0.9em; }
|
||||
pre { overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
|
||||
a { color: var(--accent); }
|
||||
|
||||
/* -- the frame ------------------------------------------------------------ */
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--gap);
|
||||
flex-wrap: wrap;
|
||||
padding: 0.75rem 1.25rem;
|
||||
background: var(--panel);
|
||||
border-bottom: 1px solid var(--line);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.brand span { color: var(--accent); }
|
||||
.brand {
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.02em;
|
||||
text-decoration: none;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
.top nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
|
||||
|
||||
.top nav a {
|
||||
padding: 0.35rem 0.7rem;
|
||||
border-radius: var(--radius);
|
||||
text-decoration: none;
|
||||
color: var(--dim);
|
||||
}
|
||||
.top nav a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
|
||||
.top nav a.active { background: var(--accent); color: var(--accent-fg); }
|
||||
|
||||
main {
|
||||
max-width: 62rem;
|
||||
margin: 0 auto;
|
||||
padding: 1.5rem 1.25rem 4rem;
|
||||
}
|
||||
|
||||
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
|
||||
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
|
||||
|
||||
.lede { color: var(--dim); max-width: 46rem; }
|
||||
.muted { color: var(--dim); }
|
||||
.small { font-size: 0.85rem; }
|
||||
|
||||
.note {
|
||||
background: color-mix(in srgb, var(--accent) 8%, var(--panel));
|
||||
border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
|
||||
border-radius: var(--radius);
|
||||
padding: 0.9rem 1rem;
|
||||
max-width: 46rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
padding: 1rem 1.15rem;
|
||||
margin: 1.25rem 0;
|
||||
}
|
||||
|
||||
.row-between {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: var(--gap);
|
||||
}
|
||||
|
||||
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
|
||||
.summary dt { color: var(--dim); }
|
||||
.summary dd { margin: 0; }
|
||||
|
||||
.buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
|
||||
|
||||
button {
|
||||
font: inherit;
|
||||
padding: 0.4rem 0.9rem;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid transparent;
|
||||
background: var(--accent);
|
||||
color: var(--accent-fg);
|
||||
cursor: pointer;
|
||||
}
|
||||
button:disabled { opacity: 0.55; cursor: progress; }
|
||||
button.secondary {
|
||||
background: transparent;
|
||||
color: var(--fg);
|
||||
border-color: var(--line);
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 0 0.4rem;
|
||||
border-radius: 999px;
|
||||
background: var(--line);
|
||||
color: var(--dim);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
/* -- the notice log ------------------------------------------------------- */
|
||||
|
||||
.notice {
|
||||
border: 1px solid var(--line);
|
||||
border-left: 3px solid var(--dim);
|
||||
border-radius: var(--radius);
|
||||
padding: 0.6rem 0.8rem;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
.notice.error { border-left-color: var(--error); }
|
||||
.notice.warning { border-left-color: var(--warn); }
|
||||
.notice.good { border-left-color: var(--good); }
|
||||
.notice-head { display: flex; justify-content: space-between; gap: var(--gap); align-items: start; }
|
||||
.notice-text { font-weight: 600; }
|
||||
|
||||
/* -- toasts --------------------------------------------------------------- */
|
||||
|
||||
.toasts {
|
||||
position: fixed;
|
||||
right: 1rem;
|
||||
bottom: 1rem;
|
||||
width: min(26rem, calc(100vw - 2rem));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
/* A popover brings its own box; this is a container, not a card. */
|
||||
border: 0;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
inset: auto 1rem 1rem auto;
|
||||
}
|
||||
|
||||
.toast {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: start;
|
||||
background: var(--panel);
|
||||
color: var(--fg);
|
||||
border: 1px solid var(--line);
|
||||
border-left: 3px solid var(--dim);
|
||||
border-radius: var(--radius);
|
||||
padding: 0.6rem 0.75rem;
|
||||
box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
|
||||
animation: toast-in 160ms ease-out;
|
||||
}
|
||||
.toast.error { border-left-color: var(--error); }
|
||||
.toast.warning { border-left-color: var(--warn); }
|
||||
.toast.good { border-left-color: var(--good); }
|
||||
.toast.out { opacity: 0; transition: opacity 180ms ease-in; }
|
||||
.toast-body { flex: 1; min-width: 0; }
|
||||
.toast-count { color: var(--dim); }
|
||||
.toast-fix { color: var(--dim); }
|
||||
.toast-actions { display: flex; gap: 0.5rem; align-items: center; }
|
||||
.toast-actions:empty { display: none; }
|
||||
.toast-close {
|
||||
background: transparent;
|
||||
color: var(--dim);
|
||||
border: 0;
|
||||
padding: 0 0.25rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@keyframes toast-in {
|
||||
from { transform: translateY(6px); opacity: 0; }
|
||||
to { transform: none; opacity: 1; }
|
||||
}
|
||||
|
||||
/* -- the modules' elements ------------------------------------------------ */
|
||||
/* `<desk-jobs>` and `<desk-schedules>` from the queue, `<auth-account>` from
|
||||
* auth: all three read these, so they look like one application and none of
|
||||
* them is forked to get it. An element the app has not got yet simply matches
|
||||
* nothing. */
|
||||
|
||||
desk-jobs, desk-schedules, auth-account {
|
||||
display: block;
|
||||
--desk-jobs-bg: var(--panel);
|
||||
--desk-jobs-fg: var(--fg);
|
||||
--desk-jobs-dim: var(--dim);
|
||||
--desk-jobs-accent: var(--accent);
|
||||
--desk-jobs-error: var(--error);
|
||||
--desk-jobs-font: var(--font);
|
||||
--desk-jobs-gap: var(--gap);
|
||||
--desk-jobs-radius: var(--radius);
|
||||
}
|
||||
|
||||
/* -- roledesk's tabs ------------------------------------------------------ */
|
||||
/* Roles, Applications, Agents and Companies, drawn by static/roles.js. */
|
||||
|
||||
input, select, textarea { font: inherit; color: inherit; }
|
||||
|
||||
.filters {
|
||||
display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
|
||||
padding: .75rem; margin-bottom: .5rem;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line); border-radius: var(--radius);
|
||||
}
|
||||
.filters input[type="search"], .filters input[type="text"], .filters select {
|
||||
padding: .4rem .55rem;
|
||||
border: 1px solid var(--line); border-radius: .3rem;
|
||||
background: var(--bg); min-width: 0;
|
||||
}
|
||||
.filters input[type="search"] { flex: 1 1 12rem; }
|
||||
.filters input[type="text"] { flex: 1 1 8rem; }
|
||||
.check {
|
||||
display: flex; align-items: center; gap: .35rem;
|
||||
color: var(--dim); font-size: .9rem; white-space: nowrap;
|
||||
}
|
||||
.check[hidden] { display: none; }
|
||||
|
||||
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
|
||||
textarea:focus-visible {
|
||||
outline: 2px solid var(--accent); outline-offset: 1px;
|
||||
}
|
||||
|
||||
.count { color: var(--dim); font-size: .85rem; margin: .75rem 0 .5rem; }
|
||||
|
||||
/* roles */
|
||||
|
||||
.roles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
|
||||
.role {
|
||||
background: var(--panel); border: 1px solid var(--line); border-radius: .5rem;
|
||||
padding: .6rem .8rem;
|
||||
display: flex; flex-direction: column; gap: .35rem;
|
||||
}
|
||||
.role-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
|
||||
.role-title { font-weight: 600; text-decoration: none; }
|
||||
.role-title:hover { text-decoration: underline; }
|
||||
.role-company { color: var(--dim); }
|
||||
.role-meta {
|
||||
display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
|
||||
color: var(--dim); font-size: .85rem;
|
||||
}
|
||||
.role-meta .badge {
|
||||
background: transparent; color: var(--dim);
|
||||
border: 1px solid var(--line); border-radius: 1rem;
|
||||
padding: .05rem .55rem; font-size: .78rem;
|
||||
}
|
||||
.role-meta .badge:empty { display: none; }
|
||||
.role-meta .role-score {
|
||||
color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.role-gated { color: var(--error); font-size: .85rem; }
|
||||
.role-age { margin-left: auto; }
|
||||
.role.muted, tr.muted { opacity: .55; }
|
||||
.role.gated { opacity: .7; }
|
||||
|
||||
.affinity { display: inline-flex; gap: .15rem; }
|
||||
.role-main .affinity { margin-left: auto; }
|
||||
.affinity button {
|
||||
background: none; border: 1px solid var(--line); border-radius: .3rem;
|
||||
padding: .1rem .4rem; color: var(--dim); font-size: .85rem; line-height: 1.4;
|
||||
}
|
||||
.affinity button[aria-pressed="true"] {
|
||||
color: var(--accent-fg); background: var(--accent); border-color: var(--accent);
|
||||
}
|
||||
.affinity button[data-value="-1"][aria-pressed="true"] {
|
||||
background: var(--error); border-color: var(--error);
|
||||
}
|
||||
|
||||
.save { align-self: flex-start; padding: .3rem .8rem; font-weight: 600; }
|
||||
.save[disabled] {
|
||||
background: var(--bg); color: var(--dim); border-color: var(--line); cursor: default;
|
||||
}
|
||||
|
||||
/* agents */
|
||||
|
||||
.agents { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
|
||||
.agent {
|
||||
display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
|
||||
background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
|
||||
padding: .5rem .75rem;
|
||||
}
|
||||
.agent a { font-weight: 600; text-decoration: none; }
|
||||
.agent-meta { color: var(--dim); font-size: .85rem; flex: 1 1 12rem; }
|
||||
.agent-form {
|
||||
display: flex; flex-direction: column; gap: .6rem; max-width: 44rem;
|
||||
background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
|
||||
padding: .75rem 1rem;
|
||||
}
|
||||
.agent-form h2 { font-size: 1rem; margin: 0; }
|
||||
.agent-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
|
||||
.agent-form label.inline { flex-direction: row; align-items: center; gap: .4rem; }
|
||||
.agent-form input[type="text"], .agent-form textarea, .agent-form input[type="number"] {
|
||||
background: var(--bg); border: 1px solid var(--line);
|
||||
border-radius: .3rem; padding: .35rem .5rem; width: 100%;
|
||||
}
|
||||
.agent-form textarea { font-family: var(--mono); font-size: .85rem; }
|
||||
.agent-form .hint { color: var(--dim); font-size: .8rem; overflow-wrap: anywhere; }
|
||||
.weights { display: flex; gap: .75rem; flex-wrap: wrap; border: 1px solid var(--line); border-radius: .3rem; }
|
||||
.weights label { flex: 1 1 6rem; }
|
||||
.agent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
|
||||
|
||||
/* applications and companies */
|
||||
|
||||
table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
|
||||
table.list th, table.list td {
|
||||
text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line);
|
||||
font-size: .9rem;
|
||||
}
|
||||
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
|
||||
table.list select { padding: .25rem .4rem; }
|
||||
|
||||
/* Below tablet width a table stops being a table: each row becomes a card,
|
||||
its cells stacked, so nothing scrolls sideways to be read. */
|
||||
@media (max-width: 640px) {
|
||||
table.list thead { display: none; }
|
||||
table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
|
||||
table.list tr { margin-bottom: .6rem; border: 1px solid var(--line); border-radius: .4rem; }
|
||||
table.list td { border-bottom: none; }
|
||||
table.list .num { text-align: left; }
|
||||
table.list td::before {
|
||||
content: attr(data-label);
|
||||
display: block; font-size: .72rem; color: var(--dim); margin-bottom: .1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.role-age, .role-main .affinity { margin-left: 0; }
|
||||
}
|
||||
Reference in new issue
Block a user