From a2105766613970c39d617b1aef6ffe2f4eec4fb2 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 22 Nov 2026 11:42:50 -0700 Subject: [PATCH] Give needs-attention cards their text width back Look up again and Fix sat in the actions column and squeezed the title and reason to a character wide. They now sit on their own line under the reason, in a smaller button, and only the remove button stays at the right. Co-Authored-By: Claude Fable 5.2 --- src/web/components/BookRow.tsx | 11 ++++++++--- src/web/components/LookUpAgain.tsx | 2 +- src/web/styles.css | 5 ++++- src/web/views/LastScan.tsx | 5 +++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/web/components/BookRow.tsx b/src/web/components/BookRow.tsx index 02dcc7d..57d9bfd 100644 --- a/src/web/components/BookRow.tsx +++ b/src/web/components/BookRow.tsx @@ -1,17 +1,19 @@ import { displayAuthors } from '../../shared/names.ts'; +import type { ComponentChildren } from 'preact'; import type { Book } from '../../shared/types.ts'; import { rowState } from '../bookstate.ts'; import { CallNo } from './CallNo.tsx'; import { LookUpAgain } from './LookUpAgain.tsx'; import { StateMark, StateText } from './StateMark.tsx'; -function Main({ book, showYear }: { book: Book; showYear: boolean }) { +function Main({ book, showYear, children }: { book: Book; showYear: boolean; children?: ComponentChildren }) { const byline = [displayAuthors(book.authors).join(', '), showYear ? book.edition : null, showYear ? book.year : null].filter(Boolean).join(' · '); return ( {book.title} {byline ? {byline} : null} + {children} ); } @@ -23,9 +25,12 @@ export function QueueRow({ book, onFix, onRemove }: { book: Book; onFix: () => v
  • -
    +
    + {kind === 'attention' ? ( + + ) : null} +
    - {kind === 'attention' ? <> : null}
  • diff --git a/src/web/components/LookUpAgain.tsx b/src/web/components/LookUpAgain.tsx index aa2eed2..f1c0273 100644 --- a/src/web/components/LookUpAgain.tsx +++ b/src/web/components/LookUpAgain.tsx @@ -14,5 +14,5 @@ export function LookUpAgain({ book }: { book: Book }) { catch (e) { showError(`Could not look up "${book.title}" again: ${(e as Error).message}`); } setBusy(false); } - return ; + return ; } diff --git a/src/web/styles.css b/src/web/styles.css index a0b456f..0e1321e 100644 --- a/src/web/styles.css +++ b/src/web/styles.css @@ -87,6 +87,7 @@ ul { list-style: none; margin: 0; padding: 0; } border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: center; text-decoration: none; white-space: nowrap; } +.btn-sm { min-height: 28px; padding: 0 var(--space-3); font-size: var(--text-sm); } .btn:hover:not(:disabled) { background: var(--hover); } .btn:disabled { opacity: .55; cursor: default; } .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } @@ -235,9 +236,11 @@ main { max-width: var(--page-max); margin: 0 auto; padding: var(--space-6) var(- .row-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; } .row-sub { font-size: var(--text-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .state-text { font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; } -.state-looking { color: var(--muted); } +.state-looking { color: var(--muted); display: block; overflow: visible; } /* wraps in full: the retry note must not be cut off on a narrow row */ .state-attention { color: var(--warning); font-weight: 600; } .elapsed { font-variant-numeric: tabular-nums; } +.row-fixes { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); } +.last-fixes { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); } .row-actions { display: flex; align-items: center; gap: var(--space-1); } /* Call number: two monospaced lines in a fixed-width column */ diff --git a/src/web/views/LastScan.tsx b/src/web/views/LastScan.tsx index 78c6017..1c329ba 100644 --- a/src/web/views/LastScan.tsx +++ b/src/web/views/LastScan.tsx @@ -47,11 +47,12 @@ export function LastScan({ onFix }: { onFix: (id: number) => void }) { <> - - ) : null} + {s.kind === 'attention' ? ( +
    + ) : null} {already && s.kind !== 'looking' ? (
    Already in your library