1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-22 03:05:32 +02:00

feat: browser capture button (Track 4)

- Add archivr-core/src/capture.rs: Source enum, all capture helpers,
  fail_run (replaces process::exit fail_archive_and_exit), and
  perform_capture() as the public entry point
- Slim archivr-cli/src/main.rs to 103 lines: thin adapter over
  archivr_core::capture::perform_capture
- Move all source-classification and tweet-entry tests from CLI to
  archivr-core/src/capture.rs (they test core logic, belong in core)
- Add POST /api/archives/:archive_id/captures route in archivr-server:
  validates non-empty locator (400), resolves archive (404), delegates
  to perform_capture, returns {run_uid, status}
- Add capture dialog to browser UI: dialog markup in index.html,
  showModal/submit/cancel/loading/error wiring in app.js, dialog
  styles in styles.css
- 77 tests pass, clean build (0 warnings)
This commit is contained in:
TheGeneralist 2026-06-22 22:18:44 +02:00
parent b70ab4945e
commit 8d0352c2c4
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
7 changed files with 1415 additions and 1227 deletions

View file

@ -496,3 +496,93 @@ select {
.tag-filter-badge:hover {
opacity: 0.85;
}
/* Capture dialog */
.capture-dialog {
border: 2px solid var(--ink);
background: var(--paper);
padding: 0;
min-width: 360px;
max-width: 520px;
box-shadow: 4px 4px 0 var(--ink);
}
.capture-dialog::backdrop {
background: rgba(0, 0, 0, 0.45);
}
.capture-dialog-inner {
padding: 28px;
}
.capture-dialog-title {
margin: 0 0 16px;
font-size: 18px;
font-family: Georgia, "Times New Roman", serif;
}
.capture-label {
display: block;
font-size: 13px;
font-weight: 600;
margin-bottom: 6px;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.04em;
}
.capture-input {
width: 100%;
height: 42px;
border: 2px solid var(--ink);
background: var(--paper-3);
color: var(--ink);
padding: 0 12px;
font-size: 15px;
margin-bottom: 10px;
outline-offset: 3px;
}
.capture-error {
color: var(--accent);
font-size: 13px;
margin-bottom: 10px;
min-height: 18px;
}
.capture-actions {
display: flex;
gap: 10px;
justify-content: flex-end;
margin-top: 16px;
}
.capture-cancel {
border: 1px solid var(--line);
background: none;
color: var(--ink);
padding: 8px 18px;
cursor: pointer;
}
.capture-cancel:hover {
background: var(--paper-2);
}
.capture-submit {
border: 0;
background: var(--ink);
color: var(--paper);
padding: 8px 20px;
cursor: pointer;
font-weight: 600;
}
.capture-submit:hover {
opacity: 0.85;
}
.capture-submit:disabled {
opacity: 0.45;
cursor: default;
}