-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add FAQ sections to project pages #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Create ProjectFAQ component with schema markup for better SEO - Generate 7 dynamic FAQs per project based on repository data - Include expand/collapse UI with smooth interactions - Add FAQ section to insights sidebar for both desktop and mobile - Implement proper loading states and error handling - Questions cover contributor count, activity, trends, and patterns - Updates dynamically when time range changes Addresses #270 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Brian Douglas <[email protected]>
✅ Deploy Preview for contributor-info ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@claude expand on this to include the llm service and embeddings to answer these questions as well as adding the content to the sitemap |
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
Claude finished @bdougie's task —— View job PR Review: FAQ Sections with LLM IntegrationI've completed a comprehensive review of PR #331. This implementation adds significant value by introducing AI-powered FAQ functionality with proper SEO integration. Here's my detailed analysis: Review Checklist
🎯 Overall Assessment: APPROVE with Minor RecommendationsThis is a well-architected feature that follows good patterns and adds real value. The code quality is high with proper error handling, graceful fallbacks, and good separation of concerns. ✅ StrengthsArchitecture & Design
Security Implementation
User Experience
SEO & Schema Markup
🔍 Detailed Code Review
|
🚀 Deployed on https://6895018547e2040635ee0ddc--designcont.netlify.app |
🚀 Performance Report📊 Lighthouse Audit✅ Lighthouse tests completed for: 📦 Bundle AnalysisPerformance budget checks completed. See workflow summary for details. 🎯 Core Web Vitals Targets
📈 Next Steps
|
- Add faq-service.ts with OpenAI-powered dynamic answers - Implement semantic question matching using MiniLM embeddings - Enhanced project-faq.tsx with AI indicators and confidence scores - Add FAQ sitemap generator for improved SEO - Include FAQ URLs in main sitemap for major repositories - Support graceful fallback to static answers when AI unavailable - Add structured data and citations for better search visibility Co-authored-by: Brian Douglas <[email protected]>
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
- Fix TypeScript errors in project-faq.tsx: - Remove unused imports (cn, FAQAnswer type) - Fix RepoStats type usage (removed non-existent health/activity properties) - Properly handle pr.author object structure for contributor indexing - Remove unsupported title prop from Sparkles icon - Fix TypeScript errors in faq-service.ts: - Remove unused imports and variables - Fix type casting for cache service - Handle contributor data structure properly in reduce operations - Fix sort function type assertions - Work around Rollup conditional expression bug: - Temporarily disable treeshaking to fix build error - Added TODO to re-enable once Rollup issue is resolved - Reference: rollup/rollup#5747 Build now completes successfully with all TypeScript errors resolved.
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
…rnaries Root cause: Rollup 4.45.0 has a bug with nested ternary operators during treeshaking that causes 'Cannot add property 0, object is not extensible' error. Changes: - Simplified complex nested ternary in env.ts to avoid triggering bug - Refactored nested ternaries in project-faq.tsx to if-else statements - Disabled treeshaking as temporary workaround for remaining nested ternaries - Added detailed comments explaining the Rollup bug and workaround Impact: - Build now completes successfully - Bundle size increased to ~5.5MB (exceeds 5MB budget) due to disabled treeshaking - Performance Budget Check will fail until treeshaking is re-enabled Next steps: - Upgrade Rollup when fix is released - Or refactor all remaining nested ternaries across codebase - Then re-enable treeshaking to reduce bundle size References: rollup/rollup#5747
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
…ctions Refactored nested ternary operators to use cleaner patterns: - web-vitals-monitoring.ts: Use lookup objects for rating emojis/colors - pagespeed-insights.ts: Extract helper functions for delta formatting - badge-generator.tsx: Use color constants and helper functions - env.ts: Simplify complex nested conditional logic These changes reduce complexity and make the code more maintainable. However, treeshaking still needs to be disabled due to remaining nested ternaries throughout the codebase. The Rollup bug (issue #5747) is triggered by ANY nested ternary, so a complete refactor of all ternaries would be needed to re-enable treeshaking without upgrading Rollup. Impact: - Cleaner, more maintainable code - Partial progress toward fixing Rollup issue - Bundle size still exceeds 5MB limit due to disabled treeshaking
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
Implemented code-splitting optimizations: - Lazy load all insights sidebar sections (FAQ, Health, Recommendations, etc) - Dynamic import heavy embeddings/transformers library in FAQ service - Add loading skeletons for better UX during lazy loading - Move insights components out of main bundle Impact: - FAQ and embeddings now load only when needed (~820KB saved from initial load) - Improved initial page load performance - Better code organization with clear async boundaries Trade-offs: - Bundle still exceeds 5MB due to disabled treeshaking (Rollup bug workaround) - Treeshaking must remain disabled until Rollup issue #5747 is fixed - Performance Budget Check will continue to fail Next steps: - Consider downgrading Rollup to avoid the bug - Or systematically replace ALL nested ternaries across codebase - Continue identifying more components for lazy loading
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
The same Rollup 4.45.0 bug that affects the main build also affects Storybook builds. Added treeshake: false to the Storybook viteFinal configuration to match the main build workaround. This fixes the 'Cannot add property 0, object is not extensible' error during Storybook builds in CI. Impact: - Storybook builds now complete successfully - Build and Deploy Storybook workflow should pass - Slightly larger Storybook bundle (acceptable for documentation) Note: This workaround can be removed once Rollup issue #5747 is fixed or all nested ternaries are refactored.
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
Rollup 4.45.0 Treeshaking Bug WorkaroundThis PR includes workarounds for a critical bug in Rollup 4.45.0 that causes build failures when treeshaking encounters nested ternary operators. Full details documented in #333. Changes Applied:
Impact:
Next Steps:
See #333 for comprehensive documentation of the issue, affected files, and long-term solutions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic analysis
5 issues found across 14 files • Review in cubic
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
{section.id === "recommendations" && ( | ||
<Recommendations owner={owner} repo={repo} timeRange={timeRange} /> | ||
)} | ||
{section.id === "faq" && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lazy component ProjectFAQ is rendered here without being wrapped in a fallback, which will cause a runtime crash when this branch mounts on mobile.
Prompt for AI agents
Address the following comment on src/components/insights/insights-sidebar.tsx at line 197:
<comment>Lazy component ProjectFAQ is rendered here without being wrapped in a <Suspense> fallback, which will cause a runtime crash when this branch mounts on mobile.</comment>
<file context>
@@ -158,21 +178,26 @@ export function InsightsSidebar({ className }: InsightsSidebarProps) {
</div>
</div>
- {/* Section content */}
+ {/* Section content - lazy loaded on demand */}
{activeSection === section.id && owner && repo && (
<div className="mt-3">
- {section.id === "summary" && (
- <RepositorySummary owner={owner} repo={repo} timeRange={timeRange} />
</file context>
} | ||
|
||
function getLotteryFactorColor(factor: number | undefined): string { | ||
if (!factor) return COLORS.lotteryFactor.unavailable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lotteryFactor value of 0 is incorrectly considered "unavailable" because the guard uses !factor
instead of an explicit undefined/null check, leading to wrong badge colours.
Prompt for AI agents
Address the following comment on src/components/embeddable-widgets/badge-generator.tsx at line 71:
<comment>A lotteryFactor value of 0 is incorrectly considered "unavailable" because the guard uses `!factor` instead of an explicit undefined/null check, leading to wrong badge colours.</comment>
<file context>
@@ -39,34 +39,67 @@ const BADGE_STYLES = {
},
};
+// Color schemes for badge metrics
+const COLORS = {
+ contributors: "#007ec6",
+ pullRequests: "#28a745",
+ mergeRate: {
+ high: "#28a745", // > 80%
</file context>
if (!factor) return COLORS.lotteryFactor.unavailable; | |
if (factor === undefined) return COLORS.lotteryFactor.unavailable; |
switch (question.id) { | ||
case 'contributor-count': | ||
if (repositoryData.pullRequests) { | ||
const count = new Set(repositoryData.pullRequests.map(pr => pr.author)).size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counts contributors using pr.author object reference, which treats every object instance as unique and ignores author.login/ user.login, leading to inflated or NaN contributor counts in the fallback answer.
Prompt for AI agents
Address the following comment on src/lib/llm/faq-service.ts at line 314:
<comment>Counts contributors using pr.author object reference, which treats every object instance as unique and ignores author.login/ user.login, leading to inflated or NaN contributor counts in the fallback answer.</comment>
<file context>
@@ -0,0 +1,485 @@
+/**
+ * FAQ Service with LLM-powered dynamic answers and embeddings
+ * Extends existing LLM service to provide intelligent FAQ responses
+ */
+
+import { openAIService, type LLMInsight } from './openai-service';
+import { cacheService } from './cache-service';
+// Dynamically import embeddings to avoid bundling heavy transformers library
+// import { generateEmbedding } from '../../../app/services/embeddings';
</file context>
const count = new Set(repositoryData.pullRequests.map(pr => pr.author)).size; | |
const count = new Set(repositoryData.pullRequests.map((pr: any) => pr.author?.login || pr.user?.login || 'unknown')).size; |
/** | ||
* Calculate FAQ page priority based on repository activity | ||
*/ | ||
export function calculateFAQPriority( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calculateFAQPriority is currently unused – consider removing it or integrating it where priority is set.
Prompt for AI agents
Address the following comment on src/lib/sitemap/faq-sitemap-generator.ts at line 174:
<comment>calculateFAQPriority is currently unused – consider removing it or integrating it where priority is set.</comment>
<file context>
@@ -0,0 +1,204 @@
+/**
+ * FAQ Sitemap Generator - Adds FAQ pages to sitemap for SEO
+ * Generates structured sitemap entries for repository FAQ pages
+ */
+
+import { supabase } from '../supabase';
+
+export interface SitemapEntry {
+ url: string;
</file context>
|
||
return { | ||
url: `${baseUrl}/${owner}/${repoName}/faq`, | ||
lastModified: new Date(repo.updated_at).toISOString().split('T')[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastModified is generated without validating repo.updated_at; toISOString() will throw on Invalid Date and break sitemap generation.
Prompt for AI agents
Address the following comment on src/lib/sitemap/faq-sitemap-generator.ts at line 49:
<comment>lastModified is generated without validating repo.updated_at; toISOString() will throw on Invalid Date and break sitemap generation.</comment>
<file context>
@@ -0,0 +1,204 @@
+/**
+ * FAQ Sitemap Generator - Adds FAQ pages to sitemap for SEO
+ * Generates structured sitemap entries for repository FAQ pages
+ */
+
+import { supabase } from '../supabase';
+
+export interface SitemapEntry {
+ url: string;
</file context>
- Reduce FAQ cache to 24 hours for better freshness - Make AI answers max 50 words (was 100, then 200) - Make static answers 60-70% more concise - Add cache version key (v3-ultra-concise) to bust old verbose cached answers - Fix text overflow with break-words CSS class - Ensure FAQs fit properly in sidebar window
- Add overflow-hidden to parent container in insights-sidebar - Use line-clamp-2 for FAQ questions (shows 2 lines max) - Remove unnecessary break-words and overflow classes - Simplify text display with standard wrapping
- Increase insights sidebar from 320px (w-80) to 420px for proper content display - Remove line-clamp-2 restriction on FAQ questions - FAQ questions and answers now have enough space to display properly
- Remove blue border and use standard card hover effect - Remove blue Sparkles icons throughout - Simplify AI confidence display - Use consistent spacing (space-y-3) like other sections - Use standard p-4 padding like recommendations section - Simplify footer text for cleaner appearance
- Remove broken generateFAQInsight that was hijacking health analysis - Add dedicated callOpenAIForFAQ method with FAQ-specific system prompt - System prompt emphasizes answering the specific question asked - Cache version v4-specific-answers to force regeneration - Each FAQ question now gets a unique, relevant answer instead of generic health advice
- Add generateLocalSummary function for when Edge Function returns 500 - Generate basic summary from repository data and PR titles - Prevents error state when Edge Function has issues - Provides graceful degradation for summary feature
- Add detailed error logging to repository-summary Edge Function - Check for missing environment variables before use - Continue without embeddings if generation fails (non-critical) - Add fallback summary generation in client when Edge Function fails - Provide detailed error information in response for debugging - Successfully deployed updated Edge Function to production
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like
Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
- Remove unused avgPerDay and avgTitleLength variables - Fix repositoryData reference in fallback summary generation - Fetch repository data when needed for fallback - Build now passes successfully
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
- Add humanizeNumber function to format large numbers (27357 -> 27.4k) - Apply to both local fallback and Edge Function summaries - Update AI prompt to use humanized format in generated text - Numbers now display as 1.2k, 5.7M instead of full values - Better readability for repository metrics
✅ Bundle Size AnalysisAll chunks within limits See the workflow summary for detailed bundle sizes. |
## [2.0.0](v1.11.0...v2.0.0) (2025-08-12) ### ⚠ BREAKING CHANGES * critical production deployment and security issues (#259) ### 🚀 Features * Add comprehensive analytics dashboard to /admin and consolidate admin features ([#412](#412)) ([8958bed](8958bed)), closes [#409](#409) * add comprehensive bundle analysis tools and reports ([#365](#365)) ([9ad8556](9ad8556)) * Add comprehensive integration tests for progressive data loading ([#335](#335)) ([cd51631](cd51631)) * Add comprehensive test coverage for progressive data loading hooks ([#318](#318)) ([fad75cb](fad75cb)), closes [#285](#285) * Add dynamic XML sitemap generation with priority scores ([#313](#313)) ([dadeb37](dadeb37)), closes [#277](#277) * add FAQ sections to project pages ([#331](#331)) ([181ae84](181ae84)), closes [#270](#270) [#5747](https://github.com/bdougie/contributor.info/issues/5747) [#5747](https://github.com/bdougie/contributor.info/issues/5747) [#5747](https://github.com/bdougie/contributor.info/issues/5747) * Add GitHub Actions similarity service ([#344](#344)) ([1949583](1949583)), closes [#342](#342) * add more liberal webhook handling for issues and PRs ([3bc787e](3bc787e)) * Add organization page with top repositories ([#307](#307)) ([dde8696](dde8696)) * Add similarity comments to PR opened events ([#308](#308)) ([8002426](8002426)), closes [#262](#262) * add uPlot base wrapper component (Chart Migration Step 1) ([#378](#378)) ([904c8a5](904c8a5)), closes [#359](#359) [#370](#370) * automated tracked repository updates, database docs, and chart improvements ([#380](#380)) ([8b3f0eb](8b3f0eb)), closes [#371](#371) * complete Phase 5 test suite validation and cleanup ([#298](#298)) ([#348](#348)) ([af6f168](af6f168)) * configure AI crawler access with robots.txt and llms.txt ([#280](#280)) ([fca7763](fca7763)), closes [#268](#268) * Core Web Vitals monitoring and validation (Phase 3) ([#310](#310)) ([806bf7d](806bf7d)), closes [#283](#283) [#266](#266) [#283](#283) [#283](#283) * create bulletproof tests without mocks for UI components ([#345](#345)) ([ee0d2ef](ee0d2ef)) * enhance treemap with language-based PR visualization and interactive navigation ([#384](#384)) ([973dc2b](973dc2b)), closes [#372](#372) * implement Chart Migration Step 2 - Core Chart Components ([#379](#379)) ([1c6c211](1c6c211)), closes [#371](#371) * implement comprehensive error boundaries for data loading failures ([#320](#320)) ([d3a95bb](d3a95bb)), closes [#318](#318) [#286](#286) * implement content freshness signals for improved LLM citations ([#389](#389)) ([65e6276](65e6276)), closes [#273](#273) [#273](#273) * implement Core Web Vitals optimizations ([#284](#284)) ([9c6e5e2](9c6e5e2)) * Implement Core Web Vitals performance optimizations ([#309](#309)) ([27b93bc](27b93bc)), closes [#266](#266) [#235](#235) * implement data loading optimizations phase 2 ([#282](#282)) ([#290](#290)) ([becb7ec](becb7ec)) * implement embeddable widgets and citation system ([#324](#324)) ([671af82](671af82)), closes [#322](#322) [#322](#322) * implement mobile breadcrumb navigation with sticky positioning ([#322](#322)) ([009b0b8](009b0b8)), closes [#319](#319) * implement offline mode support ([#366](#366)) ([913b1ff](913b1ff)), closes [#300](#300) [#356](#356) * implement Phase 4 integration tests for complex features ([#346](#346)) ([10c3b1c](10c3b1c)), closes [#297](#297) * implement request deduplication for concurrent data fetches ([#325](#325)) ([f34aea9](f34aea9)), closes [#287](#287) * implement retry logic with exponential backoff for failed requests ([#334](#334)) ([8420740](8420740)), closes [#288](#288) * implement semantic HTML structure for better LLM comprehension ([#315](#315)) ([9a066be](9a066be)), closes [#269](#269) * implement WebP image optimization with fallbacks ([#323](#323)) ([4395740](4395740)) * improve light mode contrast and make insights sidebar black ([#410](#410)) ([5e184c6](5e184c6)), closes [#F8F9](https://github.com/bdougie/contributor.info/issues/F8F9) [#F8F9](https://github.com/bdougie/contributor.info/issues/F8F9) [#F1F3F5](https://github.com/bdougie/contributor.info/issues/F1F3F5) * LLM citation tracking system & web vitals fix ([#332](#332)) ([31617da](31617da)), closes [#328](#328) [#275](#275) * migrate distribution charts to uPlot ([#373](#373)) ([#382](#382)) ([4118a61](4118a61)) * migrate GitHub webhook handler from Netlify to Fly.io ([#424](#424)) ([c535034](c535034)), closes [#423](#423) [#411](#411) * migrate social cards from Netlify to Fly.io ([#423](#423)) ([ce1b3aa](ce1b3aa)), closes [#402](#402) * optimize 404 page for user retention ([#317](#317)) ([a6812c5](a6812c5)), closes [#278](#278) ### 🐛 Bug Fixes * Add claude security review & gemini ([#341](#341)) ([a319a69](a319a69)) * Add comprehensive schema.org markup for contributor.info ([#306](#306)) ([9a755a4](9a755a4)), closes [#267](#267) * add proper MIME types and cache headers for JavaScript modules ([236516a](236516a)) * add repository_id column to comments table ([#425](#425)) ([12f6e61](12f6e61)) * allow claude npm install ([d62f471](d62f471)) * claude.yml ([#369](#369)) ([ed17886](ed17886)) * Core Web Vitals optimizations and CLS fixes ([#285](#285)) ([#319](#319)) ([081aa3b](081aa3b)) * correct JavaScript MIME types and add performance optimizations ([#415](#415)) ([cc55b6c](cc55b6c)) * critical production deployment and security issues ([#259](#259)) ([b280736](b280736)) * disable service worker to resolve stale cache issues ([3ec3574](3ec3574)) * enable manual major/minor/patch releases in workflow ([#426](#426)) ([e849f10](e849f10)) * enable skipped test for repository confidence zero stars/forks edge case ([#364](#364)) ([6a25908](6a25908)), closes [#338](#338) * improve Request Priority button visibility in light mode ([#343](#343)) ([82ba0bb](82ba0bb)) * improve UI responsiveness by removing breadcrumb line and fixing layout ([#305](#305)) ([98191ea](98191ea)) * only handle 'labeled' events, not 'unlabeled' ([e2a2a8e](e2a2a8e)) * release.yml to publish changelog ([e082c87](e082c87)) * remove SECURITY DEFINER from database views for RLS compliance ([#260](#260)) ([5d316e9](5d316e9)) * remove unused vite packages causing Netlify build failures ([#413](#413)) ([c7a3a3a](c7a3a3a)), closes [#388](#388) * remove vite-bundle-analyzer to resolve Netlify build failure ([#385](#385)) ([583175d](583175d)), closes [#365](#365) [#365](#365) * repository tracking with local Inngest development ([#407](#407)) ([#420](#420)) ([f7ac446](f7ac446)) * resolve 406 error and implement comprehensive repository sync ([#261](#261)) ([3bc860a](3bc860a)) * resolve 406 errors when tracking new repositories ([#377](#377)) ([81ed7be](81ed7be)), closes [#375](#375) [#375](#375) * resolve chunk loading issues from PR [#319](#319) ([aa8c495](aa8c495)) * resolve performance regression and re-enable tree shaking ([#349](#349)) ([#353](#353)) ([33d933c](33d933c)), closes [#333](#333) * resolve React initialization errors by consolidating vendor bundle ([#354](#354)) ([fe066f0](fe066f0)) * resolve test hanging by excluding mock-dependent tests ([#294](#294)) ([befef78](befef78)), closes [#293](#293) [#299](#299) [#299](#299) [#299](#299) [#299](#299) [#299](#299) [#299](#299) [#299](#299) * restore data visualization test coverage ([#296](#296)) ([#347](#347)) ([8c362fe](8c362fe)) * revert broken manual release trigger from PR [#426](#426) ([#427](#427)) ([a9eaac9](a9eaac9)) * standardize error handling patterns across Inngest functions ([#422](#422)) ([5e075f6](5e075f6)), closes [#226](#226) * Update claude.yml ([b496461](b496461)) * update skeleton loaders to match actual design ([#327](#327)) ([d0cd962](d0cd962)) * webhook handler not posting comments - comprehensive fix ([0da8c3e](0da8c3e)) * webhook should use repository info from payload, not database ([#312](#312)) ([024d388](024d388)), closes [#310](#310) * widget xss vulnerability ([#329](#329)) ([9e12054](9e12054)), closes [#322](#322) [#322](#322) ### ⚡ Performance Improvements * add HTTP/2 Server Push and font optimization for Core Web Vitals ([#417](#417)) ([1182ff4](1182ff4)) * improve FCP and LCP % through mild code splitting ([#416](#416)) ([12ab333](12ab333)), closes [#20202](https://github.com/bdougie/contributor.info/issues/20202) ### ♻️ Code Refactoring * Replace automatic discovery with explicit user-controlled tracking ([#405](#405)) ([187a7fd](187a7fd)), closes [#403](#403) [#403](#403) [#404](#404) * Update sitemap workflow for deprecated ping endpoints ([#316](#316)) ([c43456d](c43456d)) ### 📚 Documentation * add icon library audit document ([#368](#368)) ([af9f53d](af9f53d)), closes [#358](#358) [#358](#358) * add safe FCP/LCP optimization strategies ([#414](#414)) ([fb89e6c](fb89e6c)) * clean up user documentation and improve accessibility ([#233](#233)) ([0b271d4](0b271d4)), closes [#407](#407) [#407](#407) ### 🔧 Maintenance * update tracked repositories list [skip ci] ([0cba7d6](0cba7d6))
🎉 This PR is included in version 2.0.0 🎉 |
* feat: add FAQ sections to project pages in insights sidebar - Create ProjectFAQ component with schema markup for better SEO - Generate 7 dynamic FAQs per project based on repository data - Include expand/collapse UI with smooth interactions - Add FAQ section to insights sidebar for both desktop and mobile - Implement proper loading states and error handling - Questions cover contributor count, activity, trends, and patterns - Updates dynamically when time range changes Addresses #270 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Brian Douglas <[email protected]> * feat: enhance FAQ with LLM service and embeddings integration - Add faq-service.ts with OpenAI-powered dynamic answers - Implement semantic question matching using MiniLM embeddings - Enhanced project-faq.tsx with AI indicators and confidence scores - Add FAQ sitemap generator for improved SEO - Include FAQ URLs in main sitemap for major repositories - Support graceful fallback to static answers when AI unavailable - Add structured data and citations for better search visibility Co-authored-by: Brian Douglas <[email protected]> * docs: add FAQ LLM integration documentation * fix: resolve TypeScript errors and Rollup build issue - Fix TypeScript errors in project-faq.tsx: - Remove unused imports (cn, FAQAnswer type) - Fix RepoStats type usage (removed non-existent health/activity properties) - Properly handle pr.author object structure for contributor indexing - Remove unsupported title prop from Sparkles icon - Fix TypeScript errors in faq-service.ts: - Remove unused imports and variables - Fix type casting for cache service - Handle contributor data structure properly in reduce operations - Fix sort function type assertions - Work around Rollup conditional expression bug: - Temporarily disable treeshaking to fix build error - Added TODO to re-enable once Rollup issue is resolved - Reference: rollup/rollup#5747 Build now completes successfully with all TypeScript errors resolved. * fix: resolve Rollup conditional expression bug and refactor nested ternaries Root cause: Rollup 4.45.0 has a bug with nested ternary operators during treeshaking that causes 'Cannot add property 0, object is not extensible' error. Changes: - Simplified complex nested ternary in env.ts to avoid triggering bug - Refactored nested ternaries in project-faq.tsx to if-else statements - Disabled treeshaking as temporary workaround for remaining nested ternaries - Added detailed comments explaining the Rollup bug and workaround Impact: - Build now completes successfully - Bundle size increased to ~5.5MB (exceeds 5MB budget) due to disabled treeshaking - Performance Budget Check will fail until treeshaking is re-enabled Next steps: - Upgrade Rollup when fix is released - Or refactor all remaining nested ternaries across codebase - Then re-enable treeshaking to reduce bundle size References: rollup/rollup#5747 * refactor: replace nested ternaries with lookup objects and helper functions Refactored nested ternary operators to use cleaner patterns: - web-vitals-monitoring.ts: Use lookup objects for rating emojis/colors - pagespeed-insights.ts: Extract helper functions for delta formatting - badge-generator.tsx: Use color constants and helper functions - env.ts: Simplify complex nested conditional logic These changes reduce complexity and make the code more maintainable. However, treeshaking still needs to be disabled due to remaining nested ternaries throughout the codebase. The Rollup bug (issue #5747) is triggered by ANY nested ternary, so a complete refactor of all ternaries would be needed to re-enable treeshaking without upgrading Rollup. Impact: - Cleaner, more maintainable code - Partial progress toward fixing Rollup issue - Bundle size still exceeds 5MB limit due to disabled treeshaking * perf: implement lazy loading for insights sidebar components Implemented code-splitting optimizations: - Lazy load all insights sidebar sections (FAQ, Health, Recommendations, etc) - Dynamic import heavy embeddings/transformers library in FAQ service - Add loading skeletons for better UX during lazy loading - Move insights components out of main bundle Impact: - FAQ and embeddings now load only when needed (~820KB saved from initial load) - Improved initial page load performance - Better code organization with clear async boundaries Trade-offs: - Bundle still exceeds 5MB due to disabled treeshaking (Rollup bug workaround) - Treeshaking must remain disabled until Rollup issue #5747 is fixed - Performance Budget Check will continue to fail Next steps: - Consider downgrading Rollup to avoid the bug - Or systematically replace ALL nested ternaries across codebase - Continue identifying more components for lazy loading * fix: add Rollup treeshake workaround to Storybook config The same Rollup 4.45.0 bug that affects the main build also affects Storybook builds. Added treeshake: false to the Storybook viteFinal configuration to match the main build workaround. This fixes the 'Cannot add property 0, object is not extensible' error during Storybook builds in CI. Impact: - Storybook builds now complete successfully - Build and Deploy Storybook workflow should pass - Slightly larger Storybook bundle (acceptable for documentation) Note: This workaround can be removed once Rollup issue #5747 is fixed or all nested ternaries are refactored. * fix: make FAQ answers ultra-concise and fix text overflow - Reduce FAQ cache to 24 hours for better freshness - Make AI answers max 50 words (was 100, then 200) - Make static answers 60-70% more concise - Add cache version key (v3-ultra-concise) to bust old verbose cached answers - Fix text overflow with break-words CSS class - Ensure FAQs fit properly in sidebar window * fix: properly constrain FAQ width in sidebar to prevent overflow - Add overflow-hidden to parent container in insights-sidebar - Use line-clamp-2 for FAQ questions (shows 2 lines max) - Remove unnecessary break-words and overflow classes - Simplify text display with standard wrapping * fix: increase sidebar width to 420px for better FAQ readability - Increase insights sidebar from 320px (w-80) to 420px for proper content display - Remove line-clamp-2 restriction on FAQ questions - FAQ questions and answers now have enough space to display properly * fix: update FAQ design to match app design language - Remove blue border and use standard card hover effect - Remove blue Sparkles icons throughout - Simplify AI confidence display - Use consistent spacing (space-y-3) like other sections - Use standard p-4 padding like recommendations section - Simplify footer text for cleaner appearance * fix: FAQ now generates specific answers for each question - Remove broken generateFAQInsight that was hijacking health analysis - Add dedicated callOpenAIForFAQ method with FAQ-specific system prompt - System prompt emphasizes answering the specific question asked - Cache version v4-specific-answers to force regeneration - Each FAQ question now gets a unique, relevant answer instead of generic health advice * fix: add local fallback for repository summary when Edge Function fails - Add generateLocalSummary function for when Edge Function returns 500 - Generate basic summary from repository data and PR titles - Prevents error state when Edge Function has issues - Provides graceful degradation for summary feature * fix: improve Edge Function error handling and deploy fix - Add detailed error logging to repository-summary Edge Function - Check for missing environment variables before use - Continue without embeddings if generation fails (non-critical) - Add fallback summary generation in client when Edge Function fails - Provide detailed error information in response for debugging - Successfully deployed updated Edge Function to production * fix: resolve TypeScript build errors - Remove unused avgPerDay and avgTitleLength variables - Fix repositoryData reference in fallback summary generation - Fetch repository data when needed for fallback - Build now passes successfully * feat: humanize numbers in repository summaries - Add humanizeNumber function to format large numbers (27357 -> 27.4k) - Apply to both local fallback and Edge Function summaries - Update AI prompt to use humanized format in generated text - Numbers now display as 1.2k, 5.7M instead of full values - Better readability for repository metrics --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
## [2.0.0](v1.11.0...v2.0.0) (2025-08-12) ### ⚠ BREAKING CHANGES * critical production deployment and security issues (#259) ### 🚀 Features * Add comprehensive analytics dashboard to /admin and consolidate admin features ([#412](#412)) ([8958bed](8958bed)), closes [#409](#409) * add comprehensive bundle analysis tools and reports ([#365](#365)) ([9ad8556](9ad8556)) * Add comprehensive integration tests for progressive data loading ([#335](#335)) ([cd51631](cd51631)) * Add comprehensive test coverage for progressive data loading hooks ([#318](#318)) ([fad75cb](fad75cb)), closes [#285](#285) * Add dynamic XML sitemap generation with priority scores ([#313](#313)) ([dadeb37](dadeb37)), closes [#277](#277) * add FAQ sections to project pages ([#331](#331)) ([181ae84](181ae84)), closes [#270](#270) [#5747](https://github.com/bdougie/contributor.info/issues/5747) [#5747](https://github.com/bdougie/contributor.info/issues/5747) [#5747](https://github.com/bdougie/contributor.info/issues/5747) * Add GitHub Actions similarity service ([#344](#344)) ([1949583](1949583)), closes [#342](#342) * add more liberal webhook handling for issues and PRs ([3bc787e](3bc787e)) * Add organization page with top repositories ([#307](#307)) ([dde8696](dde8696)) * Add similarity comments to PR opened events ([#308](#308)) ([8002426](8002426)), closes [#262](#262) * add uPlot base wrapper component (Chart Migration Step 1) ([#378](#378)) ([904c8a5](904c8a5)), closes [#359](#359) [#370](#370) * automated tracked repository updates, database docs, and chart improvements ([#380](#380)) ([8b3f0eb](8b3f0eb)), closes [#371](#371) * complete Phase 5 test suite validation and cleanup ([#298](#298)) ([#348](#348)) ([af6f168](af6f168)) * configure AI crawler access with robots.txt and llms.txt ([#280](#280)) ([fca7763](fca7763)), closes [#268](#268) * Core Web Vitals monitoring and validation (Phase 3) ([#310](#310)) ([806bf7d](806bf7d)), closes [#283](#283) [#266](#266) [#283](#283) [#283](#283) * create bulletproof tests without mocks for UI components ([#345](#345)) ([ee0d2ef](ee0d2ef)) * enhance treemap with language-based PR visualization and interactive navigation ([#384](#384)) ([973dc2b](973dc2b)), closes [#372](#372) * implement Chart Migration Step 2 - Core Chart Components ([#379](#379)) ([1c6c211](1c6c211)), closes [#371](#371) * implement comprehensive error boundaries for data loading failures ([#320](#320)) ([d3a95bb](d3a95bb)), closes [#318](#318) [#286](#286) * implement content freshness signals for improved LLM citations ([#389](#389)) ([65e6276](65e6276)), closes [#273](#273) [#273](#273) * implement Core Web Vitals optimizations ([#284](#284)) ([9c6e5e2](9c6e5e2)) * Implement Core Web Vitals performance optimizations ([#309](#309)) ([27b93bc](27b93bc)), closes [#266](#266) [#235](#235) * implement data loading optimizations phase 2 ([#282](#282)) ([#290](#290)) ([becb7ec](becb7ec)) * implement embeddable widgets and citation system ([#324](#324)) ([671af82](671af82)), closes [#322](#322) [#322](#322) * implement mobile breadcrumb navigation with sticky positioning ([#322](#322)) ([009b0b8](009b0b8)), closes [#319](#319) * implement offline mode support ([#366](#366)) ([913b1ff](913b1ff)), closes [#300](#300) [#356](#356) * implement Phase 4 integration tests for complex features ([#346](#346)) ([10c3b1c](10c3b1c)), closes [#297](#297) * implement request deduplication for concurrent data fetches ([#325](#325)) ([f34aea9](f34aea9)), closes [#287](#287) * implement retry logic with exponential backoff for failed requests ([#334](#334)) ([8420740](8420740)), closes [#288](#288) * implement semantic HTML structure for better LLM comprehension ([#315](#315)) ([9a066be](9a066be)), closes [#269](#269) * implement WebP image optimization with fallbacks ([#323](#323)) ([4395740](4395740)) * improve light mode contrast and make insights sidebar black ([#410](#410)) ([5e184c6](5e184c6)), closes [#F8F9](https://github.com/bdougie/contributor.info/issues/F8F9) [#F8F9](https://github.com/bdougie/contributor.info/issues/F8F9) [#F1F3F5](https://github.com/bdougie/contributor.info/issues/F1F3F5) * LLM citation tracking system & web vitals fix ([#332](#332)) ([31617da](31617da)), closes [#328](#328) [#275](#275) * migrate distribution charts to uPlot ([#373](#373)) ([#382](#382)) ([4118a61](4118a61)) * migrate GitHub webhook handler from Netlify to Fly.io ([#424](#424)) ([c535034](c535034)), closes [#423](#423) [#411](#411) * migrate social cards from Netlify to Fly.io ([#423](#423)) ([ce1b3aa](ce1b3aa)), closes [#402](#402) * optimize 404 page for user retention ([#317](#317)) ([a6812c5](a6812c5)), closes [#278](#278) ### 🐛 Bug Fixes * Add claude security review & gemini ([#341](#341)) ([a319a69](a319a69)) * Add comprehensive schema.org markup for contributor.info ([#306](#306)) ([9a755a4](9a755a4)), closes [#267](#267) * add proper MIME types and cache headers for JavaScript modules ([236516a](236516a)) * add repository_id column to comments table ([#425](#425)) ([12f6e61](12f6e61)) * allow claude npm install ([d62f471](d62f471)) * claude.yml ([#369](#369)) ([ed17886](ed17886)) * Core Web Vitals optimizations and CLS fixes ([#285](#285)) ([#319](#319)) ([081aa3b](081aa3b)) * correct JavaScript MIME types and add performance optimizations ([#415](#415)) ([cc55b6c](cc55b6c)) * critical production deployment and security issues ([#259](#259)) ([b280736](b280736)) * disable service worker to resolve stale cache issues ([3ec3574](3ec3574)) * enable manual major/minor/patch releases in workflow ([#426](#426)) ([e849f10](e849f10)) * enable skipped test for repository confidence zero stars/forks edge case ([#364](#364)) ([6a25908](6a25908)), closes [#338](#338) * improve Request Priority button visibility in light mode ([#343](#343)) ([82ba0bb](82ba0bb)) * improve UI responsiveness by removing breadcrumb line and fixing layout ([#305](#305)) ([98191ea](98191ea)) * only handle 'labeled' events, not 'unlabeled' ([e2a2a8e](e2a2a8e)) * release.yml to publish changelog ([e082c87](e082c87)) * remove SECURITY DEFINER from database views for RLS compliance ([#260](#260)) ([5d316e9](5d316e9)) * remove unused vite packages causing Netlify build failures ([#413](#413)) ([c7a3a3a](c7a3a3a)), closes [#388](#388) * remove vite-bundle-analyzer to resolve Netlify build failure ([#385](#385)) ([583175d](583175d)), closes [#365](#365) [#365](#365) * repository tracking with local Inngest development ([#407](#407)) ([#420](#420)) ([f7ac446](f7ac446)) * resolve 406 error and implement comprehensive repository sync ([#261](#261)) ([3bc860a](3bc860a)) * resolve 406 errors when tracking new repositories ([#377](#377)) ([81ed7be](81ed7be)), closes [#375](#375) [#375](#375) * resolve chunk loading issues from PR [#319](#319) ([aa8c495](aa8c495)) * resolve performance regression and re-enable tree shaking ([#349](#349)) ([#353](#353)) ([33d933c](33d933c)), closes [#333](#333) * resolve React initialization errors by consolidating vendor bundle ([#354](#354)) ([fe066f0](fe066f0)) * resolve test hanging by excluding mock-dependent tests ([#294](#294)) ([befef78](befef78)), closes [#293](#293) [#299](#299) [#299](#299) [#299](#299) [#299](#299) [#299](#299) [#299](#299) [#299](#299) * restore data visualization test coverage ([#296](#296)) ([#347](#347)) ([8c362fe](8c362fe)) * revert broken manual release trigger from PR [#426](#426) ([#427](#427)) ([a9eaac9](a9eaac9)) * standardize error handling patterns across Inngest functions ([#422](#422)) ([5e075f6](5e075f6)), closes [#226](#226) * Update claude.yml ([b496461](b496461)) * update skeleton loaders to match actual design ([#327](#327)) ([d0cd962](d0cd962)) * webhook handler not posting comments - comprehensive fix ([0da8c3e](0da8c3e)) * webhook should use repository info from payload, not database ([#312](#312)) ([024d388](024d388)), closes [#310](#310) * widget xss vulnerability ([#329](#329)) ([9e12054](9e12054)), closes [#322](#322) [#322](#322) ### ⚡ Performance Improvements * add HTTP/2 Server Push and font optimization for Core Web Vitals ([#417](#417)) ([1182ff4](1182ff4)) * improve FCP and LCP % through mild code splitting ([#416](#416)) ([12ab333](12ab333)), closes [#20202](https://github.com/bdougie/contributor.info/issues/20202) ### ♻️ Code Refactoring * Replace automatic discovery with explicit user-controlled tracking ([#405](#405)) ([187a7fd](187a7fd)), closes [#403](#403) [#403](#403) [#404](#404) * Update sitemap workflow for deprecated ping endpoints ([#316](#316)) ([c43456d](c43456d)) ### 📚 Documentation * add icon library audit document ([#368](#368)) ([af9f53d](af9f53d)), closes [#358](#358) [#358](#358) * add safe FCP/LCP optimization strategies ([#414](#414)) ([fb89e6c](fb89e6c)) * clean up user documentation and improve accessibility ([#233](#233)) ([0b271d4](0b271d4)), closes [#407](#407) [#407](#407) ### 🔧 Maintenance * update tracked repositories list [skip ci] ([0cba7d6](0cba7d6))
Implements FAQ sections for project pages in the insights sidebar to improve LLM citation rates and answer common queries.
Changes
FAQ Questions Generated
Closes #270
🤖 Generated with Claude Code