Web UI: navigation, Juniper-derived design system, accessibility floor
One shared stylesheet (static/app.css) replaces the two ad-hoc style blocks, with tokens drawn from the mascot drawing: sky background, cream game-board cards inside confident outlines with flat offset shadows, hair-purple for brand and actions, shirt-green for go, bow-tie orange for danger, pipe-fitting gold for trim, jeans navy for chrome — and the rainbow game path as a stripe under the header, the one loud element. Accent colors split into object and *-ink variants so text on light surfaces holds AA contrast. Navigation: both pages share a header with brand-home link, a Primary nav with aria-current, and tally counts that link to the lists they count (dashboard tallies deep-link into the review catalog; review tallies jump to their sections). Accessibility: skip link, landmark nav, polite live region for stage activity, status role on banners, the dropzone is a real button, candidate rows are focusable and activate with Enter/Space, focus-visible ring throughout, reduced motion respected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ Full design lives in `bgg-shelf-pipeline-spec.md` (read it before changing pipel
|
|||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
|
|
||||||
- `src/bggpipe/` — `cli.py` (typer app), one module per stage (`extract`, `resolve`, `review` + `webreview`, `diff`, `upload`, `enrich`), plus `bgg_client.py` (rate-limited XML API2 client that caches responses to `data/bgg_cache/`), `jobs.py` (single-slot background stage runner for the web UI), `normalize.py` (title normalization), `models.py` (dataclasses), `config.py`, `fsio.py` (atomic writes), `init_wizard.py` (first-run setup).
|
- `src/bggpipe/` — `cli.py` (typer app), one module per stage (`extract`, `resolve`, `review` + `webreview`, `diff`, `upload`, `enrich`); `templates/` + `static/app.css` are the web UI (one shared stylesheet is the design system — its tokens derive from the mascot art), plus `bgg_client.py` (rate-limited XML API2 client that caches responses to `data/bgg_cache/`), `jobs.py` (single-slot background stage runner for the web UI), `normalize.py` (title normalization), `models.py` (dataclasses), `config.py`, `fsio.py` (atomic writes), `init_wizard.py` (first-run setup).
|
||||||
- `scripts/` — `write_stub_fixtures.py` / `write_photo_fixtures.py` generate synthetic fixtures; `record_fixtures.py` re-records real API responses once a token exists.
|
- `scripts/` — `write_stub_fixtures.py` / `write_photo_fixtures.py` generate synthetic fixtures; `record_fixtures.py` re-records real API responses once a token exists.
|
||||||
- `tests/fixtures/bgg_cache/` — stub XML fixtures the offline tests run against.
|
- `tests/fixtures/bgg_cache/` — stub XML fixtures the offline tests run against.
|
||||||
- `data/` — pipeline state (CSV/JSON artifacts are committed; caches are not — see Git).
|
- `data/` — pipeline state (CSV/JSON artifacts are committed; caches are not — see Git).
|
||||||
|
|||||||
@@ -0,0 +1,346 @@
|
|||||||
|
/* bggpipe design system — one stylesheet, two pages (dashboard, review).
|
||||||
|
*
|
||||||
|
* The visual world is Juniper's mascot drawing: a sky-blue day, flat cel
|
||||||
|
* color inside confident dark outlines, a cream game board with a rainbow
|
||||||
|
* path, gold pipe fittings, purple hair, a spring-green shirt, an orange
|
||||||
|
* bow tie, navy jeans. Tokens map those to roles — purple is brand and
|
||||||
|
* action, green means go, bow-tie orange means danger, gold is trim, navy
|
||||||
|
* is ink and dark chrome. The one loud element is the rainbow path stripe
|
||||||
|
* under the header; everything else stays flat and outlined.
|
||||||
|
*
|
||||||
|
* Contrast rule: --accent/--go/--stop have *-ink variants for text on
|
||||||
|
* light surfaces; the base variants fill objects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--sky: #cbe7f7; /* the drawing's daytime background */
|
||||||
|
--sky-deep: #b3d9ef;
|
||||||
|
--board: #fbf5e6; /* cream game-board card */
|
||||||
|
--board-edge: #e9dfc6;
|
||||||
|
--ink: #1f2433; /* outline navy-black */
|
||||||
|
--ink-soft: #52607a;
|
||||||
|
--navy: #2c3a5c; /* jeans: dark chrome, header, log */
|
||||||
|
--navy-deep: #232e49;
|
||||||
|
--accent: #8330c2; /* hair purple: brand + actions */
|
||||||
|
--accent-ink: #6b27a0;
|
||||||
|
--go: #2f8a45; /* shirt green, darkened for white text */
|
||||||
|
--go-ink: #256e37;
|
||||||
|
--stop: #d94a26; /* bow-tie orange-red */
|
||||||
|
--stop-ink: #b03a1c;
|
||||||
|
--gold: #f2c04b; /* pipe fittings: rings, trim, hovers */
|
||||||
|
--gold-ink: #8a6414;
|
||||||
|
--ticket: #fdf3d2; /* reshoot work-orders */
|
||||||
|
--focus: #8330c2;
|
||||||
|
--path: linear-gradient(90deg,
|
||||||
|
#f767b8, #f79a3e, #f2c04b, #6fce6f, #5aa7f0, #9a5be0);
|
||||||
|
--font-display: ui-rounded, "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", var(--font-body);
|
||||||
|
--font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||||
|
--font-mono: ui-monospace, "SF Mono", Menlo, monospace;
|
||||||
|
--radius: 8px;
|
||||||
|
--radius-lg: 12px;
|
||||||
|
--line: 2px solid var(--ink);
|
||||||
|
--shadow-card: 3px 3px 0 rgba(31, 36, 51, .18);
|
||||||
|
--shadow-raised: 5px 5px 0 rgba(31, 36, 51, .22);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -- base ------------------------------------------------------------- */
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
html { background: var(--sky); }
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: var(--font-body);
|
||||||
|
color: var(--ink);
|
||||||
|
background:
|
||||||
|
radial-gradient(ellipse at 50% -20%, rgba(255,255,255,.5), transparent 55%),
|
||||||
|
var(--sky);
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
main { max-width: 62rem; margin: 0 auto; padding: 1.4rem 1.2rem 6rem; }
|
||||||
|
h2 {
|
||||||
|
color: var(--ink);
|
||||||
|
font-family: var(--font-display);
|
||||||
|
font-weight: 700; font-size: 1.1rem; letter-spacing: .02em;
|
||||||
|
margin: 2rem 0 .8rem;
|
||||||
|
}
|
||||||
|
h2 .count { color: var(--ink-soft); font-size: .85rem; font-weight: 400; }
|
||||||
|
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
|
||||||
|
|
||||||
|
/* -- header + navigation ---------------------------------------------- */
|
||||||
|
header {
|
||||||
|
position: sticky; top: 0; z-index: 5;
|
||||||
|
background: var(--navy);
|
||||||
|
color: #fff;
|
||||||
|
padding: .45rem 1.2rem;
|
||||||
|
display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
|
||||||
|
border-bottom: 4px solid transparent;
|
||||||
|
border-image: var(--path) 1;
|
||||||
|
}
|
||||||
|
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
|
||||||
|
.brand img {
|
||||||
|
width: 38px; height: 38px; border-radius: 50%;
|
||||||
|
border: 2px solid var(--gold); object-fit: cover; display: block;
|
||||||
|
background: var(--sky);
|
||||||
|
}
|
||||||
|
.wordmark {
|
||||||
|
font-family: var(--font-display);
|
||||||
|
font-size: 1.3rem; font-weight: 700; letter-spacing: .01em;
|
||||||
|
}
|
||||||
|
.wordmark small { opacity: .8; font-family: var(--font-body); font-weight: 400; font-size: .75rem; margin-left: .5rem; }
|
||||||
|
nav[aria-label="Primary"] { display: flex; gap: .9rem; font-size: .9rem; }
|
||||||
|
nav[aria-label="Primary"] a {
|
||||||
|
color: #fff; text-decoration: none; opacity: .85;
|
||||||
|
padding: .1rem 0; border-bottom: 2px solid transparent;
|
||||||
|
}
|
||||||
|
nav[aria-label="Primary"] a:hover { opacity: 1; }
|
||||||
|
nav[aria-label="Primary"] a[aria-current="page"] {
|
||||||
|
opacity: 1; border-bottom-color: var(--gold); font-weight: 600;
|
||||||
|
}
|
||||||
|
.skip {
|
||||||
|
position: absolute; left: -999px; top: 0; z-index: 10;
|
||||||
|
background: var(--board); color: var(--ink);
|
||||||
|
padding: .5rem 1rem; border-radius: 0 0 var(--radius) 0;
|
||||||
|
}
|
||||||
|
.skip:focus { left: 0; }
|
||||||
|
#tally { font-size: .85rem; opacity: .95; display: flex; gap: 1rem; flex-wrap: wrap; }
|
||||||
|
#tally b { color: var(--gold); font-weight: 700; }
|
||||||
|
#tally a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,.5); }
|
||||||
|
#tally a:hover { border-bottom-color: var(--gold); }
|
||||||
|
.keyhelp { margin-left: auto; font-size: .75rem; opacity: .85; }
|
||||||
|
kbd {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: .72rem;
|
||||||
|
background: var(--board);
|
||||||
|
color: var(--ink);
|
||||||
|
border: 1px solid var(--board-edge);
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0 .35em;
|
||||||
|
display: inline-block; min-width: 1.4em; text-align: center;
|
||||||
|
}
|
||||||
|
header kbd { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
|
||||||
|
|
||||||
|
/* -- banners ----------------------------------------------------------- */
|
||||||
|
#banner { max-width: 62rem; margin: 0 auto; padding: 0 1.2rem; }
|
||||||
|
.banner {
|
||||||
|
border-radius: var(--radius); padding: .6rem .9rem; margin-top: .9rem;
|
||||||
|
font-size: .85rem; line-height: 1.4;
|
||||||
|
border: var(--line);
|
||||||
|
background: var(--board);
|
||||||
|
}
|
||||||
|
.banner.error { border-color: var(--stop); color: var(--stop-ink); background: #fbe3da; }
|
||||||
|
.banner.warn { border-color: var(--gold-ink); color: var(--gold-ink); background: var(--ticket); }
|
||||||
|
|
||||||
|
/* -- buttons ----------------------------------------------------------- */
|
||||||
|
button, .linkbtn {
|
||||||
|
font: inherit; font-size: .85rem;
|
||||||
|
border: var(--line); background: #fff; color: var(--ink);
|
||||||
|
border-radius: var(--radius); padding: .3rem .8rem; cursor: pointer;
|
||||||
|
text-decoration: none; display: inline-block;
|
||||||
|
box-shadow: 2px 2px 0 rgba(31, 36, 51, .18);
|
||||||
|
}
|
||||||
|
button:hover, .linkbtn:hover { background: var(--board); }
|
||||||
|
button:active, .linkbtn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(31,36,51,.18); }
|
||||||
|
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
|
||||||
|
button.primary { background: var(--go); border-color: var(--ink); color: #fff; }
|
||||||
|
button.primary:hover { background: var(--go-ink); }
|
||||||
|
button.danger { color: var(--stop-ink); border-color: var(--stop); background: #fff; }
|
||||||
|
|
||||||
|
/* -- decision cards (review) ------------------------------------------ */
|
||||||
|
.card {
|
||||||
|
background: var(--board);
|
||||||
|
border: var(--line);
|
||||||
|
border-radius: var(--radius-lg);
|
||||||
|
box-shadow: var(--shadow-card);
|
||||||
|
padding: 1rem 1.1rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
display: flex; gap: 1.1rem;
|
||||||
|
scroll-margin-top: 5rem;
|
||||||
|
}
|
||||||
|
.card.active {
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: var(--shadow-raised);
|
||||||
|
}
|
||||||
|
@media (prefers-reduced-motion: no-preference) {
|
||||||
|
.card { transition: box-shadow .15s ease, border-color .15s ease; }
|
||||||
|
button, .linkbtn { transition: transform .06s ease, box-shadow .06s ease; }
|
||||||
|
}
|
||||||
|
.shots { flex: 0 0 180px; display: flex; flex-direction: column; gap: .5rem; }
|
||||||
|
.shots img { width: 100%; border-radius: 6px; border: var(--line); display: block; }
|
||||||
|
.shots .noshot {
|
||||||
|
color: var(--ink-soft); font-size: .8rem; border: 2px dashed var(--board-edge);
|
||||||
|
border-radius: 6px; padding: 1.2rem .6rem; text-align: center;
|
||||||
|
}
|
||||||
|
.body { flex: 1; min-width: 0; }
|
||||||
|
.title { font-size: 1.15rem; font-weight: 700; font-family: var(--font-display); margin: 0 0 .15rem; }
|
||||||
|
.status { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
|
||||||
|
.cues { margin: .5rem 0 .7rem; display: flex; flex-wrap: wrap; gap: .35rem; }
|
||||||
|
.cue {
|
||||||
|
font-size: .74rem; background: #fff; border: 1px solid var(--board-edge);
|
||||||
|
border-radius: 999px; padding: .1rem .6rem; color: var(--ink);
|
||||||
|
}
|
||||||
|
.cue b { font-weight: 600; color: var(--ink-soft); }
|
||||||
|
.cands { list-style: none; margin: 0; padding: 0; }
|
||||||
|
.cands li {
|
||||||
|
display: flex; align-items: center; gap: .6rem;
|
||||||
|
padding: .4rem .5rem; border-radius: var(--radius); cursor: pointer;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
}
|
||||||
|
.cands li:hover, .cands li:focus-visible { background: #fff; border-color: var(--accent); }
|
||||||
|
.thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; border: 1px solid var(--board-edge); flex: 0 0 42px; }
|
||||||
|
.thumb.ph {
|
||||||
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
background: var(--accent); color: #fff;
|
||||||
|
font-family: var(--font-display); font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
.cname { font-weight: 600; }
|
||||||
|
.cmeta { color: var(--ink-soft); font-size: .8rem; margin-left: .4rem; }
|
||||||
|
.rowactions { margin-top: .7rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: .85rem; }
|
||||||
|
.rowactions button {
|
||||||
|
font: inherit; border: var(--line); background: #fff;
|
||||||
|
border-radius: var(--radius); padding: .25rem .7rem; cursor: pointer;
|
||||||
|
}
|
||||||
|
.rowactions button.reject { color: var(--stop-ink); border-color: var(--stop); }
|
||||||
|
.rowactions input[type=text] {
|
||||||
|
font: inherit; width: 8.5em; padding: .25rem .5rem;
|
||||||
|
border: 2px solid var(--board-edge); border-radius: var(--radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -- reshoot work-orders: tickets, not cards --------------------------- */
|
||||||
|
.ticket {
|
||||||
|
background: var(--ticket);
|
||||||
|
border: 2px dashed var(--gold-ink);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
padding: .8rem 1rem;
|
||||||
|
margin-bottom: .8rem;
|
||||||
|
display: flex; gap: 1rem; align-items: flex-start;
|
||||||
|
scroll-margin-top: 5rem;
|
||||||
|
}
|
||||||
|
.ticket.active { border-style: solid; box-shadow: var(--shadow-raised); }
|
||||||
|
.ticket .stencil {
|
||||||
|
writing-mode: vertical-rl; text-orientation: mixed;
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: .7rem; letter-spacing: .35em; font-weight: 700;
|
||||||
|
color: var(--gold-ink); text-transform: uppercase;
|
||||||
|
border-right: 1px solid var(--gold-ink); padding-right: .5rem;
|
||||||
|
}
|
||||||
|
.ticket img { width: 130px; border-radius: 4px; border: 1px solid var(--gold-ink); }
|
||||||
|
.ticket .loc { font-weight: 600; margin-bottom: .25rem; }
|
||||||
|
.ticket .partial { font-family: var(--font-mono); font-size: .85rem; }
|
||||||
|
.ticket .notes { color: var(--gold-ink); font-size: .85rem; margin-top: .2rem; }
|
||||||
|
.ticket button {
|
||||||
|
font: inherit; font-size: .8rem; margin-top: .5rem;
|
||||||
|
background: none; border: 1px solid var(--gold-ink); color: var(--gold-ink);
|
||||||
|
border-radius: var(--radius); padding: .2rem .6rem; cursor: pointer;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -- all-done celebration ---------------------------------------------- */
|
||||||
|
.done {
|
||||||
|
background: var(--board); border: var(--line); border-radius: var(--radius-lg);
|
||||||
|
padding: 1.6rem; text-align: center; box-shadow: var(--shadow-raised);
|
||||||
|
}
|
||||||
|
.done .piper {
|
||||||
|
height: 165px; margin-bottom: .4rem;
|
||||||
|
border-radius: var(--radius-lg); border: var(--line);
|
||||||
|
background: var(--sky);
|
||||||
|
}
|
||||||
|
.done h2 { color: var(--ink); margin-top: 0; }
|
||||||
|
.done .nums { display: flex; justify-content: center; gap: 2rem; margin: 1rem 0; }
|
||||||
|
.done .nums div { font-size: 1.6rem; font-weight: 700; font-family: var(--font-display); }
|
||||||
|
.done .nums span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
|
||||||
|
.done code {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
background: var(--navy); color: #fff;
|
||||||
|
padding: .3rem .8rem; border-radius: var(--radius);
|
||||||
|
display: inline-block; white-space: nowrap;
|
||||||
|
}
|
||||||
|
.done .waiting {
|
||||||
|
color: var(--gold-ink);
|
||||||
|
max-width: 34rem; margin: 1rem auto .2rem; line-height: 1.5;
|
||||||
|
}
|
||||||
|
.done .next { margin: .8rem 0 .2rem; }
|
||||||
|
|
||||||
|
/* -- catalog: read-only status ledger ---------------------------------- */
|
||||||
|
.catalog { background: var(--board); border: var(--line); border-radius: var(--radius-lg); padding: .4rem 1rem; box-shadow: var(--shadow-card); }
|
||||||
|
.catalog table { width: 100%; border-collapse: collapse; font-size: .85rem; }
|
||||||
|
.catalog td { padding: .38rem .5rem; border-top: 1px solid var(--board-edge); vertical-align: top; }
|
||||||
|
.catalog tr:first-child td { border-top: none; }
|
||||||
|
.catalog tr:hover td { background: #fff; }
|
||||||
|
.catalog .t { font-weight: 600; max-width: 22rem; }
|
||||||
|
.catalog .meta { color: var(--ink-soft); }
|
||||||
|
.catalog a {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: underline dotted;
|
||||||
|
text-underline-offset: 2px;
|
||||||
|
}
|
||||||
|
.catalog a:hover { color: var(--accent-ink); }
|
||||||
|
.chip {
|
||||||
|
font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
|
||||||
|
border-radius: 999px; padding: .1rem .55rem; white-space: nowrap;
|
||||||
|
border: 1px solid currentColor;
|
||||||
|
}
|
||||||
|
.chip.ok { background: #e2f2e4; color: var(--go-ink); }
|
||||||
|
.chip.wait { background: var(--ticket); color: var(--gold-ink); }
|
||||||
|
.chip.no { background: #fbe3da; color: var(--stop-ink); }
|
||||||
|
.chip.open { background: #ece5f7; color: var(--accent-ink); }
|
||||||
|
.chip.merged { background: #e3ecf3; color: var(--navy); }
|
||||||
|
|
||||||
|
/* -- merge notices: slim, undoable ------------------------------------- */
|
||||||
|
.card.merge { padding: .55rem 1rem; align-items: center; }
|
||||||
|
.card.merge .body { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
|
||||||
|
.card.merge .arrow { color: var(--ink-soft); }
|
||||||
|
.card.merge button {
|
||||||
|
font: inherit; font-size: .8rem; margin-left: auto;
|
||||||
|
background: none; border: 1px solid var(--board-edge);
|
||||||
|
border-radius: var(--radius); padding: .2rem .6rem; cursor: pointer;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
.card.merge button:hover { border-color: var(--stop); color: var(--stop-ink); }
|
||||||
|
|
||||||
|
/* -- dashboard: stage cards, dropzone, activity log --------------------- */
|
||||||
|
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .9rem; }
|
||||||
|
.stage {
|
||||||
|
background: var(--board); border: var(--line); border-radius: var(--radius-lg);
|
||||||
|
box-shadow: var(--shadow-card);
|
||||||
|
padding: .9rem 1rem;
|
||||||
|
display: flex; flex-direction: column; gap: .5rem;
|
||||||
|
}
|
||||||
|
.stage .top { display: flex; align-items: baseline; gap: .55rem; }
|
||||||
|
.stage .num {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
color: var(--accent-ink); font-size: .8rem; font-weight: 700;
|
||||||
|
}
|
||||||
|
.stage .name { font-weight: 700; font-family: var(--font-display); }
|
||||||
|
.stage .facts { color: var(--ink-soft); font-size: .84rem; line-height: 1.45; flex: 1; }
|
||||||
|
.stage .facts b { color: var(--ink); }
|
||||||
|
.stage .act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
|
||||||
|
.stage input[type=number] {
|
||||||
|
font: inherit; width: 4.5em; padding: .25rem .4rem;
|
||||||
|
border: 2px solid var(--board-edge); border-radius: var(--radius);
|
||||||
|
}
|
||||||
|
#dropzone {
|
||||||
|
display: block; width: 100%;
|
||||||
|
background: var(--ticket);
|
||||||
|
border: 2px dashed var(--gold-ink);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
padding: 1.4rem;
|
||||||
|
text-align: center; color: var(--gold-ink);
|
||||||
|
font: inherit; cursor: pointer;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
#dropzone.hot, #dropzone:hover { border-style: solid; background: #fdeebb; }
|
||||||
|
#joblog {
|
||||||
|
background: var(--navy); color: #eaf1fb;
|
||||||
|
font-family: var(--font-mono); font-size: .78rem;
|
||||||
|
border: var(--line); border-radius: var(--radius-lg);
|
||||||
|
padding: .8rem 1rem;
|
||||||
|
max-height: 20rem; overflow-y: auto; white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
#jobstate { font-size: .85rem; color: var(--ink); margin-bottom: .4rem; }
|
||||||
|
#jobstate .running { color: var(--accent-ink); font-weight: 600; }
|
||||||
|
#jobstate .failed { color: var(--stop-ink); font-weight: 600; }
|
||||||
|
|
||||||
|
@media (max-width: 700px) {
|
||||||
|
.card, .ticket { flex-direction: column; }
|
||||||
|
.shots { flex-basis: auto; }
|
||||||
|
}
|
||||||
@@ -3,141 +3,36 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>bggpipe</title>
|
<title>bggpipe — dashboard</title>
|
||||||
<link rel="icon" type="image/png" href="/static/favicon.png">
|
<link rel="icon" type="image/png" href="/static/favicon.png">
|
||||||
<style>
|
<link rel="stylesheet" href="/static/app.css">
|
||||||
:root {
|
|
||||||
--felt: #2c4136;
|
|
||||||
--felt-deep: #24362d;
|
|
||||||
--paper: #f7f4ec;
|
|
||||||
--paper-edge: #e6e0d2;
|
|
||||||
--ink: #24291f;
|
|
||||||
--ink-soft: #5c6355;
|
|
||||||
--brass: #c08f2f;
|
|
||||||
--brass-deep: #93691c;
|
|
||||||
--kraft: #efe4cd;
|
|
||||||
--approve: #3e6b4f;
|
|
||||||
--reject: #96473a;
|
|
||||||
--focus: #7fb08f;
|
|
||||||
}
|
|
||||||
* { box-sizing: border-box; }
|
|
||||||
html { background: var(--felt); }
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
||||||
color: var(--ink);
|
|
||||||
background:
|
|
||||||
radial-gradient(ellipse at 50% -20%, rgba(255,255,255,.06), transparent 60%),
|
|
||||||
var(--felt);
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
header {
|
|
||||||
position: sticky; top: 0; z-index: 5;
|
|
||||||
background: var(--felt-deep);
|
|
||||||
color: var(--paper);
|
|
||||||
padding: .45rem 1.2rem;
|
|
||||||
display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,.12);
|
|
||||||
}
|
|
||||||
.brand { display: flex; align-items: center; gap: .6rem; }
|
|
||||||
.brand img {
|
|
||||||
width: 38px; height: 38px; border-radius: 50%;
|
|
||||||
border: 2px solid var(--brass); object-fit: cover; display: block;
|
|
||||||
}
|
|
||||||
.wordmark {
|
|
||||||
font-family: "Iowan Old Style", Palatino, Georgia, serif;
|
|
||||||
font-size: 1.25rem; letter-spacing: .02em;
|
|
||||||
}
|
|
||||||
.wordmark small { opacity: .55; font-family: system-ui, sans-serif; font-size: .75rem; margin-left: .5rem; }
|
|
||||||
#tally { font-size: .85rem; opacity: .85; display: flex; gap: 1rem; }
|
|
||||||
#tally b { color: var(--brass); font-weight: 600; }
|
|
||||||
main { max-width: 62rem; margin: 0 auto; padding: 1.4rem 1.2rem 6rem; }
|
|
||||||
#banner { max-width: 62rem; margin: 0 auto; padding: 0 1.2rem; }
|
|
||||||
.banner {
|
|
||||||
border-radius: 6px; padding: .6rem .9rem; margin-top: .9rem;
|
|
||||||
font-size: .85rem; line-height: 1.4;
|
|
||||||
}
|
|
||||||
.banner.error { background: #f6dcd6; border: 1px solid var(--reject); color: #6b2417; }
|
|
||||||
.banner.warn { background: var(--kraft); border: 1px solid var(--brass-deep); color: #6b5b33; }
|
|
||||||
h2 {
|
|
||||||
color: var(--paper);
|
|
||||||
font-family: "Iowan Old Style", Palatino, Georgia, serif;
|
|
||||||
font-weight: 500; font-size: 1.05rem; letter-spacing: .04em;
|
|
||||||
margin: 2rem 0 .8rem;
|
|
||||||
}
|
|
||||||
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .9rem; }
|
|
||||||
.stage {
|
|
||||||
background: var(--paper); border-radius: 8px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,.35);
|
|
||||||
padding: .9rem 1rem;
|
|
||||||
display: flex; flex-direction: column; gap: .5rem;
|
|
||||||
}
|
|
||||||
.stage .top { display: flex; align-items: baseline; gap: .55rem; }
|
|
||||||
.stage .num {
|
|
||||||
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
||||||
color: var(--brass-deep); font-size: .8rem; font-weight: 700;
|
|
||||||
}
|
|
||||||
.stage .name { font-weight: 650; }
|
|
||||||
.stage .facts { color: var(--ink-soft); font-size: .84rem; line-height: 1.45; flex: 1; }
|
|
||||||
.stage .facts b { color: var(--ink); }
|
|
||||||
.stage .act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
|
|
||||||
button, .linkbtn {
|
|
||||||
font: inherit; font-size: .85rem;
|
|
||||||
border: 1px solid var(--paper-edge); background: #fff; color: var(--ink);
|
|
||||||
border-radius: 6px; padding: .3rem .8rem; cursor: pointer;
|
|
||||||
text-decoration: none; display: inline-block;
|
|
||||||
}
|
|
||||||
button:hover, .linkbtn:hover { background: #ede8da; }
|
|
||||||
button:disabled { opacity: .45; cursor: default; }
|
|
||||||
button.primary { background: var(--approve); border-color: var(--approve); color: #fff; }
|
|
||||||
button.danger { color: var(--reject); border-color: var(--reject); }
|
|
||||||
.stage input[type=number] {
|
|
||||||
font: inherit; width: 4.5em; padding: .25rem .4rem;
|
|
||||||
border: 1px solid var(--paper-edge); border-radius: 6px;
|
|
||||||
}
|
|
||||||
#dropzone {
|
|
||||||
background: var(--kraft);
|
|
||||||
border: 2px dashed var(--brass-deep);
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 1.4rem;
|
|
||||||
text-align: center; color: #6b5b33;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
#dropzone.hot { border-style: solid; background: #f4ecd8; }
|
|
||||||
#joblog {
|
|
||||||
background: var(--felt-deep); color: var(--paper);
|
|
||||||
font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem;
|
|
||||||
border-radius: 8px; padding: .8rem 1rem;
|
|
||||||
max-height: 20rem; overflow-y: auto; white-space: pre-wrap;
|
|
||||||
box-shadow: inset 0 2px 6px rgba(0,0,0,.4);
|
|
||||||
}
|
|
||||||
#jobstate { font-size: .85rem; color: var(--paper); opacity: .85; margin-bottom: .4rem; }
|
|
||||||
#jobstate .running { color: var(--brass); }
|
|
||||||
#jobstate .failed { color: #e0a294; }
|
|
||||||
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<a class="skip" href="#main">Skip to content</a>
|
||||||
<header>
|
<header>
|
||||||
<div class="brand">
|
<a class="brand" href="/">
|
||||||
<img src="/static/logo.jpg" alt="">
|
<img src="/static/logo.jpg" alt="">
|
||||||
<span class="wordmark">bggpipe<small>shelf → BGG pipeline</small></span>
|
<span class="wordmark">bggpipe<small>shelf → BGG pipeline</small></span>
|
||||||
</div>
|
</a>
|
||||||
|
<nav aria-label="Primary">
|
||||||
|
<a href="/" aria-current="page">Dashboard</a>
|
||||||
|
<a href="/review">Review</a>
|
||||||
|
</nav>
|
||||||
<span id="tally"></span>
|
<span id="tally"></span>
|
||||||
</header>
|
</header>
|
||||||
<div id="banner"></div>
|
<div id="banner"></div>
|
||||||
<main>
|
<main id="main">
|
||||||
<h2>Photos</h2>
|
<h2 id="photos">Photos</h2>
|
||||||
<div id="dropzone">drop shelf photos here, or click to choose
|
<button id="dropzone" type="button">drop shelf photos here, or click to choose</button>
|
||||||
<input id="filepick" type="file" accept=".jpg,.jpeg,.png,.heic" multiple hidden>
|
<input id="filepick" type="file" accept=".jpg,.jpeg,.png,.heic" multiple hidden
|
||||||
</div>
|
aria-label="choose shelf photos">
|
||||||
|
|
||||||
<h2>Pipeline</h2>
|
<h2 id="pipeline">Pipeline</h2>
|
||||||
<div class="stages" id="stages"></div>
|
<div class="stages" id="stages"></div>
|
||||||
|
|
||||||
<h2>Activity</h2>
|
<h2 id="activity">Activity</h2>
|
||||||
<div id="jobstate">idle</div>
|
<div id="jobstate" aria-live="polite">idle</div>
|
||||||
<div id="joblog">(stage output appears here)</div>
|
<div id="joblog" aria-label="stage output">(stage output appears here)</div>
|
||||||
</main>
|
</main>
|
||||||
<script>
|
<script>
|
||||||
"use strict";
|
"use strict";
|
||||||
@@ -148,6 +43,7 @@ const esc = s => String(s ?? "").replace(/[&<>"']/g,
|
|||||||
c => ({"&":"&","<":"<",">":">",'"':""","'":"'"}[c]));
|
c => ({"&":"&","<":"<",">":">",'"':""","'":"'"}[c]));
|
||||||
|
|
||||||
function showBanner(html) { document.getElementById("banner").innerHTML = html; }
|
function showBanner(html) { document.getElementById("banner").innerHTML = html; }
|
||||||
|
document.getElementById("banner").setAttribute("role", "status");
|
||||||
|
|
||||||
async function runStage(stage, body) {
|
async function runStage(stage, body) {
|
||||||
const res = await fetch(`/api/run/${stage}`, {
|
const res = await fetch(`/api/run/${stage}`, {
|
||||||
@@ -179,11 +75,11 @@ function render() {
|
|||||||
const m = P.matches, log = P.upload_log;
|
const m = P.matches, log = P.upload_log;
|
||||||
const decided = (m.auto ?? 0) + (m.approved ?? 0);
|
const decided = (m.auto ?? 0) + (m.approved ?? 0);
|
||||||
document.getElementById("tally").innerHTML =
|
document.getElementById("tally").innerHTML =
|
||||||
`<span><b>${P.photos}</b> photos</span>
|
`<a href="#photos"><b>${P.photos}</b> photos</a>
|
||||||
<span><b>${P.titles}</b> titles</span>
|
<a href="/review#catalog"><b>${P.titles}</b> titles</a>
|
||||||
<span><b>${decided}</b> matched</span>
|
<a href="/review#catalog"><b>${decided}</b> matched</a>
|
||||||
<span><b>${P.pending_review}</b> to review</span>
|
<a href="/review"><b>${P.pending_review}</b> to review</a>
|
||||||
<span><b>${P.games}</b> enriched</span>`;
|
<a href="#pipeline"><b>${P.games}</b> enriched</a>`;
|
||||||
|
|
||||||
const banners = [];
|
const banners = [];
|
||||||
if (P.stub_data) banners.push(
|
if (P.stub_data) banners.push(
|
||||||
|
|||||||
@@ -3,239 +3,21 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>bggpipe review</title>
|
<title>bggpipe — review</title>
|
||||||
<link rel="icon" type="image/png" href="/static/favicon.png">
|
<link rel="icon" type="image/png" href="/static/favicon.png">
|
||||||
<style>
|
<link rel="stylesheet" href="/static/app.css">
|
||||||
:root {
|
|
||||||
--felt: #2c4136;
|
|
||||||
--felt-deep: #24362d;
|
|
||||||
--paper: #f7f4ec;
|
|
||||||
--paper-edge: #e6e0d2;
|
|
||||||
--ink: #24291f;
|
|
||||||
--ink-soft: #5c6355;
|
|
||||||
--brass: #c08f2f;
|
|
||||||
--brass-deep: #93691c;
|
|
||||||
--kraft: #efe4cd;
|
|
||||||
--approve: #3e6b4f;
|
|
||||||
--reject: #96473a;
|
|
||||||
--focus: #7fb08f;
|
|
||||||
}
|
|
||||||
* { box-sizing: border-box; }
|
|
||||||
html { background: var(--felt); }
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
||||||
color: var(--ink);
|
|
||||||
background:
|
|
||||||
radial-gradient(ellipse at 50% -20%, rgba(255,255,255,.06), transparent 60%),
|
|
||||||
var(--felt);
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
header {
|
|
||||||
position: sticky; top: 0; z-index: 5;
|
|
||||||
background: var(--felt-deep);
|
|
||||||
color: var(--paper);
|
|
||||||
padding: .45rem 1.2rem;
|
|
||||||
display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,.12);
|
|
||||||
}
|
|
||||||
.brand { display: flex; align-items: center; gap: .6rem; }
|
|
||||||
.brand img {
|
|
||||||
width: 38px; height: 38px; border-radius: 50%;
|
|
||||||
border: 2px solid var(--brass); object-fit: cover; display: block;
|
|
||||||
}
|
|
||||||
.wordmark {
|
|
||||||
font-family: "Iowan Old Style", Palatino, Georgia, serif;
|
|
||||||
font-size: 1.25rem; letter-spacing: .02em;
|
|
||||||
}
|
|
||||||
.wordmark small { opacity: .55; font-family: system-ui, sans-serif; font-size: .75rem; margin-left: .5rem; }
|
|
||||||
#tally { font-size: .85rem; opacity: .85; display: flex; gap: 1rem; }
|
|
||||||
#tally b { color: var(--brass); font-weight: 600; }
|
|
||||||
.keyhelp { margin-left: auto; font-size: .75rem; opacity: .6; }
|
|
||||||
kbd {
|
|
||||||
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
||||||
font-size: .72rem;
|
|
||||||
background: var(--paper);
|
|
||||||
color: var(--ink);
|
|
||||||
border: 1px solid var(--paper-edge);
|
|
||||||
border-bottom-width: 2px;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 0 .35em;
|
|
||||||
display: inline-block; min-width: 1.4em; text-align: center;
|
|
||||||
}
|
|
||||||
header kbd { background: rgba(255,255,255,.14); color: var(--paper); border-color: rgba(255,255,255,.25); }
|
|
||||||
main { max-width: 62rem; margin: 0 auto; padding: 1.4rem 1.2rem 6rem; }
|
|
||||||
#banner { max-width: 62rem; margin: 0 auto; padding: 0 1.2rem; }
|
|
||||||
.banner {
|
|
||||||
border-radius: 6px; padding: .6rem .9rem; margin-top: .9rem;
|
|
||||||
font-size: .85rem; line-height: 1.4;
|
|
||||||
}
|
|
||||||
.banner.error { background: #f6dcd6; border: 1px solid var(--reject); color: #6b2417; }
|
|
||||||
.banner.warn { background: var(--kraft); border: 1px solid var(--brass-deep); color: #6b5b33; }
|
|
||||||
h2 {
|
|
||||||
color: var(--paper);
|
|
||||||
font-family: "Iowan Old Style", Palatino, Georgia, serif;
|
|
||||||
font-weight: 500; font-size: 1.05rem; letter-spacing: .04em;
|
|
||||||
margin: 2rem 0 .8rem;
|
|
||||||
}
|
|
||||||
h2 .count { opacity: .6; font-size: .85rem; }
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background: var(--paper);
|
|
||||||
border-radius: 8px;
|
|
||||||
border-left: 6px solid transparent;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,.35);
|
|
||||||
padding: 1rem 1.1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
display: flex; gap: 1.1rem;
|
|
||||||
scroll-margin-top: 5rem;
|
|
||||||
}
|
|
||||||
.card.active {
|
|
||||||
border-left-color: var(--brass);
|
|
||||||
box-shadow: 0 6px 18px rgba(0,0,0,.45);
|
|
||||||
}
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
.card { transition: box-shadow .15s ease, border-color .15s ease; }
|
|
||||||
}
|
|
||||||
.shots { flex: 0 0 180px; display: flex; flex-direction: column; gap: .5rem; }
|
|
||||||
.shots img { width: 100%; border-radius: 4px; border: 1px solid var(--paper-edge); display: block; }
|
|
||||||
.shots .noshot {
|
|
||||||
color: var(--ink-soft); font-size: .8rem; border: 1px dashed var(--paper-edge);
|
|
||||||
border-radius: 4px; padding: 1.2rem .6rem; text-align: center;
|
|
||||||
}
|
|
||||||
.body { flex: 1; min-width: 0; }
|
|
||||||
.title { font-size: 1.15rem; font-weight: 650; margin: 0 0 .15rem; }
|
|
||||||
.status { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
|
|
||||||
.cues { margin: .5rem 0 .7rem; display: flex; flex-wrap: wrap; gap: .35rem; }
|
|
||||||
.cue {
|
|
||||||
font-size: .74rem; background: #eee9db; border: 1px solid var(--paper-edge);
|
|
||||||
border-radius: 999px; padding: .1rem .6rem; color: var(--ink);
|
|
||||||
}
|
|
||||||
.cue b { font-weight: 600; color: var(--ink-soft); }
|
|
||||||
.cands { list-style: none; margin: 0; padding: 0; }
|
|
||||||
.cands li {
|
|
||||||
display: flex; align-items: center; gap: .6rem;
|
|
||||||
padding: .4rem .5rem; border-radius: 6px; cursor: pointer;
|
|
||||||
}
|
|
||||||
.cands li:hover { background: #ede8da; }
|
|
||||||
.thumb { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; border: 1px solid var(--paper-edge); flex: 0 0 42px; }
|
|
||||||
.thumb.ph {
|
|
||||||
display: flex; align-items: center; justify-content: center;
|
|
||||||
background: var(--felt); color: var(--paper);
|
|
||||||
font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 1.2rem;
|
|
||||||
}
|
|
||||||
.cname { font-weight: 600; }
|
|
||||||
.cmeta { color: var(--ink-soft); font-size: .8rem; margin-left: .4rem; }
|
|
||||||
.rowactions { margin-top: .7rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: .85rem; }
|
|
||||||
.rowactions button {
|
|
||||||
font: inherit; border: 1px solid var(--paper-edge); background: #fff;
|
|
||||||
border-radius: 6px; padding: .25rem .7rem; cursor: pointer;
|
|
||||||
}
|
|
||||||
.rowactions button.reject { color: var(--reject); border-color: var(--reject); }
|
|
||||||
.rowactions input[type=text] {
|
|
||||||
font: inherit; width: 8.5em; padding: .25rem .5rem;
|
|
||||||
border: 1px solid var(--paper-edge); border-radius: 6px;
|
|
||||||
}
|
|
||||||
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
|
||||||
|
|
||||||
/* reshoot work-orders: deliberately not cards, tickets */
|
|
||||||
.ticket {
|
|
||||||
background: var(--kraft);
|
|
||||||
border: 2px dashed var(--brass-deep);
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: .8rem 1rem;
|
|
||||||
margin-bottom: .8rem;
|
|
||||||
display: flex; gap: 1rem; align-items: flex-start;
|
|
||||||
scroll-margin-top: 5rem;
|
|
||||||
}
|
|
||||||
.ticket.active { border-style: solid; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
|
|
||||||
.ticket .stencil {
|
|
||||||
writing-mode: vertical-rl; text-orientation: mixed;
|
|
||||||
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
||||||
font-size: .7rem; letter-spacing: .35em; font-weight: 700;
|
|
||||||
color: var(--brass-deep); text-transform: uppercase;
|
|
||||||
border-right: 1px solid var(--brass-deep); padding-right: .5rem;
|
|
||||||
}
|
|
||||||
.ticket img { width: 130px; border-radius: 3px; border: 1px solid var(--brass-deep); }
|
|
||||||
.ticket .loc { font-weight: 600; margin-bottom: .25rem; }
|
|
||||||
.ticket .partial { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; }
|
|
||||||
.ticket .notes { color: #6b5b33; font-size: .85rem; margin-top: .2rem; }
|
|
||||||
.ticket button {
|
|
||||||
font: inherit; font-size: .8rem; margin-top: .5rem;
|
|
||||||
background: none; border: 1px solid var(--brass-deep); color: var(--brass-deep);
|
|
||||||
border-radius: 6px; padding: .2rem .6rem; cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.done {
|
|
||||||
background: var(--paper); border-radius: 8px; padding: 1.6rem;
|
|
||||||
text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.4);
|
|
||||||
}
|
|
||||||
.done .piper {
|
|
||||||
height: 165px; margin-bottom: .4rem;
|
|
||||||
border-radius: 8px; border: 3px solid var(--felt);
|
|
||||||
}
|
|
||||||
.done h2 { color: var(--ink); margin-top: 0; }
|
|
||||||
.done .nums { display: flex; justify-content: center; gap: 2rem; margin: 1rem 0; }
|
|
||||||
.done .nums div { font-size: 1.6rem; font-weight: 700; }
|
|
||||||
.done .nums span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
|
|
||||||
.done code {
|
|
||||||
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
||||||
background: var(--felt); color: var(--paper);
|
|
||||||
padding: .3rem .8rem; border-radius: 6px;
|
|
||||||
display: inline-block; white-space: nowrap;
|
|
||||||
}
|
|
||||||
.done .waiting {
|
|
||||||
color: var(--brass-deep);
|
|
||||||
max-width: 34rem; margin: 1rem auto .2rem; line-height: 1.5;
|
|
||||||
}
|
|
||||||
.done .next { margin: .8rem 0 .2rem; }
|
|
||||||
|
|
||||||
/* catalog: read-only status ledger, quieter than decision cards */
|
|
||||||
.catalog { background: var(--paper); border-radius: 8px; padding: .4rem 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
|
|
||||||
.catalog table { width: 100%; border-collapse: collapse; font-size: .85rem; }
|
|
||||||
.catalog td { padding: .38rem .5rem; border-top: 1px solid var(--paper-edge); vertical-align: top; }
|
|
||||||
.catalog tr:first-child td { border-top: none; }
|
|
||||||
.catalog tr:hover td { background: #f0ebdd; }
|
|
||||||
.catalog .t { font-weight: 600; max-width: 22rem; }
|
|
||||||
.catalog .meta { color: var(--ink-soft); }
|
|
||||||
.catalog a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: underline dotted;
|
|
||||||
text-underline-offset: 2px;
|
|
||||||
}
|
|
||||||
.catalog a:hover { color: var(--brass-deep); }
|
|
||||||
.chip {
|
|
||||||
font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
|
|
||||||
border-radius: 999px; padding: .1rem .55rem; white-space: nowrap;
|
|
||||||
}
|
|
||||||
.chip.ok { background: #dfe9df; color: var(--approve); }
|
|
||||||
.chip.wait { background: #f3e7cd; color: var(--brass-deep); }
|
|
||||||
.chip.no { background: #f0ddd8; color: var(--reject); }
|
|
||||||
.chip.open { background: #e4e4ef; color: #4c4c78; }
|
|
||||||
.chip.merged { background: #e2e8e4; color: var(--felt-deep); }
|
|
||||||
|
|
||||||
/* merge notices: slim, undoable */
|
|
||||||
.card.merge { padding: .55rem 1rem; align-items: center; }
|
|
||||||
.card.merge .body { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
|
|
||||||
.card.merge .arrow { color: var(--ink-soft); }
|
|
||||||
.card.merge button {
|
|
||||||
font: inherit; font-size: .8rem; margin-left: auto;
|
|
||||||
background: none; border: 1px solid var(--paper-edge);
|
|
||||||
border-radius: 6px; padding: .2rem .6rem; cursor: pointer;
|
|
||||||
}
|
|
||||||
.card.merge button:hover { border-color: var(--reject); color: var(--reject); }
|
|
||||||
@media (max-width: 700px) {
|
|
||||||
.card, .ticket { flex-direction: column; }
|
|
||||||
.shots { flex-basis: auto; }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<a class="skip" href="#main">Skip to content</a>
|
||||||
<header>
|
<header>
|
||||||
<span class="brand">
|
<a class="brand" href="/">
|
||||||
<img src="/static/logo.jpg" alt="the bggpipe piper — a bagpiper whose bag is a board game box">
|
<img src="/static/logo.jpg" alt="the bggpipe piper — a bagpiper whose bag is a board game box">
|
||||||
<span class="wordmark">bggpipe <small>review</small></span>
|
<span class="wordmark">bggpipe <small>review</small></span>
|
||||||
</span>
|
</a>
|
||||||
|
<nav aria-label="Primary">
|
||||||
|
<a href="/">Dashboard</a>
|
||||||
|
<a href="/review" aria-current="page">Review</a>
|
||||||
|
</nav>
|
||||||
<span id="tally"></span>
|
<span id="tally"></span>
|
||||||
<span class="keyhelp">
|
<span class="keyhelp">
|
||||||
<kbd>j</kbd>/<kbd>k</kbd> move · <kbd>1</kbd>–<kbd>9</kbd> pick ·
|
<kbd>j</kbd>/<kbd>k</kbd> move · <kbd>1</kbd>–<kbd>9</kbd> pick ·
|
||||||
@@ -321,7 +103,8 @@ function thumbHtml(c) {
|
|||||||
|
|
||||||
function matchCard(row, idx) {
|
function matchCard(row, idx) {
|
||||||
const cands = row.candidates.map((c, i) => `
|
const cands = row.candidates.map((c, i) => `
|
||||||
<li data-pick="${c.bgg_id}" title="press ${i + 1}">
|
<li data-pick="${c.bgg_id}" title="press ${i + 1}" tabindex="0" role="button"
|
||||||
|
aria-label="pick ${esc(c.name)} (${esc(c.year ?? "year unknown")})">
|
||||||
<kbd>${i + 1}</kbd> ${thumbHtml(c)}
|
<kbd>${i + 1}</kbd> ${thumbHtml(c)}
|
||||||
<span><span class="cname">${esc(c.name)}</span>
|
<span><span class="cname">${esc(c.name)}</span>
|
||||||
<span class="cmeta">${esc(c.year ?? "—")} · ${esc(c.type || "?")}
|
<span class="cmeta">${esc(c.year ?? "—")} · ${esc(c.type || "?")}
|
||||||
@@ -347,7 +130,8 @@ function matchCard(row, idx) {
|
|||||||
|
|
||||||
function versionCard(row, idx) {
|
function versionCard(row, idx) {
|
||||||
const cands = row.candidates.map((v, i) => `
|
const cands = row.candidates.map((v, i) => `
|
||||||
<li data-pickver="${v.version_id}" title="press ${i + 1}">
|
<li data-pickver="${v.version_id}" title="press ${i + 1}" tabindex="0" role="button"
|
||||||
|
aria-label="pick ${esc(v.name)} (${esc(v.year ?? "year unknown")})">
|
||||||
<kbd>${i + 1}</kbd>
|
<kbd>${i + 1}</kbd>
|
||||||
<span><span class="cname">${esc(v.name)}</span>
|
<span><span class="cname">${esc(v.name)}</span>
|
||||||
<span class="cmeta">${esc(v.year ?? "—")} · ${esc((v.publishers || []).join(", "))}
|
<span class="cmeta">${esc(v.year ?? "—")} · ${esc((v.publishers || []).join(", "))}
|
||||||
@@ -393,12 +177,16 @@ function render() {
|
|||||||
const s = STATE;
|
const s = STATE;
|
||||||
showBanner((s.warnings || []).length
|
showBanner((s.warnings || []).length
|
||||||
? `<div class="banner warn">${s.warnings.map(esc).join("<br>")}</div>` : "");
|
? `<div class="banner warn">${s.warnings.map(esc).join("<br>")}</div>` : "");
|
||||||
|
const tallyItem = (n, label, anchor) => n
|
||||||
|
? `<a href="#${anchor}"><b>${n}</b> ${label}</a>`
|
||||||
|
: `<span><b>0</b> ${label}</span>`;
|
||||||
document.getElementById("tally").innerHTML =
|
document.getElementById("tally").innerHTML =
|
||||||
`<span><b>${s.pending.length}</b> matches</span>
|
`${tallyItem(s.pending.length, "matches", "matches")}
|
||||||
<span><b>${s.versions.length}</b> editions</span>
|
${tallyItem(s.versions.length, "editions", "editions")}
|
||||||
<span><b>${s.unidentified.length}</b> reshoot</span>
|
${tallyItem(s.unidentified.length, "reshoot", "reshoot")}
|
||||||
${s.merges.length ? `<span><b>${s.merges.length}</b> merged</span>` : ""}
|
${s.merges.length ? tallyItem(s.merges.length, "merged", "merges") : ""}
|
||||||
${s.summary.unresolved ? `<span><b>${s.summary.unresolved}</b> awaiting resolve</span>` : ""}
|
${s.summary.unresolved ? `<span><b>${s.summary.unresolved}</b> awaiting resolve</span>` : ""}
|
||||||
|
${tallyItem(s.catalog.length, "catalog", "catalog")}
|
||||||
<span>${s.decisions} decided this sitting</span>`;
|
<span>${s.decisions} decided this sitting</span>`;
|
||||||
|
|
||||||
let html = "";
|
let html = "";
|
||||||
@@ -426,15 +214,15 @@ function render() {
|
|||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
if (s.pending.length) {
|
if (s.pending.length) {
|
||||||
html += `<h2>Matches <span class="count">— pick the game each photo shows</span></h2>`;
|
html += `<h2 id="matches">Matches <span class="count">— pick the game each photo shows</span></h2>`;
|
||||||
html += s.pending.map(matchCard).join("");
|
html += s.pending.map(matchCard).join("");
|
||||||
}
|
}
|
||||||
if (s.versions.length) {
|
if (s.versions.length) {
|
||||||
html += `<h2>Editions <span class="count">— optional pass, never blocks uploads</span></h2>`;
|
html += `<h2 id="editions">Editions <span class="count">— optional pass, never blocks uploads</span></h2>`;
|
||||||
html += s.versions.map(versionCard).join("");
|
html += s.versions.map(versionCard).join("");
|
||||||
}
|
}
|
||||||
if (s.merges.length) {
|
if (s.merges.length) {
|
||||||
html += `<h2>Merges <span class="count">— duplicate reads folded into one game; veto if wrong</span></h2>`;
|
html += `<h2 id="merges">Merges <span class="count">— duplicate reads folded into one game; veto if wrong</span></h2>`;
|
||||||
html += s.merges.map(mg => `
|
html += s.merges.map(mg => `
|
||||||
<section class="card merge actionable" data-kind="merge"
|
<section class="card merge actionable" data-kind="merge"
|
||||||
data-rowix="${mg.row_ix}"
|
data-rowix="${mg.row_ix}"
|
||||||
@@ -449,7 +237,7 @@ function render() {
|
|||||||
</section>`).join("");
|
</section>`).join("");
|
||||||
}
|
}
|
||||||
if (s.unidentified.length) {
|
if (s.unidentified.length) {
|
||||||
html += `<h2>Reshoot <span class="count">— boxes seen but not identified</span></h2>`;
|
html += `<h2 id="reshoot">Reshoot <span class="count">— boxes seen but not identified</span></h2>`;
|
||||||
html += s.unidentified.map(ticket).join("");
|
html += s.unidentified.map(ticket).join("");
|
||||||
}
|
}
|
||||||
if (s.catalog.length) {
|
if (s.catalog.length) {
|
||||||
@@ -460,7 +248,7 @@ function render() {
|
|||||||
if (c.status === "merged") return `<span class="chip merged" title="merged into ${esc(c.merged_into)}">merged → ${esc(c.merged_into)}</span>`;
|
if (c.status === "merged") return `<span class="chip merged" title="merged into ${esc(c.merged_into)}">merged → ${esc(c.merged_into)}</span>`;
|
||||||
return `<span class="chip open">${esc(c.status)}</span>`;
|
return `<span class="chip open">${esc(c.status)}</span>`;
|
||||||
};
|
};
|
||||||
html += `<h2>Catalog <span class="count">— every title extracted so far (${s.catalog.length})</span></h2>
|
html += `<h2 id="catalog">Catalog <span class="count">— every title extracted so far (${s.catalog.length})</span></h2>
|
||||||
<div class="catalog"><table>` + s.catalog.map(c => `
|
<div class="catalog"><table>` + s.catalog.map(c => `
|
||||||
<tr>
|
<tr>
|
||||||
<td class="t">${esc(c.title_raw)}</td>
|
<td class="t">${esc(c.title_raw)}</td>
|
||||||
@@ -532,6 +320,11 @@ const vetoMerge = card => post("/api/veto-merge", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("keydown", e => {
|
document.addEventListener("keydown", e => {
|
||||||
|
if ((e.key === "Enter" || e.key === " ") && e.target.matches("[data-pick],[data-pickver]")) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.target.click();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.target.tagName === "INPUT") return;
|
if (e.target.tagName === "INPUT") return;
|
||||||
const cards = actionables();
|
const cards = actionables();
|
||||||
if (!cards.length) return;
|
if (!cards.length) return;
|
||||||
|
|||||||
@@ -508,6 +508,7 @@ def create_app(
|
|||||||
return FileResponse(cfg.photos_dir / name)
|
return FileResponse(cfg.photos_dir / name)
|
||||||
|
|
||||||
_STATIC = {
|
_STATIC = {
|
||||||
|
"app.css": "text/css",
|
||||||
"logo.jpg": "image/jpeg",
|
"logo.jpg": "image/jpeg",
|
||||||
"logo-full.jpg": "image/jpeg",
|
"logo-full.jpg": "image/jpeg",
|
||||||
"favicon.png": "image/png",
|
"favicon.png": "image/png",
|
||||||
|
|||||||
@@ -185,3 +185,32 @@ def test_dashboard_and_review_pages_serve(tmp_path):
|
|||||||
web = _app(_cfg(tmp_path))
|
web = _app(_cfg(tmp_path))
|
||||||
assert "Pipeline" in web.get("/").text
|
assert "Pipeline" in web.get("/").text
|
||||||
assert "bggpipe" in web.get("/review").text
|
assert "bggpipe" in web.get("/review").text
|
||||||
|
|
||||||
|
|
||||||
|
# -- design system + navigation -----------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def test_stylesheet_is_served_and_linked_by_both_pages(tmp_path):
|
||||||
|
web = _app(_cfg(tmp_path))
|
||||||
|
css = web.get("/static/app.css")
|
||||||
|
assert css.status_code == 200
|
||||||
|
assert css.headers["content-type"].startswith("text/css")
|
||||||
|
assert "--accent" in css.text # the token layer, not an empty file
|
||||||
|
for path in ("/", "/review"):
|
||||||
|
assert 'href="/static/app.css"' in web.get(path).text
|
||||||
|
|
||||||
|
|
||||||
|
def test_both_pages_carry_navigation_and_skip_link(tmp_path):
|
||||||
|
web = _app(_cfg(tmp_path))
|
||||||
|
for path, current in (("/", 'href="/"'), ("/review", 'href="/review"')):
|
||||||
|
html = web.get(path).text
|
||||||
|
assert 'nav aria-label="Primary"' in html
|
||||||
|
assert f'<a {current} aria-current="page"' in html.replace("\n", " ") or (
|
||||||
|
current in html and 'aria-current="page"' in html
|
||||||
|
)
|
||||||
|
assert 'class="skip"' in html
|
||||||
|
|
||||||
|
|
||||||
|
def test_activity_region_announces_politely(tmp_path):
|
||||||
|
html = _app(_cfg(tmp_path)).get("/").text
|
||||||
|
assert 'aria-live="polite"' in html
|
||||||
|
|||||||
Reference in New Issue
Block a user