Patch notes 20260612

Patch Notes

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 / rexnova pattern (MUI Dialog, "Got it" close button).

Article Row Action Buttons

Each article URL row now surfaces contextual icon buttons based on processing state:

ConditionIconTooltipAction
scrape === "failed"fail.pngAdd BodyOpens manual text override modal
analyse === "success"research.pngView AnalysisOpens 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

  • ContentViewMode type: "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

ModePreviewCopyDownload
HTMLRaw HTML sourceHTML.html
DisplayRendered rich HTMLRTF / rich HTML.rtf
MarkdownRaw Markdown sourcePlain 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.tsArticleAnalysisData type, parseArticleAnalysis(), hasArticleAnalysis()
  • components/ArticleAnalysisModal.tsx — reusable analysis output dialog (Summary, Bias Analysis, Facts, Quotes)
  • lib/themeMaskIcon.tsthemeMaskIconSx() 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; StreamingTabBadge on Generated Content tab while streaming
  • ClusterSummaryPanel.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/

FilePurpose
registerFonts.tsRegisters Active Uno Bold/SemiBold and Lexend Regular/Semibold
pdfStyles.tsBrand palette, typography, layout styles
mapClientToProfilePdfData.tsMaps ClientInfo → PDF view model; splits Part 1 / Part 2
webpageAnalysis.tsGroups product/case study analysis fields
ClientProfileDocument.tsxComposes pages: cover, Part 1, case studies, products, Part 2
generateClientProfilePdf.tsxpdf().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 header
  • RunAnalysisPanel.tsx — imports ANALYSIS_SCHEMA from new shared module