Patch notes 20260612
PR Summary — Frontend: BYOS, Content Preview & Client Profile
Build Your Own Story — UX & Feature Improvements (closes #120, #119, #116, #117)
Beta Gate Removed
BYOS is now generally available. Clicking "Build your own story" or an existing story link on the client card navigates directly. The old confirmation modal and all associated state (isStoryBetaDialogOpen, pendingStoryClientId, pendingStoryId) have been removed entirely.
Contextual User Guides
Two new ? help modals added:
- About Articles — triggered from the Articles panel header; covers intro, numbered steps, and a scrape-failure note
- About Cluster Analysis — triggered before the Submit For Cluster Analysis button
Both dialogs follow the existing
ProductForm/rexnovapattern (MUI Dialog, "Got it" close button).
Article Row Action Buttons
Each article URL row now surfaces contextual icon buttons based on processing state:
| Condition | Icon | Tooltip | Action |
|---|---|---|---|
scrape === "failed" | fail.png | Add Body | Opens manual text override modal |
analyse === "success" | research.png | View Analysis | Opens analysis output modal |
The Analyse step label is now only clickable on failure. Viewing analysis on success is handled by the new icon button instead.
Tooltip Copy Update
The disabled cluster analysis submit tooltip updated from: "Looks like your article data is incomplete."
To: "All articles must finish processing before cluster analysis can begin."
Content Views — Markdown Mode (closes #116)
A third content view mode — Markdown — has been added alongside HTML and Display across both the content preview route and BYOS generated content card.
New Shared Module: lib/contentExport.ts
ContentViewModetype:"html" | "display" | "markdown"htmlToMarkdown()— Turndown wrapper (ATX headings, fenced code blocks)htmlToRtf(),stripHtml(),slugifyTitle()— extracted from both preview routes, removing ~100 lines of duplication per file
View / Copy / Download Behaviour
| Mode | Preview | Copy | Download |
|---|---|---|---|
| HTML | Raw HTML source | HTML | .html |
| Display | Rendered rich HTML | RTF / rich HTML | .rtf |
| Markdown | Raw Markdown source | Plain Markdown | .md |
Conversion source is always the assembled display HTML. Markdown updates live during streaming.
Shared Modules & News Cluster Modal
New Shared Modules
lib/articleAnalysis.ts—ArticleAnalysisDatatype,parseArticleAnalysis(),hasArticleAnalysis()components/ArticleAnalysisModal.tsx— reusable analysis output dialog (Summary, Bias Analysis, Facts, Quotes)lib/themeMaskIcon.ts—themeMaskIconSx()for theme-aware icon tinting
News Cluster Modal — Article List
The cluster detail modal on the news page now shows per-article URLs below the cluster summary, consistent with BYOS article viewing (without DAG status steps or delete actions). Articles with analysis data show a View Analysis icon; others show URL only.
Tabbed Workspace (plan_3)
New Shared Components
StoryWorkspaceTabs.tsx— unified tab order: Story Analysis → Articles → Generated Content; panels use hide-not-unmount so streaming continues off-tab;StreamingTabBadgeon Generated Content tab while streamingClusterSummaryPanel.tsx,ClusterArticleList.tsx,GeneratedContentToolbar.tsx— shared cluster summary, article rows, and export toolbar
BYOS Tab Behaviour
Progressive tab reveal: Articles only on fresh story → Story Analysis after submit → Generated Content after generate. Immediate navigation to the relevant tab on button click.
Content Preview
All three tabs always visible; defaults to Generated Content. Fetches getNewClusterInfo for Story Analysis and Articles tabs.
Client Intelligence Profile — PDF Export (closes #122)
Frontend-only PDF export on the client registration page. Generates a multi-page branded PDF from loaded ClientInfo data using @react-pdf/renderer. No API changes.
New Dependencies
@react-pdf/renderer— PDF generation@fontsource/lexend— Lexend WOFF files for font registration
New Module: lib/clientProfilePdf/
| File | Purpose |
|---|---|
registerFonts.ts | Registers Active Uno Bold/SemiBold and Lexend Regular/Semibold |
pdfStyles.ts | Brand palette, typography, layout styles |
mapClientToProfilePdfData.ts | Maps ClientInfo → PDF view model; splits Part 1 / Part 2 |
webpageAnalysis.ts | Groups product/case study analysis fields |
ClientProfileDocument.tsx | Composes pages: cover, Part 1, case studies, products, Part 2 |
generateClientProfilePdf.tsx | pdf().toBlob() + browser download |
PDF Layout
- Deep Space background on all pages; Navy content panels
- Coral banners for section and part headings
- Page header on every page: logo left, page n of total right
- Dedicated pages for Case Studies, Product Pages, and Part 2
- Client Persona + Company Overview in Part 2
- Filename:
{Company}_Messaging_House.pdf
Modified Files
$clientId.tsx— "Download profile" button added to page headerRunAnalysisPanel.tsx— importsANALYSIS_SCHEMAfrom new shared module