Edit plays page by page, with a review of uncertain words

The editor shows one original page next to its photo, with a page list,
page number and missing toggle, and highlights {uncertain} words. The
review dialog steps through them with the photo zoomed to about the
right line. Pages can be re-read from their photo or added from a new
photo, which fills a !N missing marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
This commit is contained in:
agent 2026-11-04 16:15:27 +00:00
parent 6240907809
commit debf1aa8bc
5 changed files with 679 additions and 152 deletions

View file

@ -290,7 +290,7 @@ button.link { border: 0; background: none; padding: 0; font: inherit; color: var
.play-meta { font-size: 12.5px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--hl); color: var(--fg); vertical-align: 2px; }
dialog.login { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); padding: 20px; width: min(380px, calc(100vw - 32px)); }
dialog.login { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); padding: 20px; width: min(400px, calc(100vw - 32px)); }
dialog.login h2 { margin: 0 0 8px; font-size: 18px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
@ -320,31 +320,144 @@ form.busy .dropzone, form.busy .thumb-tools { pointer-events: none; opacity: 0.6
.meta-row .grow { flex: 1 1 260px; }
.field.toggle { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.field.toggle span { margin: 0; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr); gap: 16px; align-items: start; }
.editor textarea {
height: calc(100vh - 230px);
min-height: 360px;
font-family: "Courier Prime", ui-monospace, monospace;
font-size: 15px;
line-height: 1.45;
resize: vertical;
tab-size: 4;
.field.toggle input { accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.notice { background: var(--hl); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
button.quiet:hover { color: var(--accent); }
/* login dialog */
dialog.login .field { margin-bottom: 12px; }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 44px; }
.pw-field input[aria-invalid] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pw-field .eye {
position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
display: grid; place-items: center; width: 36px; height: 32px; padding: 0;
border: 0; background: transparent; color: var(--muted);
}
.editor-side { position: sticky; top: 12px; display: grid; gap: 14px; }
.photo-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.photo-nav span { flex: 1; text-align: center; color: var(--muted); }
.photo-nav button { padding: 4px 10px; font-size: 13px; }
.photo img { display: block; width: 100%; max-height: calc(100vh - 330px); object-fit: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.checks h2 { font-size: 16px; margin: 0 0 4px; }
.checks ul { margin: 6px 0 10px; padding-left: 18px; max-height: 220px; overflow-y: auto; font-size: 14px; }
.pw-field .eye:hover, .pw-field .eye[aria-pressed="true"] { color: var(--accent); }
dialog.login .check { margin: 2px 0 4px; font-size: 14.5px; }
dialog.login .error { margin: 10px 0 0; font-size: 14px; }
dialog.login .actions { margin-top: 16px; }
/* editor */
.review-bar {
display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
margin: 4px 0 12px; padding: 10px 14px; border-radius: 10px;
background: var(--hl); border: 1px solid var(--hl-edge);
}
.review-bar span { flex: 1; font-weight: 600; }
details.checks { margin: 0 0 14px; font-size: 14px; }
details.checks summary { cursor: pointer; }
details.checks ul { margin: 6px 0 10px; padding-left: 18px; max-height: 220px; overflow-y: auto; }
.editor {
display: grid;
grid-template-columns: 88px minmax(0, 1fr) minmax(0, 1.1fr);
gap: 16px;
align-items: start;
}
.editor.no-photos { grid-template-columns: 88px minmax(0, 1fr); }
.editor.busy { opacity: 0.5; pointer-events: none; }
.page-list { position: sticky; top: 12px; display: grid; gap: 8px; }
.page-list ol {
list-style: none; margin: 0; padding: 0;
display: grid; gap: 4px; max-height: calc(100vh - 140px); overflow-y: auto;
}
.page-list ol button {
position: relative; width: 100%; padding: 6px 4px; font-size: 14px; text-align: center;
display: flex; justify-content: center; align-items: center; gap: 4px;
}
.page-list ol button.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.page-list ol button.missing { border-style: dashed; color: var(--muted); font-weight: 400; }
.page-list ol button.failed { border-color: var(--accent); }
.page-list .count {
min-width: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; line-height: 18px;
background: var(--hl); color: var(--fg); border: 1px solid var(--hl-edge);
}
.page-list .count.bad { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-list-tools { display: grid; gap: 4px; }
.page-list-tools > * { padding: 6px 4px; font-size: 13px; text-align: center; }
.page-list-tools .busy { opacity: 0.6; pointer-events: none; }
.page-photo { position: sticky; top: 12px; }
.photo-frame {
max-height: calc(100vh - 80px); overflow: auto; cursor: zoom-in;
background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.photo-frame img { display: block; width: 100%; height: auto; }
.photo-frame.zoomed { cursor: zoom-out; }
.photo-frame.zoomed img { width: 220%; max-width: none; }
.photo-empty { padding: 48px 16px; text-align: center; margin: 0; }
.photo-pick { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.photo-pick select { width: auto; padding: 2px 6px; }
.page-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head .grow { flex: 1; }
.page-head > button { padding: 6px 10px; font-size: 14px; }
.page-num { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.page-num input { width: 5.5em; padding: 5px 8px; font-weight: 700; text-align: center; }
.page-head .check { font-size: 14px; color: var(--muted); }
.dup-note { margin-bottom: 8px; padding: 8px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.missing-hint { padding: 24px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
/* textarea over a layer that paints the {uncertain} words; both must wrap identically */
.hl-wrap { position: relative; }
.hl-back, .hl-wrap textarea {
margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
font-family: "Courier Prime", ui-monospace, monospace; font-size: 15px; line-height: 1.5;
white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; letter-spacing: 0;
}
.hl-back { position: absolute; inset: 0; color: transparent; border-color: transparent; pointer-events: none; overflow: hidden; }
.hl-back mark { color: transparent; background: var(--hl); border-radius: 3px; box-shadow: 0 0 0 1px var(--hl-edge); }
.hl-wrap textarea {
position: relative; display: block; width: 100%; min-height: 320px;
background: transparent; color: var(--fg); resize: none; overflow: hidden;
}
.hl-wrap { background: var(--bg); border-radius: 8px; }
.help { font-size: 14px; margin-top: 8px; }
.help td { padding: 2px 10px 2px 0; vertical-align: top; }
.danger { margin-top: 32px; }
.danger button { color: var(--accent); border-color: var(--accent); background: transparent; }
@media (max-width: 900px) {
.editor { grid-template-columns: minmax(0, 1fr); }
.editor-side { position: static; order: -1; }
.photo img { max-height: 60vh; }
.editor textarea { height: 70vh; }
/* review of uncertain words */
dialog.review {
width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0;
border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg);
}
.review-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); min-height: min(640px, calc(100vh - 26px)); }
.review-photo { position: relative; overflow: auto; background: var(--panel); border-right: 1px solid var(--line); max-height: calc(100vh - 26px); }
.review-photo img { display: block; width: 180%; max-width: none; }
.review-band { position: absolute; left: 0; width: 180%; background: rgba(224, 180, 0, 0.18); border-block: 2px solid var(--hl-edge); pointer-events: none; }
.review-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.review-top { display: flex; align-items: center; justify-content: space-between; }
.review-top h2 { margin: 0; font-size: 18px; }
.review-context {
font-family: "Courier Prime", ui-monospace, monospace; font-size: 15px; line-height: 1.6;
padding: 10px 12px; border-radius: 8px; background: var(--panel); overflow-wrap: anywhere;
}
.ctx-line { color: var(--muted); }
.ctx-line.main { color: var(--fg); }
.review-context mark { background: var(--hl); color: var(--fg); padding: 0 2px; border-radius: 3px; box-shadow: 0 0 0 2px var(--hl-edge); }
#review-fix { font-size: 18px; font-family: "Courier Prime", ui-monospace, monospace; }
.review-alts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { padding: 4px 10px; border-radius: 999px; font-family: "Courier Prime", ui-monospace, monospace; font-weight: 400; }
.review-card .actions { margin-top: 6px; }
#review-item, #review-done { display: flex; flex-direction: column; gap: 10px; }
#review-item[hidden], #review-done[hidden] { display: none; }
@media (max-width: 1000px) {
.editor, .editor.no-photos { grid-template-columns: minmax(0, 1fr); }
.page-list { position: static; }
.page-list ol { display: flex; overflow-x: auto; max-height: none; padding-bottom: 4px; }
.page-list ol button { min-width: 48px; }
.page-list-tools { display: flex; }
.page-photo { position: static; }
.photo-frame { max-height: 60vh; }
.review-grid { grid-template-columns: minmax(0, 1fr); }
.review-photo { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
}
/* ---- PDF export (print) ----