Research in Chat, Paywall Restructure#46
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Research pipeline (new)
lib/research-service.tsexportsrunResearchPipeline, an async generator that runs a three-phase pipeline:getTopResultsByRelevance, then calls the LLM for a focused ~150-word analysis. Runs sequentially rather than in parallel to avoid nilAI 429 rate-limit cascades.The function accepts an
onMetacallback that receivesResearchAngle[](keyword + results count per angle) after the analysis phase, before synthesis begins.DNA Chat integration (
app/components/LLMChatInline.tsx):handleResearch()callsrequirePremium()(same gate pattern as Analyze reports) then streams from the pipeline into the assistant message bubblebuildUserContext()helper extracted fromhandleSendMessageand shared withhandleResearchto avoid duplicationMessagetype gainsresearchMeta?: ResearchAngle[], used to render a collapsible "Researched N angles" panel below each research responseisLoadingso only one can run at a timePaywall restructure
Health Insights Report is now free.
handleGenerateHealthReportno longer callsrequirePremium().Analyze page (
app/overview-report/page.tsx):<span className="premium-tab-badge">Premium</span>to Healthspan, Top Traits, and Comprehensive Overview headingsPremiumFeatureHeadercopy updated to reflect mixed free/premium content: "Health Insights is free. Healthspan, Top Traits, and Overview reports require a subscription."DNA Chat page (
app/dna-chat/page.tsx):PremiumFeatureHeaderwith Research-specific gate copy: "Research requires a subscription."PremiumFeatureHeadercomponent:gateTitleandgateDescriptionprops so callers can override the default "premium tab" messaging without duplicating the componentMenuBar (
app/components/MenuBar.tsx):nav-premium-linkclass andnav-premium-badgespan from the Analyze linkNilAI consent modal removed
NilAIConsentModalis no longer shown before the first DNA Chat message. The consent gate has been replaced by the premium subscription check. All related state (showConsentModal,hasConsent,CONSENT_STORAGE_KEY), analytics calls (trackAIConsentGiven,trackAIConsentDeclined,trackAIConsentModalShown), and handler functions have been removed fromLLMChatInline.Home page CTA
app/landing-client.tsx:secondary-buttontoprimary-buttonwith larger paddingMobile nav legibility
getNavLinkStyleinMenuBar.tsx: inactive links bumped fromfontWeight: 400to500; active from600to700.nav-link:font-sizeraised from0.75remto0.875rem;font-weight: 500added explicitly; horizontal padding increased slightly so links breathe without overflowing the row