Section content types (ExperienceItem, EducationItem, and icon list items) are defined in two places with inconsistent fields, causing TypeScript incompatibilities.
types.ts (shared)
export interface ExperienceItem {
company: string;
title: string;
dates: string;
description: string[];
icon?: string; // string | undefined only
}
export interface EducationItem {
degree: string;
school: string;
year: string;
field_of_study?: string;
icon?: string; // string | undefined only
}
export interface IconListItem {
certification: string;
issuer: string;
date: string;
icon: string; // required, non-nullable
}
Component-local definitions
Each component defines its own version with extra fields:
ExperienceSection.tsx — local ExperienceItem:
- icon?: string | null (allows null)
- iconFile?: File | null (extra)
- iconBase64?: string | null (extra)
EducationSection.tsx — local EducationItem:
- icon?: string | null (allows null)
- iconFile?: File | null (extra)
- iconBase64?: string | null (extra)
IconListSection.tsx — local Certification:
- icon?: string | null (optional + nullable vs required)
- iconFile?: File | null (extra)
- iconBase64?: string | null (extra)
Impact
This type drift caused a build failure (TS2322) in SectionRenderer.tsx when the onUpdate callback was typed as Section['content']. The component-local types are not assignable to the types.ts union because of the null icon values and extra fields. Currently worked around with unknown typing in PR #245.
Proposed Solution
- Update types.ts to be the single source of truth — add iconFile, iconBase64, and allow null on icon fields
- Remove the duplicate local interfaces from ExperienceSection.tsx, EducationSection.tsx, and IconListSection.tsx — import from types.ts instead
- Update SectionRenderer.tsx onUpdate callback type from unknown back to Section['content']
- Verify all tests and build pass
Acceptance Criteria
- No duplicate type definitions for section content items
- All section content types imported from types.ts
- SectionRenderer.onUpdate uses Section['content'] (not unknown)
- npm run build passes
- npm test passes (all 1195+ tests)
Related
Section content types (ExperienceItem, EducationItem, and icon list items) are defined in two places with inconsistent fields, causing TypeScript incompatibilities.
Component-local definitions
Each component defines its own version with extra fields:
ExperienceSection.tsx — local ExperienceItem:
EducationSection.tsx — local EducationItem:
IconListSection.tsx — local Certification:
Impact
This type drift caused a build failure (TS2322) in SectionRenderer.tsx when the onUpdate callback was typed as Section['content']. The component-local types are not assignable to the types.ts union because of the null icon values and extra fields. Currently worked around with unknown typing in PR #245.
Proposed Solution
Acceptance Criteria
Related