Skip to content

chore(use-cases): drop Detail wrapper + add markdown renderer tests#18

Merged
mastermanas805 merged 1 commit into
mainfrom
chore/use-case-detail-cleanup
May 11, 2026
Merged

chore(use-cases): drop Detail wrapper + add markdown renderer tests#18
mastermanas805 merged 1 commit into
mainfrom
chore/use-case-detail-cleanup

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Drops the redundant Detail h2 wrapper on use-case detail pages so body sections render as proper h2 peers, and adds 26 unit tests for the shared markdown renderer covering blocks/inline/href-safety. All 26 tests pass.

Two related cleanups:

1. UseCaseDetailPage no longer wraps the body in a redundant
   "Detail" <h2> section. With every case now carrying its own
   ## Sample agent prompt / ## Steps to follow / ## Why this
   works / ## Related cases headings, the wrapper was forcing
   those to render as h3 — a misleading nesting level that
   pushed real semantic structure too deep. Body now renders
   at baseHeading=h2 so its sections are peers of the page's
   own h1 hero. The auto-generated "How to set it up" and
   "Why this is useful" sections move into an AutoDetail
   fallback component used only when a case has no body yet
   (currently no cases, kept for future resilience).

2. New unit tests at src/lib/markdown.test.tsx covering the
   shared markdown renderer — every block construct (## / ###
   / fenced code / -/* bullets / 1./2. ordered lists / >
   blockquote / | tables / paragraphs), every inline construct
   (**bold**, \`code\`, [text](url)), the href-safety check
   (rejects javascript:, data:, vbscript:; allows /, #,
   http(s)://), and configurable baseHeading. 26 tests, all
   pass in ~4ms. Closes the test-coverage gap the dashboard
   sweep agent flagged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 99ece28 into main May 11, 2026
1 of 2 checks passed
@mastermanas805 mastermanas805 deleted the chore/use-case-detail-cleanup branch May 11, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant