23 Commits

Author SHA1 Message Date
a4769ea12b Fix playbook advance duplicating entries instead of updating
advanceStep was not passing the progress row id, so upsertPlaybookProgress
treated every advance as a new insert instead of updating the existing row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 16:04:36 -04:00
34e3dd650b Fix uncontrolled input warning on leads admin page
Use defaultValue instead of value for the Loop Path input since it
only saves on blur, not on every keystroke.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 12:58:28 -04:00
9e3cd8be9c Add lead detail modal on account page and show dates on lead cards
AccountLeads: clicking a lead now opens a full detail modal with
executive summary, outreach hook, talking points, signals, contacts,
renewal context, and action buttons.

Leads list: show lead generation date in the top line of each card.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 12:56:09 -04:00
b60fd4058f Fix capability filter on leads page
The dropdown sends capability_name values but the query was filtering on
the capability_id column. Add capability_name filter support to getLeads
and use it from the page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 12:52:19 -04:00
3cc4902ce2 Integrate BSG Prospecting Loop into Campaign Command Center
Add full leads pipeline: Lead/LeadRun types, 3 new DB tables (leads,
leads_runs, leads_config), 12 CRUD functions including syncBriefsFromDisk
and exportAccountsForLoop, 12 API actions for leads lifecycle management.

New pages: /leads (filterable lead cards with expand/action), /leads/admin
(run controls, config, run history). AccountLeads component in account
detail view. New Leads scorecard on Executive Overview. Sidebar nav entry.

Also fixes account detail activity list using raw.activities to show all
activities regardless of date filter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 12:03:48 -04:00
c4f02a84c8 Add Planned activities column to Exec Summary district table
Split the Activities column into Activities (occurred) and Planned
(future) to match the Executive Overview's District Performance chart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-04 12:21:34 -04:00
c8c867ff66 Add District Performance chart and count planned activities as touched
Executive Overview now shows a District Performance bar chart with
Activities (occurred), Planned (future), and Accounts Touched per
district. Planned activities now count toward the account's touch
data so scheduling future engagement flips an account to "touched."

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-04 12:20:33 -04:00
1435fb5efc Remove global date/district filter from top bar
The global filter caused confusion — activities saved with future dates
were silently filtered out, making it appear saves didn't work. Subviews
can add their own filtering where it makes sense.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-04 12:16:05 -04:00
eb13f292e4 Fix playbook steps not rendering text
Playbook steps are stored as simple string arrays in the database,
but the rendering code expected PlaybookStep objects with step/title/
description/duration fields. Handle both formats with a typeof check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-03 11:58:11 -04:00
d946a1b9d4 Add inline priority editing on account detail page
- Clickable priority badge with dropdown to change High/Medium/Low
- New account.priority API action for lightweight single-field update
- Larger priority badges on account cards (text-[10px] font-bold)
- Add FedEx Freight Inc. to database, remove TechFarce
- Update 17 AD assignments from FY26 team mapping spreadsheet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-03 09:24:58 -04:00
d79794b164 Add Phase 3: Analytics & Forecast Intelligence
- Pipeline Movement Tracker with waterfall chart and snapshot capture
- Forecast Call Workspace with inline deal overrides and lock history
- Forecast Accuracy tracking against locked snapshots
- Win/Loss Analysis with rate breakdowns by stage, competitor, deal size, play
- Playbook Effectiveness dashboard with conversion funnel and step drop-off
- Account engagement trends with 12-week sparklines and direction badges
- Analytics sidebar navigation with collapsible submenu
- Data layer: forecast_locks, forecast_overrides tables, pipeline movement API
- Fix Turbopack function hoisting issues in Sidebar and db.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 13:49:05 -04:00
a131072226 Fix activity detail overlay on Account Explorer detail view
The overlay was only in the account list return block, not the account
detail return block, so clicking an activity set state but never rendered.
Duplicated the overlay into the selectedAccount detail view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 11:09:30 -04:00
4266fef8dc Add admin goals management page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 11:01:46 -04:00
a88821990f Add cross-linking between all account/activity references
Make account names and activity items clickable across all views:
- Account Explorer activity timeline items open detail overlay
- Pipeline table and deal detail link to Account Explorer
- Implementation kanban cards link to Account Explorer
- Executive Overview NBA account names link to Account Explorer
- Playbooks account progress links to Account Explorer
- Activities overlay and Follow-Ups view link to Account Explorer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 10:55:17 -04:00
1a1cf7e652 Add planned activities and follow-ups workflow
Activities with future dates are automatically tagged as Planned. Once
the date passes they become Pending Follow-Ups requiring resolution.

