Skip to content

Commit 0dbff91

Browse files
committed
Add acceptance decision mode docs and UI
1 parent f42cdfc commit 0dbff91

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

apps/web/components/decision/accepted-schools-workspace.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@ import type { DecisionReportResponse } from "@/types/api";
2424

2525
export function AcceptedSchoolsWorkspace() {
2626
const { savedSchools, updateSavedStatus } = useSchoolActionState();
27+
const [localStateReady, setLocalStateReady] = useState(false);
2728
const candidates = useMemo(() => getDecisionCandidates(getVisibleSavedSchools(savedSchools)), [savedSchools]);
2829
const [offers, setOffers] = useState<DecisionOfferDraft[]>([]);
2930
const [report, setReport] = useState<DecisionReportResponse | null>(null);
3031
const [saveState, setSaveState] = useState<string>("Local");
3132

33+
useEffect(() => {
34+
setLocalStateReady(true);
35+
}, []);
36+
3237
useEffect(() => {
3338
setOffers((current) => mergeOffersWithCandidates(candidates, current.length ? current : readDecisionOffers()));
3439
}, [candidates]);
@@ -97,13 +102,15 @@ export function AcceptedSchoolsWorkspace() {
97102
</div>
98103
</header>
99104

100-
{candidates.length === 0 ? (
105+
{localStateReady && candidates.length === 0 ? (
101106
<EmptyState
102-
title="No accepted schools yet"
107+
title="No admitted schools yet"
103108
description="Mark saved schools as accepted or finalist to start the decision workspace."
104109
action={<Link href="/dashboard">Review saved schools</Link>}
105110
/>
106-
) : (
111+
) : null}
112+
113+
{candidates.length > 0 ? (
107114
<div className="grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(360px,0.65fr)]">
108115
<section className="space-y-4">
109116
{candidates.map((school) => {
@@ -121,7 +128,7 @@ export function AcceptedSchoolsWorkspace() {
121128
</section>
122129
<DecisionSummaryPanel report={report} />
123130
</div>
124-
)}
131+
) : null}
125132
</main>
126133
);
127134
}

apps/web/tests/saved-compare.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ test("edits accepted-school offers and generates a decision summary", async ({ p
100100

101101
await page.goto("/decision");
102102

103-
await expect(page.getByRole("heading", { name: "Accepted schools" })).toBeVisible();
103+
await expect(page.getByRole("heading", { name: "Accepted schools", exact: true })).toBeVisible();
104+
await expect(page.getByLabel("Estimated yearly cost").first()).toBeVisible();
104105
await page.getByLabel("Estimated yearly cost").first().fill("18000");
106+
await expect(page.getByLabel("Unresolved concerns/questions").first()).toBeVisible();
105107
await page.getByLabel("Unresolved concerns/questions").first().fill("Confirm housing package");
106108
await page.getByRole("button", { name: "Save offer" }).first().click();
107109
await page.getByRole("button", { name: "Generate summary" }).click();

0 commit comments

Comments
 (0)