Create flow cleanup

This commit is contained in:
adilallo
2026-04-11 00:29:15 -06:00
parent a5c6b8971f
commit 60d4ae6dfd
3 changed files with 21 additions and 10 deletions
+11 -3
View File
@@ -85,9 +85,15 @@ function AddPlatformModalContent({
const m = useMessages();
const comm = m.create.communication;
const modal = comm.modals[platformCardId as keyof typeof comm.modals];
if (!modal || !("sections" in modal)) return null;
const defaults =
modal && "sections" in modal
? modal.sections
: {
corePrinciple: "",
logisticsAdmin: "",
codeOfConduct: "",
};
const defaults = modal.sections;
const [sectionValues, setSectionValues] = useState<
Record<SectionField, string>
>(() => ({
@@ -104,6 +110,8 @@ function AddPlatformModalContent({
[markCreateFlowInteraction],
);
if (!modal || !("sections" in modal)) return null;
return (
<div className="flex flex-col gap-6">
{SECTION_FIELDS.map((field) => (
@@ -147,7 +155,7 @@ export default function CardsPage() {
recommended: true,
};
}),
[comm.cards],
[comm],
);
const title = expanded ? comm.page.expandedTitle : comm.page.compactTitle;
+8 -5
View File
@@ -40,11 +40,14 @@ export default function CompletedPage() {
if (!stored) return;
const parsed = parseDocumentSectionsForDisplay(stored.document);
if (parsed.length === 0) return;
setDocumentSections(parsed);
setHeaderTitle(stored.title);
const sum =
typeof stored.summary === "string" ? stored.summary.trim() : "";
setHeaderDescription(sum.length > 0 ? sum : undefined);
// One-shot hydration from client-only storage after mount.
queueMicrotask(() => {
setDocumentSections(parsed);
setHeaderTitle(stored.title);
const sum =
typeof stored.summary === "string" ? stored.summary.trim() : "";
setHeaderDescription(sum.length > 0 ? sum : undefined);
});
}, []);
const toast = !toastDismissed ? (
+2 -2
View File
@@ -33,7 +33,7 @@ describe("FinalReviewPage", () => {
expect(screen.getByRole("heading", { level: 1 })).toBeInTheDocument();
});
it("renders HeaderLockup with expected title", () => {
it("renders lockup title", () => {
render(<FinalReviewPage />);
expect(
screen.getByRole("heading", {
@@ -42,7 +42,7 @@ describe("FinalReviewPage", () => {
).toBeInTheDocument();
});
it("renders HeaderLockup with expected description", () => {
it("renders lockup description", () => {
render(<FinalReviewPage />);
expect(
screen.getByText(