Skip to content

feat: increase test coverage#2

Merged
thedaviddias merged 8 commits intomainfrom
feat/increase-test-coverage
Feb 7, 2026
Merged

feat: increase test coverage#2
thedaviddias merged 8 commits intomainfrom
feat/increase-test-coverage

Conversation

@thedaviddias
Copy link
Copy Markdown
Owner

@thedaviddias thedaviddias commented Feb 7, 2026

Note

Medium Risk
Adds a new server-side MDX content pipeline and changes upload/metadata hooks and fork upload flow, which could affect production rendering and wizard behavior. Most other changes are test/mocking/CI hygiene, lowering regression risk but increasing surface area.

Overview
Adds an MDX-backed Guides system: guide articles are now loaded from content/guides/*.mdx via a new lib/guides.ts, rendered through a new dynamic route app/guides/[slug]/page.tsx with a responsive table-of-contents (GuideLayout/TableOfContents), custom MDX component styling/heading anchors, and ArticleSchema JSON-LD. The Guides index and sitemap.ts are updated to enumerate guides dynamically (including published/updated dates and reading time), and the previous hardcoded guide pages are removed in favor of MDX content.

Improves the upload wizard fork flow by extracting the review UI into a reusable ReviewStep component that supports editable mode for forks (edit/preview toggle + attribution) and adjusts wizard step readiness/initial step logic accordingly.

Significantly increases automated test coverage across UI components and hooks, adds test stubs for Sentry/Plausible, raises Vitest coverage thresholds, and includes several robustness fixes validated by tests (e.g., useSoulMetadata effect dependency stabilization + safer tag addition, improved useGitHubImport URL parsing and detection cases, and useUploadDraft debounce/expiry/error handling). Also adds repo hygiene/config updates: Dependabot config, GitHub issue/PR templates + funding, and simplifies pnpm setup action usage.

Written by Cursor Bugbot for commit 785c5f2. This will update automatically on new commits. Configure here.

- Add next-mdx-remote, gray-matter, reading-time for MDX content
- Move guide content to apps/web/content/guides/*.mdx with frontmatter
- Add lib/guides.ts: getGuide, getAllGuides, getGuidesSlugs, heading extraction
- Add GuideLayout, TableOfContents (sticky sidebar + mobile collapsible)
- Add mdx-components for headings with anchors and internal Link
- Replace static guide pages with dynamic app/guides/[slug]/page.tsx
- Add ArticleSchema JSON-LD and ogType article for guide pages
- Sitemap: guide URLs from getAllGuides() with lastModified
- Fix test lint/type (button type, non-null, ownerHandle, React import)
Fork mode was broken: sourceValidation required files but fork mode
only sets content directly via setContent(), so the wizard was stuck
on the Source step with the Continue button disabled.

- Add isForkMode check to wizardReadiness.source so forked content
  passes validation without requiring file uploads
- Start wizard at review step in fork mode (skip Source step)
- Extract ReviewStep into its own component with edit/preview toggle
- Fork mode opens in edit mode so users can remix the content
- Show fork attribution banner ("Forking from X") in review step
- Fix back-button nav: show Cancel on review step in fork mode
- Add 15 tests for ReviewStep (read-only + fork mode)
- Add 6 fork-mode flow tests for useWizardNavigation
…SoulMetadata, increase test coverage to 77%

TDD uncovered two production bugs in useSoulMetadata:

1. Infinite re-render loop: useEffect included normalizedFiles in its
   dependency array. When the parent passed a fresh [] on each render,
   it triggered the effect endlessly. Fixed by reading normalizedFiles
   via a ref instead of as a dependency.

2. Stale closure in addTag: the useCallback read selectedTags from
   the closure to check duplicates/max limit, but during React's
   batched updates the value was stale — allowing duplicates and
   exceeding the 5-tag cap. Fixed by moving guards inside the
   setSelectedTags updater function.

Also:
- Add global test mocks for @sentry/nextjs and next-plausible (alias-based)
- Fix Vitest 4 deprecated poolOptions → top-level maxForks
- Fix flaky copy-button test (async clipboard not flushed in act)
- Add new TDD tests: tag-input, faq-content, validation security edge cases
- Improve use-github-import tests with helper for async state+detect
- Coverage: 77% statements, 68% branches, 72% functions, 78% lines
Statements 40→75, branches 35→65, functions 40→70, lines 40→75.
Set a few points below actual coverage to allow small buffer.
… issue forms

The old PR template was for soul submissions which happen through the
website, not PRs. Replaced with a minimal What/Why/How-to-test template
for code contributions.

Added YAML-based issue forms:
- Bug report (structured fields, browser dropdown, screenshot upload)
- Feature request (problem, solution, alternatives)
- config.yml disabling blank issues, linking to Discussions and Discord
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
souls-directory Ignored Ignored Feb 7, 2026 1:34am

@thedaviddias thedaviddias changed the title Feat/increase test coverage feat: increase test coverage Feb 7, 2026
Comment thread apps/web/lib/guides.ts
Weekly on Mondays, grouped by prod/dev (minor+patch), max 5 npm PRs
and 3 Actions PRs. Major version bumps still get individual PRs.
Labels applied for easy filtering.
@thedaviddias thedaviddias force-pushed the feat/increase-test-coverage branch from 0a0e267 to e98feae Compare February 7, 2026 01:25
- Add lib/slugify.ts and use in guides + mdx-components so TOC hrefs match h2/h3 ids
- Normalize heading text in extractHeadings (strip markdown links/bold/code) to match React output
- Fix biome overrides to use **/convex-api.ts and **/convex-server.ts so they match when lint runs from apps/web in CI
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread apps/web/lib/guides.ts
@thedaviddias thedaviddias merged commit bdfb638 into main Feb 7, 2026
3 of 4 checks passed
@thedaviddias thedaviddias deleted the feat/increase-test-coverage branch February 7, 2026 01:40
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