Keep the template picker in the create flow, make catalog cards real links, and stop showing a fake community when review has no draft.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-09-10 15:22:46 -06:00
co-authored by Cursor
parent 3f9a8395be
commit 90db213413
31 changed files with 412 additions and 126 deletions
@@ -5,10 +5,10 @@
*/
import { memo, useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { useTranslation } from "../../../contexts/MessagesContext";
import { logger } from "../../../../lib/logger";
import { prepareFreshCreateFlowEntrySync } from "../../../(app)/create/utils/prepareFreshCreateFlowEntry";
import { buildTemplateReviewHref } from "../../../(app)/create/utils/flowSteps";
import {
fetchTemplates,
isTemplatesFetchAborted,
@@ -34,7 +34,6 @@ declare global {
const RuleStackContainer = memo<RuleStackProps>(
({ className = "", initialGridEntries, translationNamespace, twoColumnsFromMd }) => {
const router = useRouter();
const namespace = translationNamespace ?? "pages.home.ruleStack";
const t = useTranslation(namespace);
const [gridEntries, setGridEntries] = useState<TemplateGridCardEntry[] | null>(
@@ -101,12 +100,12 @@ const RuleStackContainer = memo<RuleStackProps>(
// `signedIn: true` because this surface has no session in hand; DELETE is
// best-effort and the sentinel blocks stale-draft hydration.
prepareFreshCreateFlowEntrySync({ signedIn: true });
router.push(`/create/review-template/${encodeURIComponent(slug)}`);
};
return (
<RuleStackView
className={className}
hrefForTemplate={(slug) => buildTemplateReviewHref(slug)}
onTemplateClick={handleTemplateClick}
gridEntries={gridEntries}
sectionTitle={t("title")}
@@ -21,6 +21,7 @@ export interface RuleStackProps {
export interface RuleStackViewProps {
className: string;
onTemplateClick: (_slug: string) => void;
hrefForTemplate: (_slug: string) => string;
/** `null` while loading curated templates from the API. */
gridEntries: TemplateGridCardEntry[] | null;
sectionTitle: string;
@@ -10,6 +10,7 @@ import type { RuleStackViewProps } from "./RuleStack.types";
export function RuleStackView({
className,
onTemplateClick,
hrefForTemplate,
gridEntries,
sectionTitle,
sectionSubtitle,
@@ -46,6 +47,7 @@ export function RuleStackView({
) : (
<GovernanceTemplateGrid
entries={gridEntries}
hrefForTemplate={hrefForTemplate}
onTemplateClick={onTemplateClick}
twoColumnsFromMd={twoColumnsFromMd}
/>