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:
@@ -153,6 +153,9 @@ 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").
|
||||
- Include relevant issue numbers if applicable.
|
||||
- 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
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ export type EntryDetailData = {
|
||||
publication: string | null;
|
||||
containerId: 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 };
|
||||
}[];
|
||||
// extra fields for richer details
|
||||
@@ -359,7 +360,7 @@ export default function EntryDetailClient({ data }: { data: EntryDetailData | nu
|
||||
<th>Type</th>
|
||||
<th>Title</th>
|
||||
<th>Publication</th>
|
||||
<th style={{ width: 140 }}>Issue</th>
|
||||
<th style={{ width: 200 }}>Issue</th>
|
||||
<th style={{ width: 140 }}>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -375,10 +376,17 @@ export default function EntryDetailClient({ data }: { data: EntryDetailData | nu
|
||||
<td>{o.libraryTitle}</td>
|
||||
<td>{o.publication ?? <span className="text-secondary">-</span>}</td>
|
||||
<td>
|
||||
{o.issueId ? (
|
||||
<Link href={`/zxdb/issues/${o.issueId}`}>#{o.issueId}</Link>
|
||||
{o.issue ? (
|
||||
<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 ? (
|
||||
<span>#{o.containerId}</span>
|
||||
<span>Container #{o.containerId}</span>
|
||||
) : (
|
||||
<span className="text-secondary">-</span>
|
||||
)}
|
||||
|
||||
@@ -305,6 +305,7 @@ export interface EntryDetail {
|
||||
publication: string | null;
|
||||
containerId: 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 };
|
||||
}[];
|
||||
// Additional entry fields for richer details
|
||||
@@ -575,6 +576,8 @@ export async function getEntryById(id: number): Promise<EntryDetail | null> {
|
||||
origintypeName: string | null;
|
||||
containerId: number | string | null;
|
||||
issueId: number | string | null;
|
||||
magazineId: number | string | null;
|
||||
magazineTitle: string | null;
|
||||
dateYear: number | string | null;
|
||||
dateMonth: number | string | null;
|
||||
dateDay: number | string | null;
|
||||
@@ -620,14 +623,25 @@ export async function getEntryById(id: number): Promise<EntryDetail | null> {
|
||||
origintypeName: origintypes.name,
|
||||
containerId: searchByOrigins.containerId,
|
||||
issueId: searchByOrigins.issueId,
|
||||
magazineId: magazines.id,
|
||||
magazineTitle: magazines.name,
|
||||
dateYear: searchByOrigins.dateYear,
|
||||
dateMonth: searchByOrigins.dateMonth,
|
||||
dateDay: searchByOrigins.dateDay,
|
||||
publication: searchByOrigins.publication,
|
||||
})
|
||||
.from(searchByOrigins)
|
||||
.leftJoin(issues, eq(issues.id, searchByOrigins.issueId))
|
||||
.leftJoin(magazines, eq(magazines.id, issues.magazineId))
|
||||
.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;
|
||||
} catch {}
|
||||
|
||||
@@ -655,6 +669,13 @@ export async function getEntryById(id: number): Promise<EntryDetail | null> {
|
||||
publication: o.publication ?? null,
|
||||
containerId: o.containerId != null ? Number(o.containerId) : 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: {
|
||||
year: o.dateYear != null ? Number(o.dateYear) : null,
|
||||
month: o.dateMonth != null ? Number(o.dateMonth) : null,
|
||||
|
||||
Reference in New Issue
Block a user