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 <noreply@anthropic.com>
This commit is contained in:
1 parent
e65b10c0fb
commit
a210576661
4 files changed
+16
-7
No files matched your search
@@ -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 (
|
||||
<span class="row-main">
|
||||
<span class="row-title">{book.title}</span>
|
||||
{byline ? <span class="row-sub">{byline}</span> : null}
|
||||
<StateText book={book} />
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -23,9 +25,12 @@ export function QueueRow({ book, onFix, onRemove }: { book: Book; onFix: () => v
|
||||
<li class={'row row-queue row-' + kind} data-book-id={book.id}>
|
||||
<StateMark book={book} />
|
||||
<CallNo value={kind === 'looking' ? null : book.callNumber} approximate={book.confidence === 'approximate'} source={book.source} />
|
||||
<Main book={book} showYear={false} />
|
||||
<Main book={book} showYear={false}>
|
||||
{kind === 'attention' ? (
|
||||
<span class="row-fixes"><LookUpAgain book={book} /><button type="button" class="btn btn-sm" onClick={onFix}>Fix</button></span>
|
||||
) : null}
|
||||
</Main>
|
||||
<span class="row-actions">
|
||||
{kind === 'attention' ? <><LookUpAgain book={book} /><button type="button" class="btn" onClick={onFix}>Fix</button></> : null}
|
||||
<button type="button" class="btn-icon" onClick={onRemove} aria-label={`Remove "${book.title}"`} title="Remove">×</button>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
@@ -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 <button type="button" class="btn" disabled={busy} onClick={() => void again()}>Look up again</button>;
|
||||
return <button type="button" class="btn btn-sm" disabled={busy} onClick={() => void again()}>Look up again</button>;
|
||||
}
|
||||
+4
-1
@@ -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 */
|
||||
|
||||
@@ -47,11 +47,12 @@ export function LastScan({ onFix }: { onFix: (id: number) => void }) {
|
||||
<>
|
||||
<span class="last-mark last-attention" aria-hidden="true"><WarnIcon /></span>
|
||||
<StateText book={book} />
|
||||
<LookUpAgain book={book} />
|
||||
<button type="button" class="btn" onClick={() => onFix(book.id)}>Fix</button>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
{s.kind === 'attention' ? (
|
||||
<div class="last-fixes"><LookUpAgain book={book} /><button type="button" class="btn btn-sm" onClick={() => onFix(book.id)}>Fix</button></div>
|
||||
) : null}
|
||||
{already && s.kind !== 'looking' ? (
|
||||
<div class="last-already">
|
||||
<span>Already in your library</span>
|
||||
|
||||
Reference in new issue
Block a user