- Added Status column to activities (Planned/Completed/Did Not Occur)
- Built Follow-Ups subview with expandable cards, outcome capture,
  and Create Next Step workflow for scheduling follow-on activities
- Upcoming Planned table shows scheduled future activities
- Executive Overview gains Meetings Scheduled and Follow-Ups Pending KPIs
- Planned/Follow-Up badges appear in the activity detail table
- Admin page includes Status field for activities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 10:22:20 -04:00
4e2e847828 Remove page subtitles from all dashboard pages
Subtitles added noise without value. Stripped subtitle props from all 8
PageHeader calls, removed subtitle display from TopBar, and simplified
the PageTitleContext and PageHeader interfaces to title-only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 09:31:32 -04:00
9d016a08cb Add CPM (Customer Portfolio Manager) attribute to accounts
- New CPM field on AccountRecord type, DB schema, and migration
- Seed "David Stefan" as CPM for 20 specified accounts
- CPM filter dropdown on Account Explorer (alongside AD and IMS BA)
- CPM shown on account cards, account detail view, and activity overlay
- CPM column added to admin data table
- upsertAccount includes CPM in insert/update

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 09:19:38 -04:00
957376c770 Move page titles into the top header bar to reclaim vertical space
PageHeader now sets title via context instead of rendering inline.
TopBar displays the current page title and subtitle in the left area
that was previously an empty spacer. Content area gains ~40px of
vertical space on every page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 08:56:06 -04:00
d996fb66b6 Enhance renewal timeline and add inline create forms
- Slider now filters $0-$500K in $50K increments (10 steps)
- Timeline data points and account labels are clickable to open account detail
- Add "Create Opp" button in Pipeline section with inline form (stage, amount,
  forecast, probability, close date, product, next step)
- Add "Add Activity" button in Activity Timeline with inline form (type, date,
  contact, outcome, notes)
- Both forms save via admin API and refresh dashboard data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 08:50:57 -04:00
938e642d68 Add Renewal Timeline visualization to Account Explorer
Collapsible SVG timeline showing Next Renewal and Anchor Contract dates
for all filtered accounts. Color-coded account names by opportunity status
(green=won/late stage, yellow=early stage, black=lost, gray=none). Includes
dollar amount slider filter, Today marker, and year/quarter gridlines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-01 08:37:40 -04:00
d2d5632086 Implement Phase 2 features for Campaign Command Center
Adds 14 new features across the dashboard:
- Deal Risk Scoring (0-100) with risk factors on pipeline deals
- Account Health Score with multi-factor analysis on account cards
- Next Best Action Engine on Executive Overview
- Account Notes with pin/edit/delete in activity overlay and account detail
- Stakeholder Contact Map with role, sentiment, email, LinkedIn
- Competitive Intelligence Tracker with multi-select competitors and filtering
- CSV/Excel Export on accounts, activities, and pipeline pages
- Data Quality Dashboard in admin with completeness scoring
- Campaign Playbook Templates with 5 default plays and account progress tracking
- Goals & District Targets with quarterly tracking and progress bars
- Weekly Status Report (printable) and Executive Summary (printable)
- Activity Effectiveness Scoring showing pipeline conversion by activity type
- Mobile Activity FAB for quick activity logging on mobile
- Multi-User Auth (NextAuth + Google OAuth, @broadcom.com domain, role-based)

Also adds Phase 2 API route, scoring utilities, sidebar navigation updates,
and database schema extensions for notes, contacts, snapshots, playbooks,
and district targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-31 18:07:46 -04:00
3c8c8ee594 Build AgentMinder Campaign Command Center - Phase 1 complete
Full-featured sales campaign dashboard replacing Looker Studio with
responsive Next.js app. Includes Executive Overview, Account Explorer
with priority algorithm, Activities with detail overlay, Pipeline/Opps
with deal panels, Implementation tracking, and Data Admin with CSV
import and CRUD operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-31 13:55:01 -04:00
fce80c3d45 Initial commit from Create Next App 2026-08-27 09:37:24 -04:00