Commit graph

53 commits

Author SHA1 Message Date
michael
98633534ef Remove debug border and set bottom padding to 20px
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:18:47 -06:00
michael
24150ab221 Adjust padding to 2px top / 6px bottom to raise text
More bottom padding pushes text upward in the badge.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:16:49 -06:00
michael
ed040efac0 Add blue border to status badge to verify deployment
Testing if changes are being picked up correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:15:25 -06:00
michael
8ba0f01e20 Use table/table-cell display for reliable vertical centering
Wrap text in nested spans using display: inline-table on outer
and display: table-cell with vertical-align: middle on inner.
This is a classic centering technique that html2canvas should handle.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:09:14 -06:00
michael
bfee60399c Try fixed height with matching line-height for vertical centering
Use height: 24px with line-height: 24px and no vertical padding.
This forces text to center vertically within the fixed height container.
Added box-sizing: border-box and vertical-align: middle for reliability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:07:25 -06:00
michael
e071576765 Adjust padding to raise text in status pills (3px top / 5px bottom)
Text was sitting too low, reducing top padding and increasing bottom
to push text upward for visual centering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:05:27 -06:00
michael
e68aab0d03 Correct padding direction - more top padding to push text down
Text was sitting too high, so need 5px top / 4px bottom to push
the text downward for visual centering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:03:31 -06:00
michael
8dc3ef34b0 Fix PDF status pill vertical centering with asymmetric padding
Use 4px top / 5px bottom padding to compensate for Arial font metrics
where the visual center differs from mathematical center. The extra
bottom padding pushes the text up to appear visually centered.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:03:15 -06:00
michael
1799902448 Fix PDF status pill text centering for html2canvas
Replace flexbox-based centering (inline-flex, alignItems, justifyContent)
with explicit height + line-height matching (22px) for reliable rendering
in html2canvas. Flexbox properties don't render consistently when
converting HTML to canvas.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 14:54:48 -06:00
michael
c7228c95a2 Apply UI audit fixes for Barclays design guidelines compliance
- Update font config to prioritize Barclays Effra with Inter fallback
- Add "powered by OLIVER" text to sidebar branding
- Fix sidebar user profile button border radius to consistent 10px
- Update Hero "View Documentation" button to Active Blue outline style
- Remove legacy color definitions from Tailwind config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 14:27:51 -06:00
michael
7698bbbd5a Apply Barclays brand colors to Projects.tsx and fix Sidebar corner radius
Updates Projects.tsx to use Barclays design system colors throughout:
- StatusBadge: bg-warning/bg-success/bg-warning-light/bg-grey-100
- OverallStatusBadge: bg-success/bg-error/bg-grey-300
- Tables: bg-lime headers, bg-grey-300 borders, even:bg-grey-100 rows
- Buttons: rounded-full pill shape, border-2 outlines
- Forms: rounded-[10px], text-black-title labels
- Hover states: hover:bg-info-light for row selection
- Delete modal: rounded-[10px], bg-error delete button

