Give finished Rules a print path, folded launch counts, and a two-day follow-up.

Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
adilallo committed 2026-11-10 18:32:33 -07:00
1 parent 0efc907633
commit d9c475a967
74 files changed
+2401 -630

No files matched your search

+8 -10
View File
@@ -19,12 +19,11 @@ import {
type PublishedRuleDetailForClient,
} from "../../../lib/create/api";
import {
downloadStoredRuleAsMarkdown,
downloadStoredRuleAsPdf,
downloadTextFile,
exportFilenameBase,
exportStoredRuleAsMarkdown,
} from "../../../lib/create/ruleExport";
import {
finishedAtIso,
writeLastPublishedRule,
type StoredLastPublishedRule,
} from "../../../lib/create/lastPublishedRule";
@@ -255,11 +254,13 @@ export default function ProfilePageClient() {
setActionError(t("actionError"));
return;
}
const finishedAt = finishedAtIso(detail.rule.createdAt);
writeLastPublishedRule({
id: detail.rule.id,
title: detail.rule.title,
summary: detail.rule.summary,
document: detail.rule.document as Record<string, unknown>,
...(finishedAt ? { finishedAt } : {}),
});
router.push(
createFlowStepPath("confirm-stakeholders", {
@@ -334,11 +335,13 @@ export default function ProfilePageClient() {
) {
return null;
}
const finishedAt = finishedAtIso(rule.createdAt);
return {
id: rule.id,
title: rule.title,
summary: rule.summary,
document: rule.document as Record<string, unknown>,
...(finishedAt ? { finishedAt } : {}),
};
},
[],
@@ -354,7 +357,7 @@ export default function ProfilePageClient() {
return;
}
try {
downloadStoredRuleAsPdf(stored);
downloadStoredRuleAsPdf(stored, window.location.origin);
} catch {
setActionError(t("actionError"));
}
@@ -372,12 +375,7 @@ export default function ProfilePageClient() {
return;
}
try {
const markdown = exportStoredRuleAsMarkdown(stored);
downloadTextFile(
`${exportFilenameBase(stored)}-community-rule.md`,
markdown,
"text/markdown;charset=utf-8",
);
downloadStoredRuleAsMarkdown(stored, window.location.origin);
} catch {
setActionError(t("actionError"));
}