From e518a03a938695a0ce9c670f81b12037ea28ee24 Mon Sep 17 00:00:00 2001 From: Danial Beg Date: Sun, 1 Nov 2026 20:04:13 -0800 Subject: [PATCH] Give Application Tracking's Overview its rounds and a guide Under the list's map, as Financial Aid's Overview has the FAFSA and CSS Profile: Early and Regular Decision boxes with the usual dates in the student's cycle and where their list sits in each, a grade priority, and "Know your application" rows (where you apply, what goes in, rounds, fees and waivers) that open onto Application 101's articles. Financial Aid's guide rows, date box and callout move to moduleUI so both modules share them. --- web/src/components/AidGuideSections.tsx | 114 ++--------- .../ApplicationGuideSections.test.tsx | 59 ++++++ .../components/ApplicationGuideSections.tsx | 186 ++++++++++++++++++ .../components/ApplicationTrackingModule.tsx | 39 +++- web/src/components/FinancialAidModule.tsx | 43 +--- web/src/components/ModuleOverviewTab.tsx | 5 +- web/src/components/moduleUI.tsx | 137 +++++++++++++ web/src/data/applicationDeadlines.ts | 2 +- 8 files changed, 438 insertions(+), 147 deletions(-) create mode 100644 web/src/components/ApplicationGuideSections.test.tsx create mode 100644 web/src/components/ApplicationGuideSections.tsx diff --git a/web/src/components/AidGuideSections.tsx b/web/src/components/AidGuideSections.tsx index 49a0b4a..d753981 100644 --- a/web/src/components/AidGuideSections.tsx +++ b/web/src/components/AidGuideSections.tsx @@ -3,7 +3,7 @@ import { C, MODULE_COLORS } from '../lib/designTokens' import { fetchAllGuarantees, type AidGuarantee, type GuaranteeList } from '../lib/aidColleges' import { formatCollegeDate, parseIsoDay } from '../data/applicationDeadlines' import { US_STATES } from '../lib/fafsaData' -import { SecLabel } from './moduleUI' +import { EdvifiCan, ExtLink, GuideIntro as Intro, GuideItem as Item, GuideRow, SecLabel } from './moduleUI' import { AID_FACTS_AS_OF, guaranteeLabel, @@ -56,40 +56,6 @@ const SANS = "'Outfit',sans-serif" export type AidGuideDestination = 'fafsa' | 'scholarships' | 'scholarship-search' -const Chevron = () => ( - -) - -const ExtLink = ({ href, children, color = MC }: { href: string; children: ReactNode; color?: string }) => ( - - {children} ↗ - -) - -/** One entry inside an open row: name and figure on top, the explanation under it. */ -const Item = ({ title, figure, children, links, color = MC, chip }: { - title: string - figure?: string - children: ReactNode - links?: ReactNode - color?: string - /** Render the title as a colored chip instead of bold text. */ - chip?: boolean -}) => ( -
-
-
- {chip - ? {title} - : {title}} - {figure && · {figure}} -
-
{children}
-
- {links &&
{links}
} -
-) - const ProgramItem = ({ p, color }: { p: AidProgram; color: string }) => ( ( ) -/** "Edvifi can ___" — one line at the foot of a row, pointing at the tool that does it. */ -const EdvifiCan = ({ can, cta, onClick, color = MC }: { can: string; cta: string; onClick: () => void; color?: string }) => ( - // A quiet tinted strip rather than a banner: it should read as the next step, - // not as an ad, but still be the first thing the eye lands on at the bottom. -
- - - Edvifi can {can} - - -
-) - -/** A collapsible row in the same shape as the checklist sections below it. */ -const Row = ({ kind, title, summary, tag, open, onToggle, children }: { - kind: keyof typeof ROWS - title: string - summary: string - tag?: string - open: boolean - onToggle: () => void - children: ReactNode -}) => { - const { color, icon } = ROWS[kind] - const [hover, setHover] = useState(false) - const edge = open || hover ? `${color}45` : C.border - return ( - // Longhands only. Mixing the `border` shorthand with `borderLeft` lets React - // re-apply the shorthand on toggle and wipe the colored edge. -
- - {open &&
{children}
} -
- ) -} - -const Intro = ({ children }: { children: ReactNode }) => ( -

{children}

-) - export type GuideRowId = 'big' | 'uni' | 'state' | 'types' interface Props { @@ -209,13 +117,13 @@ export default function AidGuideSections({ homeState, yourSchools, listFailed, o
Know your aid - toggle('big')}> + toggle('big')}> {MAJOR_PROGRAMS.map((p) => )} onGoTo('fafsa')} /> - + - )} - + - ) : otherGrants.map(grantItem)} onGoTo('scholarships')} /> - + - toggle('types')}> + toggle('types')}> {SCHOLARSHIP_CATEGORIES.map((c) => {c.description} {c.example}.)} onGoTo('scholarship-search')} /> - +

