Polish origins and guidelines

Add issue/magazine links and ordering to entry origins,
and document preferred validation guidance.

Signed-off-by: codex@lucy.xalior.com
This commit is contained in:
2026-01-10 18:18:20 +00:00
parent fb206734db
commit 06ddeba9bb
3 changed files with 38 additions and 6 deletions

View File

@@ -153,7 +153,10 @@ Comment what the code does, not what the agent has done. The documentation's pur
- Use imperative mood (e.g., "Add feature X", "Fix bug Y"). - Use imperative mood (e.g., "Add feature X", "Fix bug Y").
- Include relevant issue numbers if applicable. - Include relevant issue numbers if applicable.
- Sign-off commit message as <agent-name>@<hostname> - Sign-off commit message as <agent-name>@<hostname>
- validation and review:
- When changes are visual or UX-related, provide concrete links/routes to validate.
- Call out what to inspect visually (e.g., section names, table columns, empty states).
### References ### References
- ZXDB setup and API usage: `docs/ZXDB.md` - ZXDB setup and API usage: `docs/ZXDB.md`

View File

@@ -28,6 +28,7 @@ export type EntryDetailData = {
publication: string | null; publication: string | null;
containerId: number | null; containerId: number | null;
issueId: number | null; issueId: number | null;
issue: { id: number; magazineId: number | null; magazineTitle: string | null } | null;
date: { year: number | null; month: number | null; day: number | null }; date: { year: number | null; month: number | null; day: number | null };
}[]; }[];
// extra fields for richer details // extra fields for richer details
@@ -359,7 +360,7 @@ export default function EntryDetailClient({ data }: { data: EntryDetailData | nu
<th>Type</th> <th>Type</th>
<th>Title</th> <th>Title</th>
<th>Publication</th> <th>Publication</th>
<th style={{ width: 140 }}>Issue</th> <th style={{ width: 200 }}>Issue</th>
<th style={{ width: 140 }}>Date</th> <th style={{ width: 140 }}>Date</th>
</tr> </tr>
</thead> </thead>
@@ -375,10 +376,17 @@ export default function EntryDetailClient({ data }: { data: EntryDetailData | nu
<td>{o.libraryTitle}</td> <td>{o.libraryTitle}</td>
<td>{o.publication ?? <span className="text-secondary">-</span>}</td> <td>{o.publication ?? <span className="text-secondary">-</span>}</td>
<td> <td>
{o.issueId ? ( {o.issue ? (
<Link href={`/zxdb/issues/${o.issueId}`}>#{o.issueId}</Link> <div className="d-flex flex-column">
<Link href={`/zxdb/issues/${o.issue.id}`}>Issue #{o.issue.id}</Link>
{o.issue.magazineId != null && (
<Link className="text-secondary small" href={`/zxdb/magazines/${o.issue.magazineId}`}>
{o.issue.magazineTitle ?? `Magazine #${o.issue.magazineId}`}
</Link>
)}
</div>
) : o.containerId ? ( ) : o.containerId ? (
<span>#{o.containerId}</span> <span>Container #{o.containerId}</span>
) : ( ) : (
<span className="text-secondary">-</span> <span className="text-secondary">-</span>
)} )}

View File

@@ -305,6 +305,7 @@ export interface EntryDetail {
publication: string | null; publication: string | null;
containerId: number | null; containerId: number | null;
issueId: number | null; issueId: number | null;
issue: { id: number; magazineId: number | null; magazineTitle: string | null } | null;
date: { year: number | null; month: number | null; day: number | null }; date: { year: number | null; month: number | null; day: number | null };
}[]; }[];
// Additional entry fields for richer details // Additional entry fields for richer details
@@ -575,6 +576,8 @@ export async function getEntryById(id: number): Promise<EntryDetail | null> {
origintypeName: string | null; origintypeName: string | null;
containerId: number | string | null; containerId: number | string | null;
issueId: number | string | null; issueId: number | string | null;
magazineId: number | string | null;
magazineTitle: string | null;
dateYear: number | string | null; dateYear: number | string | null;
dateMonth: number | string | null; dateMonth: number | string | null;
dateDay: number | string | null; dateDay: number | string | null;
@@ -620,14 +623,25 @@ export async function getEntryById(id: number): Promise<EntryDetail | null> {
origintypeName: origintypes.name, origintypeName: origintypes.name,
containerId: searchByOrigins.containerId, containerId: searchByOrigins.containerId,
issueId: searchByOrigins.issueId, issueId: searchByOrigins.issueId,
magazineId: magazines.id,
magazineTitle: magazines.name,
dateYear: searchByOrigins.dateYear, dateYear: searchByOrigins.dateYear,
dateMonth: searchByOrigins.dateMonth, dateMonth: searchByOrigins.dateMonth,
dateDay: searchByOrigins.dateDay, dateDay: searchByOrigins.dateDay,
publication: searchByOrigins.publication, publication: searchByOrigins.publication,
}) })
.from(searchByOrigins) .from(searchByOrigins)
.leftJoin(issues, eq(issues.id, searchByOrigins.issueId))
.leftJoin(magazines, eq(magazines.id, issues.magazineId))
.leftJoin(origintypes, eq(origintypes.id, searchByOrigins.origintypeId)) .leftJoin(origintypes, eq(origintypes.id, searchByOrigins.origintypeId))
.where(eq(searchByOrigins.entryId, id)); .where(eq(searchByOrigins.entryId, id))
.orderBy(
asc(searchByOrigins.origintypeId),
desc(searchByOrigins.dateYear),
desc(searchByOrigins.dateMonth),
desc(searchByOrigins.dateDay),
asc(searchByOrigins.libraryTitle)
);
originRows = rows as typeof originRows; originRows = rows as typeof originRows;
} catch {} } catch {}
@@ -655,6 +669,13 @@ export async function getEntryById(id: number): Promise<EntryDetail | null> {
publication: o.publication ?? null, publication: o.publication ?? null,
containerId: o.containerId != null ? Number(o.containerId) : null, containerId: o.containerId != null ? Number(o.containerId) : null,
issueId: o.issueId != null ? Number(o.issueId) : null, issueId: o.issueId != null ? Number(o.issueId) : null,
issue: o.issueId != null
? {
id: Number(o.issueId),
magazineId: o.magazineId != null ? Number(o.magazineId) : null,
magazineTitle: o.magazineTitle ?? null,
}
: null,
date: { date: {
year: o.dateYear != null ? Number(o.dateYear) : null, year: o.dateYear != null ? Number(o.dateYear) : null,
month: o.dateMonth != null ? Number(o.dateMonth) : null, month: o.dateMonth != null ? Number(o.dateMonth) : null,