Clean up code found in the audit
- Replace every em-dash in src and server/src with a colon, comma or hyphen - Give every relative import its file extension (.jsx imports of .tsx fixed) - Delete old-historyMock.ts, unused exports, unused CSS utilities, the unused @ alias and the fallback option nothing passed - One copy each of initials, capitalize, byName and the server's marks() - Move the organization, chapter and event hooks from src/data to src/lib - Schema sync always throws on a mismatch (strict was never turned off) - Replace the placeholder README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4066e9ec61
commit
5274e09571
75 changed files with 282 additions and 688 deletions
|
|
@ -4,7 +4,7 @@
|
|||
Turns a timeline item into a destination and an image. Both were
|
||||
answered locally here before, which is how the timeline came to
|
||||
link events at /event/:id while the router only knew about
|
||||
/retreats/:id — two files holding the same opinion, one of them
|
||||
/retreats/:id, two files holding the same opinion, one of them
|
||||
wrong, neither aware of the other.
|
||||
|
||||
Now this file knows about timeline items and nothing else. Where
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
── The shape this reads, from history.js ──
|
||||
|
||||
item.href explicit link_url override, may be off-site
|
||||
item.ref { kind, id, orgKind? } — orgKind only on
|
||||
item.ref { kind, id, orgKind? }, orgKind only on
|
||||
organizations, because only they have it
|
||||
item.logo { file, kind } — v_timeline COALESCEs the
|
||||
item.logo { file, kind }, v_timeline COALESCEs the
|
||||
filename across five tables, so the kind is
|
||||
what says which directory it came from
|
||||
item.team { id, name, orgId? } on a team ref
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
Every one of those is optional. An entry is a standalone
|
||||
milestone until proven otherwise, and the two accessors below
|
||||
return null rather than assuming a shape that isn't there —
|
||||
return null rather than assuming a shape that isn't there,
|
||||
which is the other half of the /organizations/undefined bug:
|
||||
reaching into a ref that wasn't sent yields undefined, and
|
||||
undefined interpolates into a path perfectly happily.
|
||||
|
|
@ -44,7 +44,7 @@ import type { TimelineItem } from './timeline.ts'
|
|||
* Otherwise the reference decides, and refHref returns null for a
|
||||
* kind with no page yet ('person', until /people/:id exists) as
|
||||
* well as for a ref that didn't resolve. Null means the entry
|
||||
* renders as a plain <div> — right for a milestone, and right for
|
||||
* renders as a plain <div>, right for a milestone, and right for
|
||||
* a reference that's missing an id, which used to render as a link
|
||||
* to a 404.
|
||||
*/
|
||||
|
|
@ -67,7 +67,7 @@ export function logoSrc(item: TimelineItem): string | null {
|
|||
}
|
||||
|
||||
/**
|
||||
* A roster member's photo. Same rule as everywhere else — the API
|
||||
* A roster member's photo. Same rule as everywhere else, the API
|
||||
* sends a bare filename.
|
||||
*/
|
||||
export function photoSrc(photo?: string | null): string | null {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue