Repository navigation
feat(dashboard): company-context card — founder-confirmed snapshot of… - #18
Merged
Merged
Conversation
… company, ICPs, GTM goals
Adds a collapsible card on the home dashboard surfacing the agents'
understanding of the company. Founder edits via Dialog or bootstraps
via "Refresh from AI" (one-shot Sonnet synth from voice + hot leads).
Live counts on GTM goals derive from existing pipeline tables —
no snapshot history.
- new singleton table `company_context` (json columns for icps + objectives)
- `lib/state/{company-context,gtm-metrics}.ts` for load/save + counters
- `lib/orchestrator/context-synth.ts` mirrors title.ts pattern, mock/no-key fallback
- `app/api/context/{route,refresh/route}.ts` + mock mirror
- card + edit dialog + hook in `lib/ui/`
- Anvil seed in `scripts/seed-demo.ts`
Personas don't yet read CompanyContext — that's a follow-up (thread it
into WorkContext for Conductor + Writer few-shots once backend is ready).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Paragon Review Skipped Hi @sxnnywu! Your Polarity credit balance is insufficient to complete this review. Please visit https://app.paragon.run to finish your review. |
There was a problem hiding this comment.
Pull request overview
Adds a founder-confirmed “Company Context” surface to the dashboard (company snapshot + ICPs + GTM goals), backed by a new singleton company_context row and API endpoints to load/save it, plus an AI “Refresh from AI” proposal flow that does not auto-persist.
Changes:
- Introduces
company_contextpersistence (Drizzle schema + migration) and seed data. - Adds server utilities for loading/saving company context and computing live GTM metric counts from existing pipeline tables.
- Adds
/api/context+/api/context/refreshroutes and a dashboard card + edit dialog + client hook to view/edit/refresh context.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/seed-demo.ts | Seeds a singleton company_context row and uses SQL count() for faster post-seed stats. |
| lib/ui/hooks/use-company-context.ts | Client hook to load/save context and request AI refresh proposals (with mock-mode behavior). |
| lib/ui/components/edit-company-context-dialog.tsx | Dialog UI for editing company overview, key facts, ICPs, and GTM goals with Zod validation. |
| lib/ui/components/company-context-card.tsx | Collapsible dashboard card rendering the context snapshot + live goal progress + edit/refresh actions. |
| lib/state/schema.ts | Adds company_context table definition and exported row/insert types. |
| lib/state/gtm-metrics.ts | Implements live counters for GTM metrics by querying existing tables. |
| lib/state/company-context.ts | Implements load/save helpers for the singleton company context row. |
| lib/shared/schemas.ts | Adds Zod schemas for CompanyContext, ICP profiles, and GTM objectives/metrics. |
| lib/orchestrator/context-synth.ts | Adds one-shot LLM synth to propose (not persist) CompanyContext from voice samples + hot leads. |
| drizzle/migrations/0003_company_context.sql | Creates the company_context table. |
| CLAUDE.md | Documents the new CompanyContext + GTM metrics lifecycle, routes, and constraints. |
| app/api/mock/context/route.ts | Adds a mock context endpoint intended to mirror the live route response shape. |
| app/api/context/route.ts | Adds GET/PUT API for loading/saving CompanyContext and returning live counts. |
| app/api/context/refresh/route.ts | Adds POST API for AI proposal refresh that returns proposed context only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+84
to
+88
| <button | ||
| type="button" | ||
| onClick={() => setOpen((v) => !v)} | ||
| className="flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-muted/40" | ||
| > |
Comment on lines
+278
to
+282
| {form.icps.map((icp, idx) => ( | ||
| <div | ||
| key={idx} | ||
| className="grid gap-2 rounded-lg border border-border bg-muted/20 p-3" | ||
| > |
Comment on lines
+375
to
+379
| {form.gtmObjectives.map((obj, idx) => ( | ||
| <div | ||
| key={idx} | ||
| className="grid gap-2 rounded-lg border border-border bg-muted/20 p-3" | ||
| > |
Comment on lines
+306
to
+310
| <select | ||
| value={icp.priority} | ||
| onChange={(e) => | ||
| updateIcp(idx, { | ||
| priority: e.target.value as IcpPriority, |
Comment on lines
+403
to
+407
| <select | ||
| value={obj.metric} | ||
| onChange={(e) => | ||
| updateObjective(idx, { | ||
| metric: e.target.value as GtmMetric, |
| </select> | ||
| <Input | ||
| type="number" | ||
| min="1" |
| /> | ||
| </div> | ||
| <Input | ||
| type="datetime-local" |
Comment on lines
+212
to
+216
| {icps.map((icp) => ( | ||
| <li | ||
| key={icp.name} | ||
| className="rounded-lg border border-border/60 bg-muted/20 p-2.5" | ||
| > |
Comment on lines
+51
to
+55
| useEffect(() => { | ||
| if (MOCK_MODE) { | ||
| setState({ | ||
| context: makeMockCompanyContext(), | ||
| liveCounts: makeMockGtmLiveCounts(), |
sebtsang
added a commit
that referenced
this pull request
May 10, 2026
After the pivot to G-stack for blogs landed (PR #18, then merged into this branch via 94d5f86), the 6 new content personas (linkedin/x/reddit-researcher, synthesizer, blog-writer, blog-designer) had no entries in COMPANY_PROFILE_SLICES — meaning the dispatcher was passing them empty companyProfile slices. Each slice is tailored to what the persona reads: - linkedin-researcher / x-researcher / reddit-researcher: companyName, oneLiner, productDescription, icp/competitors (icp for B2B-shaped sites like LinkedIn/Reddit, competitors for X trend research) - synthesizer: full picture except value props/competitors — needs positioning + voiceTone to write an outline that sounds like ours - blog-writer: voice-critical persona, full slice except sourceUrl - blog-designer: just companyName + oneLiner for attribution; brand identity (logo, colors) is future work PERSONAS_BY_FIELD will pick this up automatically (it iterates the slice map at module load), so the form's "Read by X, Y, Z" attribution updates without further changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
… company, ICPs, GTM goals
Adds a collapsible card on the home dashboard surfacing the agents' understanding of the company. Founder edits via Dialog or bootstraps via "Refresh from AI" (one-shot Sonnet synth from voice + hot leads). Live counts on GTM goals derive from existing pipeline tables — no snapshot history.
company_context(json columns for icps + objectives)lib/state/{company-context,gtm-metrics}.tsfor load/save + counterslib/orchestrator/context-synth.tsmirrors title.ts pattern, mock/no-key fallbackapp/api/context/{route,refresh/route}.ts+ mock mirrorlib/ui/scripts/seed-demo.tsPersonas don't yet read CompanyContext — that's a follow-up (thread it into WorkContext for Conductor + Writer few-shots once backend is ready).