← all branches

content/auto-draft

needs attentionviewing older commit
ff69645 · incrementalpre-PRreviewed 2026-07-28 18:21 UTC0H · 6M · 8L · 15I
The branch
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
The changes (whole branch)
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+1901apps/web/src/app/(marketing)/blog+316apps/web/src/components/blog+2331
Blast
4 files, +424/−4 lines, all in apps/web. Zero backend/domain/infra changes.
pre-PR branch content-only no backend changes
CI· No PR open — no CI checks to readCodeRabbit· No .coderabbit.yaml in repo

Findings · 14

correctness2

medium

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.

low

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

medium

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).

low

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

medium

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).

low

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.

low

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

medium

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.

medium

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.

medium

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.

low

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.

low

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

low

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.

low

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

  1. c27ea57needs attentionincremental3H · 5M · 4L2026-08-04 17:46
  2. ff69645needs attentionincremental0H · 6M · 8L2026-07-28 18:21current
  3. 0257d74safeincremental0H · 0M · 0L2026-07-20 23:00
  4. 0795a9dsafeincremental0H · 0M · 2L2026-07-20 22:42
  5. 5c57414needs attentionincremental2H · 7M · 10L2026-07-20 22:29
  6. 5a57a8fneeds attentionincremental0H · 5M · 8L2026-07-20 17:14
  7. cc9056eneeds attentionfull1H · 3M · 9L2026-07-20 16:40
  8. 8b79d33needs attentionincremental5H · 7M · 11L2026-07-14 18:10
  9. f0c337cneeds attentionincremental1H · 1M · 5L2026-07-14 17:15
  10. 5c9de97needs attentionincremental0H · 5M · 7L2026-07-14 17:02
  11. 92cce08needs attentionincremental1H · 4M · 3L2026-07-14 02:00
  12. b7dd610needs attentionincremental0H · 6M · 7L2026-07-14 01:43
  13. 8c43554needs attentionfull0H · 2M · 1L2026-07-14 01:15
  14. 2149391blockedfull8H · 6M · 7L2026-07-10 17:30