Amounts are for {AID_FACTS_AS_OF} and change every year. Confirm on the official site. diff --git a/web/src/components/ApplicationGuideSections.test.tsx b/web/src/components/ApplicationGuideSections.test.tsx new file mode 100644 index 0000000..c5b6585 --- /dev/null +++ b/web/src/components/ApplicationGuideSections.test.tsx @@ -0,0 +1,59 @@ +import { describe, it, expect, vi } from 'vitest' +import { render, screen } from '@testing-library/react' +import userEvent from '@testing-library/user-event' +import ApplicationGuideSections, { ApplicationRounds } from './ApplicationGuideSections' +import type { ApplicationEntry } from '../data/applicationsChecklist' + +vi.mock('../lib/supabase', () => ({ supabase: {} })) + +const app = (name: string, over: Partial = {}): ApplicationEntry => ({ + collegeId: `test-${name}`, name, category: 'reach', deadlineType: 'RD', status: 'not-started', ...over, +}) +const apps = [ + app('Duke', { deadlineType: 'ED', customDeadline: '2099-11-01', applicationFeeCents: 8500 }), + app('UNC', { customDeadline: '2099-01-15', applicationFeeCents: 0 }), + app('Elon', { customDeadline: '2099-01-10', applicationFeeCents: 6000 }), + app('Wake Tech', { deadlineType: 'Rolling', institutionType: '2yr' }), + app('Rice', { deadlineType: 'EA', status: 'submitted', applicationFeeCents: 7500 }), +] + +describe('ApplicationRounds', () => { + it('places the schools still to send in each round', async () => { + const onSeeSchools = vi.fn() + render() + expect(screen.getByText('Applying early to 1 school: Duke, Nov 1, 2099')).toBeInTheDocument() + expect(screen.getByText('2 schools in Regular Decision; Elon is first, Jan 10, 2099; 1 more is rolling')).toBeInTheDocument() + await userEvent.click(screen.getByRole('button', { name: /^Regular Decision/ })) + expect(onSeeSchools).toHaveBeenCalledOnce() + }) + + it('points an empty list at Discover', () => { + render( {}} />) + expect(screen.getAllByText('Add schools in Discover to see where yours fall')).toHaveLength(2) + }) + + it('says an early application is in rather than missing', () => { + render( a.name !== 'Duke')} gradeStartIdx={null} onSeeSchools={() => {}} />) + expect(screen.getByText('Your early application is in')).toBeInTheDocument() + }) +}) + +describe('ApplicationGuideSections', () => { + it('sums up the list and opens onto Application 101', async () => { + const onRead = vi.fn() + render( {}} />) + // Rice is in, so its fee is off the bill; Wake Tech has none on file. + expect(screen.getByText('Your list: $145 for 2 schools, 1 free, 1 not on file')).toBeInTheDocument() + expect(screen.getByText('On your list: 1 ED, 1 EA, 2 RD, 1 rolling')).toBeInTheDocument() + + await userEvent.click(screen.getByRole('button', { name: /^Application rounds/ })) + expect(screen.getByText('2 on your list', { exact: false })).toBeInTheDocument() + await userEvent.click(screen.getByRole('button', { name: /Should I apply ED/ })) + expect(onRead).toHaveBeenCalledWith('as-2') + }) + + it('leaves fees general until one is on file', () => { + render( {}} onSeeSchools={() => {}} />) + expect(screen.getByText('Many schools are free, and a waiver covers the rest for many families')).toBeInTheDocument() + }) +}) diff --git a/web/src/components/ApplicationGuideSections.tsx b/web/src/components/ApplicationGuideSections.tsx new file mode 100644 index 0000000..b058cca --- /dev/null +++ b/web/src/components/ApplicationGuideSections.tsx @@ -0,0 +1,186 @@ +/** + * Application Tracking's Overview, under the list. Financial Aid's Overview + * has the FAFSA and CSS Profile dates and its guide rows; this one has the + * application rounds and what an application asks for. The articles stay in + * Application 101: these rows sum up and point there. + */ +import { useState, type ReactNode } from 'react' +import { C } from '../lib/designTokens' +import { DateBox, EdvifiCan, ExtLink, GuideIntro, GuideItem, GuideRow, SecLabel } from './moduleUI' +import { DEADLINE_TYPES, type AppDeadlineType, type ApplicationEntry } from '../data/applicationsChecklist' +import { + DEADLINE_TYPE_COLOR, + DEADLINE_TYPE_LABEL, + DEADLINE_TYPE_MEANING, + deriveDeadlineEvents, + seniorFallYear, + type DeadlineCollege, +} from '../data/applicationDeadlines' + +const SANS = "'Outfit',sans-serif" +const EARLY: ReadonlySet = new Set(['ED', 'EA', 'REA']) + +const toSend = (apps: ApplicationEntry[]) => apps.filter((a) => a.status === 'not-started' || a.status === 'in-progress') +const schools = (k: number) => `${k} ${k === 1 ? 'school' : 'schools'}` + +/** The early and regular rounds in the student's own cycle, and where their + * list sits in each. They don't open: the schools' dates are in Application Status. */ +export function ApplicationRounds({ apps, colleges, gradeStartIdx, onSeeSchools }: { + apps: ApplicationEntry[] + colleges?: ReadonlyMap + gradeStartIdx: number | null | undefined + onSeeSchools: () => void +}) { + const now = new Date() + const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()) + const seniorFall = seniorFallYear(gradeStartIdx, now) + // Sorted by date, so the first in a round is its soonest. + const upcoming = deriveDeadlineEvents(apps, { gradeStartIdx, now, colleges }) + .filter((e) => e.category === 'application' && !e.done && e.date >= today) + const pending = toSend(apps) + const early = pending.filter((a) => EARLY.has(a.deadlineType)) + const regular = pending.filter((a) => a.deadlineType === 'RD') + const rolling = pending.filter((a) => a.deadlineType === 'Rolling').length + + const withSoonest = (lead: string, round: ApplicationEntry[]) => { + const ids = new Set(round.map((a) => a.collegeId)) + const e = upcoming.find((x) => x.collegeId != null && ids.has(x.collegeId)) + if (!e) return lead + return round.length === 1 ? `${lead}: ${e.collegeName}, ${e.dateDisplay}` : `${lead}; ${e.collegeName} is first, ${e.dateDisplay}` + } + const listState = apps.length === 0 ? 'Add schools in Discover to see where yours fall' + : pending.length === 0 ? 'Every application on your list is in' + : null + // Sent ones still count: "none set to apply early" is wrong once the ED one is in. + const sent = (inRound: (t: AppDeadlineType) => boolean) => apps.filter((a) => inRound(a.deadlineType)).length + const earlySent = sent((t) => EARLY.has(t)) + const earlySummary = listState ?? (early.length + ? withSoonest(`Applying early to ${schools(early.length)}`, early) + : earlySent ? `Your early ${earlySent === 1 ? 'application is' : 'applications are'} in` + : 'None of your schools is set to apply early. Pick each one’s round on its page') + const rollingNote = rolling ? `${rolling} more ${rolling === 1 ? 'is' : 'are'} rolling` : '' + const regularSummary = listState ?? (regular.length + ? withSoonest(`${schools(regular.length)} in Regular Decision`, regular) + (rollingNote && `; ${rollingNote}`) + : rolling ? `${schools(rolling)} with rolling admission, so no fixed date. Earlier is better` + : sent((t) => t === 'RD') ? 'Your Regular Decision applications are in' + : 'None of your schools is set to Regular Decision') + + return ( +

+
+ + +
+

+ The Common App opens Aug 1, {seniorFall}, and most schools want your answer by May 1, {seniorFall + 1}. These are the usual dates; each school’s own is on its page in Application Status. +

+
+ ) +} + +// Line icons in the module's own stroke style, drawn in the row's color. +const svg = (children: ReactNode) => ( + +) +const ROWS = { + // Laptop: where you apply. + apply: { color: '#1D7FC4', icon: svg(<>) }, + // Page: what goes in. + parts: { color: '#7048C8', icon: svg(<>) }, + // Calendar: rounds. + rounds: { color: '#C47A12', icon: svg(<>) }, + // Price tag: fees. + fees: { color: '#2D9E72', icon: svg(<>) }, +} as const +type RowId = keyof typeof ROWS + +/** "Know your application": four rows, each pointing at the article or tab that goes further. */ +export default function ApplicationGuideSections({ apps, onRead, onSeeSchools }: { + apps: ApplicationEntry[] + /** Open one of Application 101's items, to read. */ + onRead: (itemId: string) => void + onSeeSchools: () => void +}) { + const [open, setOpen] = useState(null) + const row = (id: RowId) => ({ ...ROWS[id], open: open === id, onToggle: () => setOpen(open === id ? null : id) }) + + const perRound = DEADLINE_TYPES.map((t) => ({ t, n: apps.filter((a) => a.deadlineType === t).length })) + const onList = perRound.filter((r) => r.n > 0) + + // Fees for what's still to send. A missing figure is "not on file", never $0. + const fees = toSend(apps).map((a) => a.applicationFeeCents) + const charged = fees.filter((c): c is number => c != null && c > 0) + const free = fees.filter((c) => c === 0).length + const unknown = fees.filter((c) => c == null).length + const total = Math.round(charged.reduce((s, c) => s + c, 0) / 100) + // Only once a figure is known: "14 not on file" alone says nothing. + const feeParts = charged.length + free === 0 ? [] : [ + charged.length > 0 && `$${total.toLocaleString('en-US')} for ${schools(charged.length)}`, + free > 0 && `${free} free`, + unknown > 0 && `${unknown} not on file`, + ].filter(Boolean) + + return ( +
+ Know your application + + + Most schools take more than one, and you only need one per school. Each school’s admissions page says which it accepts. + Site}> + One application for every school that takes it. Your details, activities and personal essay go to all of them, and each school can add its own questions. + + + Run on Scoir and taken by a smaller group of colleges. It works the same way: one form, sent to many. + + + A few schools take only their own application, like the University of California and MIT. + + onRead('as-3')} /> + + + + + One essay that goes to every school on the Common App. Many schools add shorter essays of their own. + + + Ask teachers who know your work well, at least three weeks before your first deadline. + + + Your counselor sends it with a school report. Schools see your senior grades too, at midyear and at the end. + + + Many schools are test-optional, but some require the SAT or ACT again. Check each school’s policy. + + + Jobs, family responsibilities and clubs all count. The Common App also has room for 5 honors. + + + + + `${r.n} ${r.t === 'Rolling' ? 'rolling' : r.t}`).join(', ')}` : 'ED, EA, REA, RD and rolling: what each one commits you to'} + > + Each school on your list has one round, set on its page in Application Status. Only Early Decision is binding. + {perRound.map(({ t, n }) => ( + + {DEADLINE_TYPE_MEANING[t]} + + ))} + onRead('as-2')} /> + + + + More than half the schools on the Common App charge nothing to apply. If money is tight, a fee waiver covers the rest, and asking for one is routine. + + Ask for it in the Common App’s profile section if you qualify, for example through free or reduced-price lunch or an SAT or ACT fee waiver. Your counselor confirms it. + + + Testing with an SAT fee waiver also gets you free applications at participating colleges. Your counselor can sign a NACAC waiver for the rest. + + onRead('sw-3')} /> + +
+ ) +} diff --git a/web/src/components/ApplicationTrackingModule.tsx b/web/src/components/ApplicationTrackingModule.tsx index 1aa61ba..2195845 100644 --- a/web/src/components/ApplicationTrackingModule.tsx +++ b/web/src/components/ApplicationTrackingModule.tsx @@ -37,6 +37,8 @@ import ApplicationsModuleTour, { type ApplicationsTabId } from './ApplicationsMo import ModuleTabNav from './ModuleTabNav' import ModuleOverviewTab from './ModuleOverviewTab' import YourListStrip from './YourListStrip' +import ApplicationGuideSections, { ApplicationRounds } from './ApplicationGuideSections' +import { Callout } from './moduleUI' import ModuleShell from './ModuleShell' import CollegeDiscoverTab from './CollegeDiscoverTab' import AidCompare from './AidCompare' @@ -81,13 +83,19 @@ const TAB_IDS = TABS.map((t) => t.id) /* ─── overview ─── */ /** The list at a glance, as Financial Aid's Overview is the aid: the list's - * map and balance under a word on where this grade stands. */ -function OverviewTab({ year, aside, listLoaded, strip }: { year?: number; aside?: ReactNode; listLoaded: boolean; strip: ReactNode }) { + * map and balance under a word on where this grade stands, then when the + * rounds are due and what an application asks for. */ +function OverviewTab({ year, aside, listLoaded, strip, rounds, guide }: { year?: number; aside?: ReactNode; listLoaded: boolean; strip: ReactNode; rounds: ReactNode; guide: ReactNode }) { const intro = (year ?? 11) >= 12 ? 'Senior year is when it all gets sent. Every school’s deadline and requirements live in Application Status; mark each one off as it goes in.' : year === 11 ? 'Junior year is for building the list. Find schools that fit in Discover, and aim for a mix of reaches, targets and likely schools by the end of the summer.' : 'You’re early, and that’s an advantage. Start a list of schools you’re curious about in Discover. It will change, and that’s the point.' + const priority = (year ?? 11) >= 12 + ? { title: 'Senior Year Priority', body: 'Give teachers at least three weeks for recommendations, and send each application a few days early. Portals slow down on deadline night.' } + : year === 11 + ? { title: 'Junior Year Priority', body: 'Ask two teachers for recommendations before summer, and draft your personal essay while you have the time. The Common App opens Aug 1.' } + : null return (
@@ -97,7 +105,12 @@ function OverviewTab({ year, aside, listLoaded, strip }: { year?: number; aside?

Application Tracking

{intro}

{/* Before the list is in, "Your list is empty" would be a wrong answer. */} - {listLoaded ? strip :
Loading your list…
} + {listLoaded ? <> + {strip} +
{rounds}
+ :
Loading your list…
} + {priority &&
} + {guide}
{aside}
@@ -126,8 +139,11 @@ export default function ApplicationTrackingModule({ open, onClose, onEditIncome, // in the URL too, under its tab, so Back returns to the list and a link or // refresh lands on the school. const [tab, setTab, routedSchool, setSchool] = useRoutedTab('Application Tracking', open, TAB_IDS, 'overview') - // Changing tab closes the school's page (useRoutedTab does that). - const switchTab = setTab + // An Application 101 item opened from Overview. Changing tab closes it, as + // it closes the school's page (useRoutedTab does that). + const [openItem, setOpenItem] = useState(null) + const switchTab = useCallback((t: TabId) => { setOpenItem(null); setTab(t) }, [setTab]) + const read101 = useCallback((id: string) => { setTab('application-101'); setOpenItem(id) }, [setTab]) const school = tab === 'status' ? routedSchool : null // The module stays mounted while closed — it holds the college list and its @@ -139,7 +155,7 @@ export default function ApplicationTrackingModule({ open, onClose, onEditIncome, if (open !== wasOpen) { setWasOpen(open) // A tab named in the URL (back/forward, or a refresh) wins over the default. - if (open) { setTab(routedTab('Application Tracking', TAB_IDS) ?? 'overview'); setSchool(routedItem('Application Tracking', TAB_IDS)) } + if (open) { setTab(routedTab('Application Tracking', TAB_IDS) ?? 'overview'); setSchool(routedItem('Application Tracking', TAB_IDS)); setOpenItem(null) } } // From the Overview list strip: a school's page, or the whole list. const openInStatus = useCallback((collegeId: string | null) => { setTab('status'); setSchool(collegeId) }, [setTab, setSchool]) @@ -253,8 +269,15 @@ export default function ApplicationTrackingModule({ open, onClose, onEditIncome, && shouldShowFeeWaiverNotice(incomeLevel, profile?.settings?.intros_seen) const content = - tab === 'overview' ? switchTab('discover')} onSeeAll={() => openInStatus(ALL_SCHOOLS)} />} /> : - tab === 'application-101' ? : + tab === 'overview' ? switchTab('discover')} onSeeAll={() => openInStatus(ALL_SCHOOLS)} />} + rounds={ openInStatus(ALL_SCHOOLS)} />} + guide={ openInStatus(ALL_SCHOOLS)} />} + /> : + tab === 'application-101' ? : tab === 'aid-compare' && FEATURES.aidCompare ? a.collegeId)} accent={MC} /> : tab === 'discover' ? : switchTab('discover')} apps={apps} onUpdate={handleUpdateApp} onRemove={handleRemoveApp} onSetShared={handleSetSharedTask} onSetSharedDue={handleSetSharedDue} gradeStartIdx={profile?.grade_start_idx} openId={school} onOpen={setSchool} colleges={collegeRows} /> diff --git a/web/src/components/FinancialAidModule.tsx b/web/src/components/FinancialAidModule.tsx index 695d3c6..9a4f724 100644 --- a/web/src/components/FinancialAidModule.tsx +++ b/web/src/components/FinancialAidModule.tsx @@ -64,7 +64,7 @@ import { useIsNarrow } from '../lib/useMediaQuery' import ChecklistContentView from './ChecklistContentView' import AidGuideSections, { type AidGuideDestination, type GuideRowId } from './AidGuideSections' import { stateFromZip } from '../data/aidPrograms' -import { Bar, CollegeLogo, SecLabel, Tag } from './moduleUI' +import { Bar, Callout, CollegeLogo, DateBox, SecLabel, Tag } from './moduleUI' import { logoUrlForDomain } from '../lib/collegeLogo' import { formatRoute, routedTab, useRoutedTab } from '../lib/hashRoute' import { MODULE_ICONS } from './moduleIcons' @@ -256,16 +256,6 @@ const Ring = ({ status, color }: { status: ChecklistItemStatus; color: string }) return } -const Callout = ({ icon, title, body, color = MC, bg }: { icon: ReactNode; title?: string | null; body: ReactNode; color?: string; bg?: string }) => ( -
- {icon} -
- {title &&
{title}
} -
{body}
-
-
-) - /* ═══════════════════════════════════════════════════════════════ MODULE TAB NAV ═══════════════════════════════════════════════════════════════ */ @@ -443,11 +433,11 @@ const OverviewTab = ({ aside, homeState, aid, onGoToTab, onRead, ownDates, year, {year >= 12 ? (
- +
) : year === 11 && (
- +
)} @@ -2036,27 +2026,12 @@ export function AidForms({ aid, gradeStartIdx, onSeeSchools, ownDates }: { ? {n === 0 && !aid.loading && !aid.failed ? <>Add schools in Application Tracking to see what each one asks for. : listState} : <>{aid.unresolved.length > 0 &&
}{rows} - const box = (id: 'fafsa' | 'css', color: string, title: string, dates: string, summary: string, body: ReactNode) => { - const isOpen = open === id - return ( - // Longhands only, as in AidGuideSections: the shorthand would wipe the colored edge. -
- - {isOpen &&
{body}
} -
- ) - } + // On Overview the boxes don't open: they go to Aid Tracker, where they do. + const box = (id: 'fafsa' | 'css', color: string, title: string, dates: string, summary: string, body: ReactNode) => ( + setOpen(open === id ? null : id))}> + {body} + + ) return (
diff --git a/web/src/components/ModuleOverviewTab.tsx b/web/src/components/ModuleOverviewTab.tsx index 22fa9b0..3ffc237 100644 --- a/web/src/components/ModuleOverviewTab.tsx +++ b/web/src/components/ModuleOverviewTab.tsx @@ -40,6 +40,8 @@ interface Props { aside?: ReactNode /** Back's label in the article reader, when this isn't the Overview tab. */ backLabel?: string + /** An item to open on, to read. Opening doesn't change its status. */ + initialOpenId?: string | null } export default function ModuleOverviewTab({ @@ -56,10 +58,11 @@ export default function ModuleOverviewTab({ itemTypeIcon, aside, backLabel, + initialOpenId, }: Props) { const [expanded, setExpanded] = useState>(() => Object.fromEntries(checklist.map((_, i) => [i, true]))) - const [activeContentId, setActiveContentId] = useState(null) + const [activeContentId, setActiveContentId] = useState(initialOpenId ?? null) const statusOf = (id: string): ChecklistItemStatus => progress[id] ?? 'available' const done = checklist.reduce( (a, s) => a + s.items.filter((x) => statusOf(x.id) === 'completed').length, diff --git a/web/src/components/moduleUI.tsx b/web/src/components/moduleUI.tsx index c07001f..005c2e1 100644 --- a/web/src/components/moduleUI.tsx +++ b/web/src/components/moduleUI.tsx @@ -8,6 +8,10 @@ import { useState, type CSSProperties, type ReactNode } from 'react' import type { ChecklistItemStatus } from '../lib/moduleProgress' +import { C } from '../lib/designTokens' +import { MODULE_ICONS } from './moduleIcons' + +const SANS = "'Outfit',sans-serif" /** * School logo with graceful emoji fallback. There is no logo column anywhere — @@ -113,3 +117,136 @@ export const Check = () => ( ) + +/** A tinted note with an icon: a grade's priority, a nudge to finish the profile. */ +export const Callout = ({ icon, title, body, color, bg }: { icon: ReactNode; title?: string | null; body: ReactNode; color: string; bg?: string }) => ( +
+ {icon} +
+ {title &&
{title}
} +
{body}
+
+
+) + +/** + * A box of key dates: Financial Aid's FAFSA and CSS Profile, Application + * Tracking's rounds. With `open` it expands onto `children`; without, it + * doesn't, and the click goes wherever those details live. + */ +export const DateBox = ({ color, title, dates, summary, open, onClick, children }: { + color: string + title: string + dates: string + summary: string + open?: boolean + onClick: () => void + children?: ReactNode +}) => ( + // Longhands only, as in GuideRow: the shorthand would wipe the colored edge. +
+ + {open &&
{children}
} +
+) + +/* ─── guide rows: the Overview tabs' "know your …" sections ─── */ + +export const ExtLink = ({ href, children, color }: { href: string; children: ReactNode; color: string }) => ( + + {children} ↗ + +) + +/** One entry inside an open row: name and figure on top, the explanation under it. */ +export const GuideItem = ({ title, figure, children, links, color, chip }: { + title: string + figure?: string + children: ReactNode + links?: ReactNode + color: string + /** Render the title as a colored chip instead of bold text. */ + chip?: boolean +}) => ( +
+
+
+ {chip + ? {title} + : {title}} + {figure && · {figure}} +
+
{children}
+
+ {links &&
{links}
} +
+) + +/** "Edvifi can ___" — one line at the foot of a row, pointing at the tool that does it. */ +export const EdvifiCan = ({ can, cta, onClick, color }: { can: string; cta: string; onClick: () => void; color: string }) => ( + // A quiet tinted strip rather than a banner: it should read as the next step, + // not as an ad, but still be the first thing the eye lands on at the bottom. +
+ + + Edvifi can {can} + + +
+) + +/** A collapsible row in the same shape as the checklist sections. */ +export const GuideRow = ({ color, icon, title, summary, tag, open, onToggle, children }: { + color: string + icon: ReactNode + title: string + summary: string + tag?: string + open: boolean + onToggle: () => void + children: ReactNode +}) => { + const [hover, setHover] = useState(false) + const edge = open || hover ? `${color}45` : C.border + return ( + // Longhands only. Mixing the `border` shorthand with `borderLeft` lets React + // re-apply the shorthand on toggle and wipe the colored edge. +
+ + {open &&
{children}
} +
+ ) +} + +export const GuideIntro = ({ children }: { children: ReactNode }) => ( +

{children}

+) diff --git a/web/src/data/applicationDeadlines.ts b/web/src/data/applicationDeadlines.ts index dfddf2f..70e1bef 100644 --- a/web/src/data/applicationDeadlines.ts +++ b/web/src/data/applicationDeadlines.ts @@ -160,7 +160,7 @@ export const DEADLINE_TYPE_MEANING: Record = { Rolling: 'No fixed date — they read applications as they arrive and places fill up. Earlier is better.', } -const DEADLINE_TYPE_COLOR: Record = { +export const DEADLINE_TYPE_COLOR: Record = { ED: '#B93A3A', REA: '#B93A3A', EA: '#C47A12',