From e77b674bf1fb108e25c5183622f85ea83fb0824e Mon Sep 17 00:00:00 2001 From: Suraj Jha Date: Thu, 9 Apr 2026 21:46:31 +0545 Subject: [PATCH] refactor: 'Report' template schema correction --- .../Report/DataAnalysisBarSlide.tsx | 20 +++++------ .../Report/DataAnalysisInsightBarSlide.tsx | 12 +++---- .../Report/DataAnalysisLineStatsSlide.tsx | 14 ++++---- .../Report/DataAnalysisListSlide.tsx | 8 ++--- .../Report/IntroSlide.tsx | 26 +++++++++----- .../Report/IntroductionStatsSlide.tsx | 16 ++++----- .../Report/MilestoneSlide.tsx | 24 ++++++------- .../Report/PerformanceSnapshotSlide.tsx | 25 +++++-------- .../Report/ServicesSlide.tsx | 14 ++++---- .../Report/SolutionSlide.tsx | 34 +++++++++--------- .../Report/TeamSlide.tsx | 36 +++++++++---------- ...ide.tsx => TitleDescriptionImageSlide.tsx} | 15 ++++---- 12 files changed, 122 insertions(+), 122 deletions(-) rename electron/servers/nextjs/app/presentation-templates/Report/{IntroductionImageSlide.tsx => TitleDescriptionImageSlide.tsx} (90%) diff --git a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisBarSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisBarSlide.tsx index 790f3ac0..d4c5c643 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisBarSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisBarSlide.tsx @@ -7,21 +7,21 @@ import { ResponsiveContainer } from "recharts"; import { FlexibleReportChart, flexibleChartDataSchema } from "./flexibleReportChart"; const InsightItemSchema = z.object({ - title: z.string().min(3).max(12).meta({ - description: "Short insight title shown next to the icon.", + title: z.string().min(3).max(80).meta({ + description: "Bullet point title shown next to the icon.", }), - description: z.string().min(20).max(40).meta({ - description: "Supporting text shown below the insight title.", + description: z.string().min(20).max(120).meta({ + description: "Bullet point description shown below the title.", }), }); -export const slideLayoutId = "data-analysis-bar-slide"; -export const slideLayoutName = "Data Analysis Bar Slide"; +export const slideLayoutId = "bar-chart-with-bullet-list-title-description-icon-slide"; +export const slideLayoutName = "Bar Chart with Bullet List with Title Description Icon Slide"; export const slideLayoutDescription = - "A slide with a title at the top, a vertical list of three analysis points on the left, and a bar chart on the right. Each analysis point contains a small icon badge, a short title, and a supporting description."; + "A slide with a title at the top, a vertical list of three bullet points with icon, title and description on the left, and a bar chart on the right."; export const Schema = z.object({ - title: z.string().min(3).max(28).default("Data Analysis").meta({ + title: z.string().min(3).max(80).default("Data Analysis").meta({ description: "Slide title shown at the top-left.", }), itemIcon: z @@ -40,7 +40,7 @@ export const Schema = z.object({ }), items: z .array(InsightItemSchema) - + .min(1) .max(3) .default([ { title: "Title 1", description: "Ut enim ad minima veniam, quis." }, @@ -63,7 +63,7 @@ export const Schema = z.object({ ], }), - legendLabel: z.string().min(3).max(32).default("Traditional Workflow").meta({ + legendLabel: z.string().min(3).max(50).default("Traditional Workflow").meta({ description: "Legend label shown below the chart.", }), }); diff --git a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisInsightBarSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisInsightBarSlide.tsx index 3481d01a..1f7aac3d 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisInsightBarSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisInsightBarSlide.tsx @@ -6,14 +6,14 @@ import { ResponsiveContainer } from "recharts"; import { FlexibleReportChart, flexibleChartDataSchema } from "./flexibleReportChart"; -export const slideLayoutId = "data-analysis-insight-bar-slide"; -export const slideLayoutName = "Data Analysis Insight Bar Slide"; +export const slideLayoutId = "title-description-chart-slide"; +export const slideLayoutName = "Title Description Chart Slide"; export const slideLayoutDescription = - "A slide with a title at the top, a single featured insight block on the left containing an icon badge and a paragraph, and a chart on the right with a legend below it."; + "A slide with a title at the top, description text in left and chart in the right."; export const Schema = z.object({ - title: z.string().min(3).max(12).default("Data Analysis").meta({ + title: z.string().min(3).max(80).default("Data Analysis").meta({ description: "Slide title shown at the top-left.", }), insightIcon: z @@ -32,13 +32,13 @@ export const Schema = z.object({ }), insightBody: z .string() - .min(80) + .min(30) .max(320) .default( "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut alut enim ad minima veniam, quis. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut alut enim ad minima veniam, quis" ) .meta({ - description: "Featured insight paragraph shown in the left content area.", + description: "Description text shown in the left content area.", }), chartData: flexibleChartDataSchema.default({ type: "line-dual", diff --git a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisLineStatsSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisLineStatsSlide.tsx index 5f16534c..05f0fb6f 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisLineStatsSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisLineStatsSlide.tsx @@ -19,18 +19,18 @@ const MetricSchema = z.object({ }); const StatColumnSchema = z.object({ - metrics: z.array(MetricSchema).min(2).max(2).meta({ + metrics: z.array(MetricSchema).min(0).max(2).meta({ description: "Two stacked metrics shown in one stat card.", }), }); -export const slideLayoutId = "data-analysis-line-stats-slide"; -export const slideLayoutName = "Data Analysis Line Stats Slide"; +export const slideLayoutId = "title-chart-metrics-cards-slide"; +export const slideLayoutName = "Title Chart with Metrics Cards Slide"; export const slideLayoutDescription = - "A slide with a title at the top, a two-series line chart in the left content area, and two tall metric cards arranged side by side on the right. Each metric card contains two stacked metric blocks."; + "A slide with a title at the top, chart in the left content area, and optional metric cards arranged side by side on the right."; export const Schema = z.object({ - title: z.string().min(3).max(12).default("Data Analysis").meta({ + title: z.string().min(3).max(80).default("Data Analysis").meta({ description: "Slide title shown at the top-left.", }), seriesALabel: z.string().min(3).max(20).default("Category A").meta({ @@ -56,7 +56,7 @@ export const Schema = z.object({ }), statColumns: z .array(StatColumnSchema) - .min(2) + .min(1) .max(2) .default([ { @@ -73,7 +73,7 @@ export const Schema = z.object({ }, ]) .meta({ - description: "Two stat cards shown on the right side of the slide.", + description: "Stat/metric cards shown on the right side of the slide.", }), }); diff --git a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisListSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisListSlide.tsx index b94037ee..8875d162 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisListSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/DataAnalysisListSlide.tsx @@ -10,10 +10,10 @@ const AnalysisItemSchema = z.object({ }), }); -export const slideLayoutId = "data-analysis-list-slide"; -export const slideLayoutName = "Data Analysis List Slide"; +export const slideLayoutId = "bullet-list-with-icon-title-description-slide"; +export const slideLayoutName = "Bullet List with Icon Title Description Slide"; export const slideLayoutDescription = - "A slide with a title at the top and a two-column list of analysis points underneath. Each point contains a small circular icon badge, a short title on the same row, and a supporting description directly below."; + "A slide with a title at the top and a two-column list of bullets points underneath. Each point contains a small circular icon badge, a short title on the same row, and a supporting description directly below."; export const Schema = z.object({ title: z.string().min(3).max(12).default("Data Analysis").meta({ @@ -42,7 +42,7 @@ export const Schema = z.object({ { title: "Title 5", description: "Ut enim ad minima veniam, quis." }, ]) .meta({ - description: "Six analysis items distributed across two columns.", + description: "List of points contains a title and description.", }), }); diff --git a/electron/servers/nextjs/app/presentation-templates/Report/IntroSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/IntroSlide.tsx index e0925d55..bbd15bb7 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/IntroSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/IntroSlide.tsx @@ -1,18 +1,26 @@ import * as z from "zod"; export const Schema = z.object({ - title: z.string().min(1).max(12).default("Company's "), - subtitle: z.string().min(1).max(15).default("Report"), - name: z.string().min(1).max(10).default("John Doe"), - position: z.string().min(1).max(20).default("Company Name | Strategy, Content, growth"), + titleFirstLine: z.string().min(1).max(12).default("Company's ").meta({ + description: "First half of title or heading", + }), + titleSecondLine: z.string().min(1).max(12).default("Annual Report").meta({ + description: "Second half of title or heading", + }), + name: z.string().min(1).max(10).optional().default("John Doe").meta({ + description: "Name of the presenter/individual/company/organization.", + }), + position: z.string().min(1).max(20).default("Company Name | Strategy, Content, growth").meta({ + description: "Position or role of the presenter or address of the company/organization.", + }), }) export type SchemaType = z.infer; export const slideLayoutId = "intro-slide"; -export const slideLayoutName = "Intro Slide"; +export const slideLayoutName = "Intro/Cover Slide"; export const slideLayoutDescription = - "A report cover slide with decorative corner accents, a centered two-line title section, a divider directly beneath the title, and a presenter information block below the divider containing a name line and a supporting role or company line."; + "A cover/intro slide with a two-line title section, a divider directly beneath the title, and a presenter information block below the divider containing a name line and a supporting role or company line."; const IntroSlide = ({ data }: { data: Partial }) => { - const { title, subtitle, name, position } = data; + const { titleFirstLine, titleSecondLine, name, position } = data; return (
}) => { className="text-[#232223] text-[133px] italic text-center font-bold capitalize tracking-[-2.8px]" style={{ color: "var(--background-text,#232223)" }} > - {title} + {titleFirstLine}

- {subtitle} + {titleSecondLine}

}) => { className={`${isActive ? "text-white" : "text-[#157CFF]"} text-[42px] font-medium tracking-[0.18em]`} style={{ color: isActive ? "var(--primary-text,#ffffff)" : "var(--primary-color,#157CFF)" }} > - {item.stepNumber} + {item.bulletNumber}
@@ -130,8 +130,6 @@ const MilestoneSlide = ({ data }: { data: Partial }) => { ); })} - - ); diff --git a/electron/servers/nextjs/app/presentation-templates/Report/PerformanceSnapshotSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/PerformanceSnapshotSlide.tsx index e225a652..a1802442 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/PerformanceSnapshotSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/PerformanceSnapshotSlide.tsx @@ -5,10 +5,10 @@ const MetricSchema = z.object({ value: z.string().min(1).max(6).meta({ description: "Primary metric value shown in the pill.", }), - label: z.string().max(10).optional().meta({ + label: z.string().max(20).optional().meta({ description: "Short label shown below the metric value.", }), - description: z.string().min(6).max(20).optional().meta({ + description: z.string().min(6).max(50).optional().meta({ description: "Supporting metric description shown below the label.", }), }); @@ -19,18 +19,18 @@ const MetricColumnSchema = z.object({ }), }); -export const slideLayoutId = "performance-snapshot-slide"; -export const slideLayoutName = "Performance Snapshot Slide"; +export const slideLayoutId = "title-metrics-slide"; +export const slideLayoutName = "Title Metrics Slide"; export const slideLayoutDescription = - "A slide with a title at the top and three tall metric cards arranged horizontally below it. Each card can contain one or two stacked metric blocks, and each block includes a main value, a label, and a supporting description."; + "A slide with a title at the top and tall metric cards arranged horizontally below it. Each card can contain one or two stacked metric blocks, and each block includes a main value, a label, and a supporting description."; export const Schema = z.object({ - title: z.string().min(3).max(12).default("Performance Snapshot").meta({ + title: z.string().min(3).max(80).default("Performance Snapshot").meta({ description: "Slide title shown at the top-left.", }), columns: z .array(MetricColumnSchema) - .min(2) + .min(1) .max(4) .default([ { @@ -50,12 +50,7 @@ export const Schema = z.object({ { value: "25K", label: "Students", description: "Ut enim ad minima" }, { value: "25K", label: "Students", description: "Ut enim ad minima" }, ], - }, - { - metrics: [ - { value: "25K", label: "Students", description: "Ut enim ad minima" }, - ], - }, + } ]) .meta({ description: "Three metric columns displayed beneath the title.", @@ -77,8 +72,6 @@ function StatPill({ metrics: StatMetric[]; }) { - - return (
}) => {
-
+
{columns?.map((column, index) => ( {
{visibleCards?.map((card, index) => ( ))} @@ -141,8 +141,8 @@ const SolutionSlide = ({ data }: SolutionSlideProps) => {
{visibleCards?.map((card, index) => ( ))} diff --git a/electron/servers/nextjs/app/presentation-templates/Report/TeamSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/TeamSlide.tsx index 5fc59aac..0cee7914 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/TeamSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/TeamSlide.tsx @@ -2,11 +2,11 @@ import * as z from "zod"; const MemberSchema = z.object({ - title: z.string().min(2).max(12).meta({ - description: "Short role or title shown above the member name.", + subtext: z.string().min(2).max(40).meta({ + description: "Subtext for the image.", }), - name: z.string().min(2).max(20).meta({ - description: "Member name shown at the bottom of the card.", + title: z.string().min(2).max(40).meta({ + description: "Title/name/subject for the image", }), image: z.object({ __image_url__: z.string().default("https://presenton-public.s3.ap-southeast-1.amazonaws.com/static/images/placeholder.jpg"), @@ -17,10 +17,10 @@ const MemberSchema = z.object({ }), }); -export const slideLayoutId = "team-slide"; -export const slideLayoutName = "Team Slide"; +export const slideLayoutId = "horizontal-height-spanning-images-with-title-slide"; +export const slideLayoutName = "Horizontal Height Spanning Images with Title Slide"; export const slideLayoutDescription = - "A team slide made of five vertical portrait cards placed side by side from edge to edge. Each card uses a full-height image background with a content overlay at the bottom containing a short title line and a larger name line."; + "A slide of portrait cards placed side by side from edge to edge. Each card uses a full-height image background with a content overlay at the bottom containing a short subtext line and a larger title line."; export const Schema = z.object({ members: z @@ -29,40 +29,40 @@ export const Schema = z.object({ .max(5) .default([ { - title: "Title", - name: "Lanny LA", + subtext: "Title", + title: "Lanny LA", image: { __image_url__: "https://presenton-public.s3.ap-southeast-1.amazonaws.com/static/images/placeholder.jpg", __image_prompt__: "Professional portrait of a male team member", }, }, { - title: "Title", - name: "Lanny LA", + subtext: "Title", + title: "Lanny LA", image: { __image_url__: "https://presenton-public.s3.ap-southeast-1.amazonaws.com/static/images/placeholder.jpg", __image_prompt__: "Professional portrait of a female team member", }, }, { - title: "Title", - name: "Lanny LA", + subtext: "Title", + title: "Lanny LA", image: { __image_url__: "https://presenton-public.s3.ap-southeast-1.amazonaws.com/static/images/placeholder.jpg", __image_prompt__: "Professional portrait of a business manager", }, }, { - title: "Title", - name: "Lanny LA", + subtext: "Title", + title: "Lanny LA", image: { __image_url__: "https://presenton-public.s3.ap-southeast-1.amazonaws.com/static/images/placeholder.jpg", __image_prompt__: "Professional portrait of a senior employee", }, }, { - title: "Title", - name: "Lanny LA", + subtext: "Title", + title: "Lanny LA", image: { __image_url__: "https://presenton-public.s3.ap-southeast-1.amazonaws.com/static/images/placeholder.jpg", __image_prompt__: "Professional portrait of a young executive", @@ -70,7 +70,7 @@ export const Schema = z.object({ }, ]) .meta({ - description: "Five team members rendered as portrait cards.", + description: "List of team members shown as portrait cards. Each member contains a title, subtext, and image.", }), }); diff --git a/electron/servers/nextjs/app/presentation-templates/Report/IntroductionImageSlide.tsx b/electron/servers/nextjs/app/presentation-templates/Report/TitleDescriptionImageSlide.tsx similarity index 90% rename from electron/servers/nextjs/app/presentation-templates/Report/IntroductionImageSlide.tsx rename to electron/servers/nextjs/app/presentation-templates/Report/TitleDescriptionImageSlide.tsx index 58f572fa..23023436 100644 --- a/electron/servers/nextjs/app/presentation-templates/Report/IntroductionImageSlide.tsx +++ b/electron/servers/nextjs/app/presentation-templates/Report/TitleDescriptionImageSlide.tsx @@ -1,14 +1,14 @@ import * as z from "zod"; -export const slideLayoutId = "introduction-image-slide"; -export const slideLayoutName = "Introduction Image Slide"; +export const slideLayoutId = "title-description-image-slide"; +export const slideLayoutName = "Title Description Image Slide"; export const slideLayoutDescription = - "A slide with a title at the top-left, a paragraph block beneath the title, a short bulleted list in the lower-left area, and a large supporting image anchored on the right side of the slide."; + "A slide with a title at the top-left, a paragraph block beneath the title, a large supporting image anchored on the right side of the slide."; export const Schema = z.object({ title: z.string().min(3).max(12).default("Introduction").meta({ - description: "Slide title shown at the top-left.", + description: "Title/heading of the slide", }), body: z.string().max(250).default( "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut alut enim ad minima veniam, quis. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut alut enim ad minima veniam, quis" @@ -16,9 +16,10 @@ export const Schema = z.object({ description: "Primary paragraph shown under the title.", }), bullets: z - .array(z.string().max(35)) - + .array(z.string().max(100)) + .min(0) .max(4) + .optional() .default([ "Ut enim ad minima veniam, quis nostrum", "Exercitationem ullam corporis suscipit", @@ -26,7 +27,7 @@ export const Schema = z.object({ "exercitationem ullam corporis suscipit", ]) .meta({ - description: "Bullet list shown in the lower-left area.", + description: "Optional bullet list shown after the description if required.", }), featureImage: z.object({ __image_url__: z.string(),