content/auto-draft
needs attentionviewing older commitff69645 · incrementalpre-PRreviewed 2026-07-28 18:21 UTC0H · 6M · 8L · 15I- Purpose
- Content marketing branch — publishing informational blog posts about CFE tariffs and billing to attract organic search traffic from Mexican industrial energy consumers.
- Goal
- Publish the 'factor de potencia CFE' blog post with real data from 70,843 CFE receipts, including interactive SVG charts and a sticky table of contents.
- Sub-goals
- SG-1: New MDX blog post (factor-de-potencia-cfe.mdx) — full article with FAQ, formulas, corrective guidance
- SG-2: New SVG chart components (PowerTriangleDiagram, FpPenaltyChart, FpBillCallouts, FpPenaltyShareChart) for the post
- SG-3: Table of contents — sticky xl+ sidebar + inline mobile fallback added to all blog posts
- SG-4: Pre-authored charts for future posts (GDMTH, GDMTO vs GDMTH, solar impact) added to charts.tsx
- SG-5: CTA buttons migrated from raw <a> to Button asChild + Link
- What
- New blog post about power factor penalties (CFE tariffs) with proprietary data from 70,843 receipts. Layout restructured to article+aside with sticky TOC sidebar. MDX components expanded. CTA buttons unified via shadcn Button. DemandVsConsumptionChart reworked with ToU band overlay.
- Why
- Informational content cluster targeting 'factor de potencia CFE' search keyword. Real data (29.1% of bills penalized; avg penalty $16,462 MXN) differentiates from generic explainers.
- Areas
- apps/web/content+190−1apps/web/src/app/(marketing)/blog+31−6apps/web/src/components/blog+233−1
- Blast
- 4 files, +424/−4 lines, all in apps/web. Zero backend/domain/infra changes.
Findings · 14
correctness2
getToc() does not handle tilde code fences (~~~)
apps/web/src/app/(marketing)/blog/[slug]/page.tsx
Fence-detection regex /^\s*```/ only matches backtick fences. A heading-like line inside a ~~~ block would be incorrectly included in the TOC, producing a deep-link that goes nowhere. Latent bug — not triggered by current posts.
calendar.yml status 'review' but MDX draft:false — post is live
apps/web/content/calendar.yml
The calendar entry for factor-de-potencia-cfe still shows status: review while the MDX has draft: false and the post is already being served. Update calendar to status: published.
conventions2
getToc helper defined inline in page file; belongs in src/lib/
apps/web/src/app/(marketing)/blog/[slug]/page.tsx:61
getToc uses GithubSlugger + code-fence state machine and is tightly coupled to rehypeHeadingIds. Convention for shared utilities is src/lib/ (e.g. apps/web/src/lib/blog-toc.ts alongside blog.ts).
article element children inconsistently indented
apps/web/src/app/(marketing)/blog/[slug]/page.tsx:203
Children of <article> are at same indentation level as the opening tag instead of 2-space nested. Minor formatting inconsistency introduced when the article wrapper was added.
tests3
getToc() pure function has no tests
apps/web/src/app/(marketing)/blog/[slug]/page.tsx:61
Code-fence toggle logic is testable and non-trivial. Blast radius: wrong/empty TOC (degraded UX, not crash). The pattern of testing pure helpers is established in this codebase (charts.calculations.test.ts).
Frontmatter ## lines not filtered by getToc — potential silent TOC corruption
apps/web/src/app/(marketing)/blog/[slug]/page.tsx:61
getToc has no frontmatter guard. If post.content includes the raw --- block, any ## key in YAML frontmatter would appear as a TOC entry.
DemandVsConsumptionChart rework has no snapshot guard
apps/web/src/components/blog/charts.tsx:83
Significant rework of existing chart (new ToU band overlay). Math layer is tested; SVG structure has no regression net.
improvement5
Duplicated TOC rendering logic (inline vs sidebar)
apps/web/src/app/(marketing)/blog/[slug]/page.tsx
Mobile inline TOC and xl+ sidebar TOC iterate over toc with nearly identical markup and link logic. Extract a shared TocList component to make future changes a single edit.
getToc() reimplements heading extraction already handled by remark/rehype pipeline
apps/web/src/app/(marketing)/blog/[slug]/page.tsx
A remark plugin would reuse the existing parse pass, guarantee identical slug generation, and remove the separate regex pass over raw MDX source.
Color constants duplicated inside chart component bodies
apps/web/src/components/blog/charts.tsx
HELIOTROPE, VIOLET, GREEN, CYAN, AMBER, MUTED are module-level constants but some chart components reference them inline. Consistent use of the named constants keeps the palette as a single-point edit.
Hardcoded SVG dimensions (w=720) across all chart components
apps/web/src/components/blog/charts.tsx
A shared CHART_WIDTH constant would make coordinated width changes a one-line edit.
mdxComponents object is unwieldy as a single large inline literal
apps/web/src/app/(marketing)/blog/[slug]/page.tsx
14+ entries in one dense expression. A named constant or dedicated mdx-components.ts would improve readability and enable reuse.
seo2
Meta description 2 chars over the 160-char limit
apps/web/content/blog/factor-de-potencia-cfe.mdx:4
Description is 162 chars (target 150–160). Trim 2 chars to avoid SERP truncation. Suggestion: drop 'con capacitores' from the end.
Article JSON-LD missing image field
apps/web/src/app/(marketing)/blog/[slug]/page.tsx:134
Article schema has no 'image' field. Google recommends it for rich results. The og-image URL already exists; add { '@type': 'ImageObject', url: 'https://batuenergy.com/og-image.png', width: 1200, height: 630 }. Affects all posts.
History · 14 commits
- c27ea57needs attentionincremental3H · 5M · 4L2026-08-04 17:46
- ff69645needs attentionincremental0H · 6M · 8L2026-07-28 18:21current
- 0257d74safeincremental0H · 0M · 0L2026-07-20 23:00
- 0795a9dsafeincremental0H · 0M · 2L2026-07-20 22:42
- 5c57414needs attentionincremental2H · 7M · 10L2026-07-20 22:29
- 5a57a8fneeds attentionincremental0H · 5M · 8L2026-07-20 17:14
- cc9056eneeds attentionfull1H · 3M · 9L2026-07-20 16:40
- 8b79d33needs attentionincremental5H · 7M · 11L2026-07-14 18:10
- f0c337cneeds attentionincremental1H · 1M · 5L2026-07-14 17:15
- 5c9de97needs attentionincremental0H · 5M · 7L2026-07-14 17:02
- 92cce08needs attentionincremental1H · 4M · 3L2026-07-14 02:00
- b7dd610needs attentionincremental0H · 6M · 7L2026-07-14 01:43
- 8c43554needs attentionfull0H · 2M · 1L2026-07-14 01:15
- 2149391blockedfull8H · 6M · 7L2026-07-10 17:30