Famous people: admin page, own prompt, one photo, public pages
CI / test (push) Successful in 2m21s
CI / build (push) Skipped
CI / deploy (push) Skipped

- Admin "Híres emberek": birth data, one photo (S3: DigitalOcean Spaces in
  production, RustFS in development), a face point that every crop keeps
  in view, publishing, and a detailed portrait written with its own
  `celebrity` prompt (third person, by name, from the chart alone).
- The photo is stored once (upright JPEG, at most 2000 px, no metadata);
  next/image makes the sizes from it, so Cloudflare can cache those.
- Public list and pages (/hires-emberek), in the sitemap, with a share
  image showing the face and the chart.
- Share images: the wheel's glyphs and numbers are drawn with the card's
  fonts (inside the SVG image they came out as boxes, on every card).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-22 16:08:35 +00:00
co-authored by Claude Opus 5.5
parent 13e22a9c7d
commit 37cb0abf4b
47 changed files with 3008 additions and 77 deletions
+23 -2
View File
@@ -20,15 +20,33 @@ const ERRORS: Record<string, string> = {
/** Someone else's chart: added with a name, or (with `chartId`) corrected. */
export type PersonTarget = { chartId?: string; name?: string };
/** The birth data the form sends (as `POST /v1/charts` takes it). */
export type BirthInput = {
date: string;
time?: string;
country: string;
geonames_id: number;
ambiguous_time?: Ambiguity;
};
export function BirthForm({
initial,
person,
save,
children,
onCancel,
onSaved,
}: {
initial: Initial;
/** Not given: the user's own birth data. */
person?: PersonTarget;
/**
* Saves somewhere else than the user's charts (e.g. a famous person); gets
* the birth data only when it changed. Its errors show in the form.
*/
save?: (name: string, birth: BirthInput | null) => Promise<{ id: string }>;
/** More fields, after the name. */
children?: React.ReactNode;
onCancel?: () => void;
onSaved: (chartId: string) => void;
}) {
@@ -105,7 +123,7 @@ export function BirthForm({
if (!place) return setError("Válaszd ki a születési helyet a listából.");
setBusy(true);
try {
const birth = {
const birth: BirthInput = {
date,
...(timeUnknown ? {} : { time }),
country,
@@ -121,7 +139,9 @@ export function BirthForm({
(timeUnknown ? null : time) !== (initial.time?.slice(0, 5) ?? null) ||
country !== (initial.country ?? "HU") ||
place.geonames_id !== initial.geonames_id;
const saved = person?.chartId
const saved = save
? await save(name.trim(), birthChanged ? birth : null)
: person?.chartId
? await api<{ id: string }>(`/charts/${person.chartId}`, {
method: "PATCH",
body: birthChanged ? { label: name.trim(), birth } : { label: name.trim() },
@@ -172,6 +192,7 @@ export function BirthForm({
/>
</div>
)}
{children}
<div className="grid-2">
<fieldset className="field birth-fields">
<legend className="label">Születési dátum</legend>