Updates Sidebar.tsx nav buttons from rounded-xl to rounded-[10px] per spec.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 14:19:15 -06:00
michael
0fdaedc7ff Complete UI design system migration to Barclays brand colors
Updates all remaining frontend components to use the new Barclays
design system color tokens:
- brand-dark-blue → primary-blue (#1A2142)
- brand-accent → active-blue (#006DE3)
- brand-light-blue → cyan-brand (#00AEEF)
- brand-gray → grey-100 (#F6F6F6)

Components updated:
- CampaignDetail and ProofDetailView in Campaigns.tsx
- Projects.tsx (full component migration)
- StatusDashboard.tsx (status tiles and colors)
- CreateProjectModal.tsx (modal styling)
- FeedbackReport.tsx (remaining brand colors)
- Login.tsx and Profile.tsx
- WIPReviewer.tsx and CopyGenAI.tsx
- Header, LoadingVisual, ToggleSwitch
- AssetPreview, ProofPreview, AssetUpload
- ProofTypeManager

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 14:00:13 -06:00
michael
75b2c6e699 Update modals and remaining UI components in Campaigns
- Update UploadProofModal with new design system colors
- Update LoadingCell progress bar to active-blue
- Update DeleteConfirmationModal with pill buttons and rounded corners
- Update CampaignDeleteConfirmationModal styling
- Apply consistent border radius (10px) to all modals
- Update drag & drop zone colors to use success theme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:52:57 -06:00
michael
532d7541d6 Implement Barclays design system UI update
- Update Tailwind config with new color tokens (primary-blue, active-blue,
  electric-violet, lime, grey-100/300/700/900, success, warning, error)
- Add Inter font from Google Fonts as Barclays Effra alternative
- Update Sidebar with primary-blue background and white active state
- Update Hero with electric-violet accent and pill-shaped buttons
- Update all tables with lime (#C3FB5A) header backgrounds
- Implement alternating row colors (white/grey-100) on tables
- Update status badges: In Progress (amber), Completed (green)
- Update tabs with active-blue underline styling
- Apply 10px border radius to cards and containers
- Update button styling to pill-shaped with active-blue
- Update input/dropdown borders to grey-700 with 2px
- Update selected state highlighting to info-light (#E7F0FB)
- Update FeedbackReport RAG status colors to new design system

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:50:46 -06:00
michael
e5a841716e Add categorized issue display for revision analysis
When analyzing proof revisions (version > 1), SubReviewCard now displays
issues in three distinct categories: Resolved Issues (green, collapsed by
default), Outstanding Issues (amber), and New Issues (red). Each section
is collapsible with count badges. Original mode (version 1) maintains
backward compatibility with the single "Actionable Issues" list.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:39:42 -06:00
michael
2f547dc494 Detect identical file uploads via MD5 hashing
- Add file_hash and is_identical_file columns to proof_versions table
- Compute MD5 hash on file upload and compare with previous version
- Display warning banner when uploading identical file as revision
- Return is_identical_file in WebSocket response and API endpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:15:48 -06:00
michael
3a5c3bcde3 Implement revision-aware proof analysis pipeline
When a subsequent revision of a proof is uploaded, the analysis now takes
place in context of the previous version's results. The system identifies:
- Resolved issues: fixed in the new revision
- Outstanding issues: still present from previous version
- New issues: introduced in the new revision

Key changes:
- Add resolvedIssues, outstandingIssues, newIssues fields to SubReview
- Add PreviousReviewContext model for passing previous review data
- Update all specialist agents to accept previous_review context
- Extend GeminiService with include_revision_fields parameter
- Add get_latest_version_review() repository method
- Update LeadAgent to synthesize cross-version context in summary
- Fetch previous analysis in WebSocket handler for revisions

First version analysis continues to work exactly as before with revision
fields set to null.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:04:16 -06:00
michael
d97be02b0b Add PDF preview support with on-demand rasterization
- Backend: Generate PDF thumbnail from first rasterized page on upload
- Backend: Add /files/{storage_key}/pages endpoint for PDF rasterization
- Frontend: Add getPdfPages() method to apiService
- Frontend: Create usePdfPages hook for on-demand PDF page loading
- Frontend: Pass pdfPages prop to ProofPreview in Campaigns view

This fixes the issue where PDF uploads showed no visual preview in results.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:56:23 -06:00
michael
0bfe28af59 Add bullet style to actionable issues list in PDF export
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:31:24 -06:00
michael
bf22248025 Fix PDF export formatting by parsing HTML and bullet text
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:26:31 -06:00
michael
17495d4291 Fix feedback report formatting by parsing HTML and bullet text
Add formatFeedbackText() utility that converts raw HTML tags and
concatenated bullet points from Gemini API into properly formatted
React elements with proper line breaks and list styling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:19:28 -06:00
michael
907c3a520e Fix large file preview and download issues
- Add persistent Docker volume for file storage to fix 404 download errors
- Set FILE_STORAGE_PATH env var in Dockerfile and docker-compose.yml
- Increase thumbnail generation limit from 500KB to 10MB for images
- Remove encodeURIComponent from file download URL to prevent path encoding

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:06:41 -06:00
michael
687edb547c Add campaign delete functionality with single and bulk selection
- Add CampaignDeleteConfirmationModal for campaign deletion confirmation
- Add checkbox selection column to CampaignList with select all/indeterminate state
- Add actions column with trash icon for single campaign deletion
- Add bulk actions bar showing selected count with Clear/Delete buttons
- Add handleDeleteCampaign handler in App.tsx using apiService.deleteCampaign
- Pass onDeleteCampaign prop through Campaigns component chain

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:46:51 -06:00
michael
404ba6868b Restructure agent system: remove Tone, split Channel, implement Legal
- Remove Tone Agent (tone is now part of Brand specs)
- Split Channel Agent into Channel Best Practices Agent and Channel Tech Specs Agent
- Convert Legal Agent from stub to full Gemini-powered implementation
- Add new prompt files for channel_best_practices.md, channel_tech_specs.md, legal.md
- Update ReferenceDocsService with new methods for loading specs
- Update schemas and analysis service to use new agent structure
- Update all frontend components to use new agent names and properties
- Update mock data in Projects.tsx and Campaigns.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 11:58:17 -06:00
michael
2cd3b2b9ae Add brand selection support for Barclays vs Barclaycard guidelines
- Add brand field to AnalyzeProofOptions interface and WebSocket message
- Pass campaign's brandGuidelines to analyzeProof in App.tsx (upload & retry)
- Extract brand from WebSocket message in handlers.py and pass to analysis
- Update AnalysisService.analyze_proof to accept brand parameter
- Refactor BrandAgent to dynamically select brand spec based on brand param
- Add get_barclays_brand_spec() method to ReferenceDocsService (placeholder)

The brand agent now uses the appropriate specification (Barclaycard spec or
Barclays spec when available) based on the campaign's brandGuidelines setting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 11:31:59 -06:00
michael
b52162b111 Fix vertical text alignment in RAG status badges for PDF export
Add lineHeight: 1 to RagStatusBadge component styling to ensure text
is tightly contained within its bounding box, allowing flexbox centering
to work correctly in PDF rendering engines.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 09:52:11 -06:00
michael
c1030ee292 Add PDF rasterization support for reliable preview and analysis
PDFs are now converted to PNG images at 200 DPI before being sent to
Gemini for analysis. This fixes the unreliable iframe-based PDF preview
and ensures all pages are properly analyzed.

- Add PyMuPDF dependency for PDF rasterization
- Create pdf_service.py with rasterize() and get_page_count()
- Update agent interfaces to accept list of images for multi-page support
- Add analyze_with_images() to Gemini service for multi-image analysis
- Return rasterized PDF pages via WebSocket for frontend display
- Add page navigation UI for multi-page PDFs in preview components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 09:36:56 -06:00
michael
caf4539e1d Fix analytics pass rate calculation and add Analysis Errors stat
- Exclude errors from pass rate denominator since they weren't successfully reviewed
- Add missing Analysis Errors stat card to display error count
- Update grid layout to accommodate 5 stat cards

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 09:19:44 -06:00
michael
a4d67fdf46 Format campaign last modified date for better readability
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 09:09:10 -06:00
michael
f1776df710 Persist navigation state in URL for browser refresh support
- Add URL utility functions for parsing and building URL state
- Initialize app state from URL parameters on page load
- Sync navigation changes to URL via browser history API
- Handle browser back/forward navigation with popstate listener
- Support deep linking to campaigns and proofs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 09:04:04 -06:00
michael
e2fd9549f7 Add support email functionality via Mailgun
Backend:
- Add email_service.py with Mailgun API integration
- Add SupportEmailRequest schema for email endpoint
- Add Mailgun config settings (API URL, key, from address, support email)
- Update .env.example with Mailgun configuration variables

Frontend:
- Update Login.tsx SupportModal to send emails via /api/support/email
- Update Profile.tsx question form to send emails via apiService
- Add loading states, success/error feedback, and auto-close on success

The support forms on both the login page and profile page now actually
send emails to the support team instead of just showing alerts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 07:03:11 -06:00
michael
b119951f93 Fix retry button for failed proofs and hook up download asset button
- Add GET /files/{storage_key:path} endpoint to serve stored files
- Add getFile() method to apiService to fetch files from backend
- Update convertProofToFrontend() to preserve fileStorageKey
- Update handleRetryAnalysis() to fetch file from backend when not in memory
- Update handleDownload() to download original file instead of thumbnail

After page refresh, the retry button now fetches the original file from
backend storage using the fileStorageKey, allowing failed proofs to be
reprocessed. The Download Asset button also now downloads the original
uploaded file rather than the preview thumbnail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 07:01:58 -06:00
michael
874c1fceee Add debugging for proof types not showing in dropdown
Backend logging:
- Log channel, sub-channel, and proof type counts in get_all_hierarchical()
- Log Meta proof types specifically
- Log API response for Social.Meta

Frontend logging:
- Log raw API response in apiService
- Log dropdown options in App.tsx when loaded
- Log available proof types in UploadProofModal when channel/subchannel selected

This will help diagnose why Meta proof types are not appearing on staging.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:09:25 -06:00
michael
96d459c322 Center text in PDF report status badges
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 10:13:20 -06:00
michael
74930d623f Replace agent icons with clean Heroicons
Replaced custom AI-generated icons with standard Heroicons for a more
professional appearance on the home page.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 10:02:28 -06:00
michael
8038e4014e Make Workfront Campaign ID optional and propagate to proofs
The Workfront Campaign ID field is now optional when creating campaigns.
When provided, it is used as the base for proof workfront IDs instead of
generating random ones.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:49:23 -06:00
michael
abfcb6aae2 Fix campaign status change not persisting in UI
Use optimistic update pattern to immediately reflect status changes
in the UI, with rollback on API error.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:31:59 -06:00
michael
5d5bfd571b Update browser tab title to Barclays Mod Comms
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:24:27 -06:00
michael
5fc36e358f Add Download Report button to proof detail view
Rename Download button to Download Asset and add new Download Report
button that generates a PDF report for the current proof version directly
from the proof review screen.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:15:18 -06:00
michael
e59960b23b Fix home page responsiveness on small screens
- Make Hero height responsive (350px mobile, 400px tablet, 500px desktop)
- Remove overflow-hidden and flex-1 from ChecksOverview to allow
  content to flow naturally and enable scrolling
- Add responsive padding to ChecksOverview for better mobile spacing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 10:07:46 -06:00
michael
9c25677563 Make Agency Lead field editable in campaign creation
- Add agencyLead state and form field to CreateCampaignModal
- Remove disabled attribute and hardcoded value from Agency Lead input
- Pass agency_lead to backend API when creating campaigns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 10:00:23 -06:00
michael
c3396be029 Fix download button in proof detail view
The download button was only logging to console instead of
downloading the proof file. Added handleDownload function that
supports both data URLs and remote URLs with proper CORS handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 06:16:07 -06:00
michael
6bdb02d78b Seed database with agencies, brand guidelines, and dropdown options
Backend:
- Update migration to seed agencies (OLIVER Agency, Barclays, etc.)
- Seed brand guidelines (Barclays, Barclaycard) in dropdown_options
- Seed channel/sub-channel/proof-type hierarchy
- Add /api/agencies endpoint to list all agencies
- Update DropdownOptionsResponse to include brand_guidelines
- Update dropdown repository to return brand guidelines

Frontend:
- Update DropdownOptions interface to include brandGuidelines
- CreateCampaignModal now receives brand guidelines from API
- Settings UsersTab fetches agencies from API instead of hardcoded list
- Add getAgencies() method to apiService

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 17:16:23 -06:00
michael
dd5ee09d07 Fix JWT signature verification by requesting correct token audience
- Change frontend apiTokenRequest scopes from OpenID-only to CLIENT_ID/.default
  This makes Azure AD issue tokens with audience = app client ID instead of Graph API
- Add diagnostic logging in backend to show token claims before verification
- Fixes 401 Unauthorized errors on all API calls after login

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 16:59:54 -06:00
michael
c07c66a583 Connect frontend to PostgreSQL database via API
- Replace all localStorage-based state management with API calls
- Load campaigns, proofs, and audit items from database
- Persist proof analysis results to database via WebSocket
- Add dropdown options CRUD API endpoints (channels, sub-channels, proof types)
- Create DropdownRepository for managing dropdown options
- Update Analytics component to fetch data from API
- Remove demo data and localStorage persistence code

Frontend changes:
- App.tsx: Initialize apiService with MSAL, use API for all CRUD operations
- apiService.ts: Add dropdown options API methods
- Analytics.tsx: Fetch stats from /api/analytics

Backend changes:
- New dropdown_repository.py for dropdown CRUD
- routes.py: Add 7 dropdown endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 13:50:37 -06:00
michael
6ff69cc308 Display actual user name in sidebar from MSAL
- Add userName and userEmail props to Sidebar component
- Pass user info from MSAL to Sidebar in App.tsx
- Replace hardcoded "Steve O'Donoghue" with actual logged-in user

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 13:23:28 -06:00
michael
04527d65db Add MSAL debug logging to frontend and backend
- Frontend: Set MSAL log level to Info, add [MSAL] prefix
- Frontend: Add [MSAL Auth] logs for token acquisition
- Frontend: Add [MSAL Login] logs for login popup flow
- Backend: Add [MSAL Backend] logs for token verification
- Backend: Add [MSAL Backend] logs for auth dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 13:11:30 -06:00
Michael Clervi
dc17cd087c permissions changes 2025-12-18 16:51:27 +00:00
michael
5b9e824da9 Use OpenID scopes instead of custom API scopes
- Change frontend scopes from api://{client_id}/.default to
  openid, profile, email for simpler authentication
- Update backend token validation to expect ID token format:
  - Audience: client_id (not api://{client_id})
  - Issuer: v2.0 endpoint

This avoids requiring Application ID URI setup in Azure AD.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:50:02 -06:00
michael
3f1e1b5227 Fix React version mismatch with MSAL packages
Downgrade React from 19.x to 18.3.1 for compatibility with
@azure/msal-react v3.x which requires React 18.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:31:01 -06:00