Skip to content

Add CSV and PDF export for local appraisals#510

Merged
InfinityBowman merged 6 commits into
mainfrom
feat/local-appraisal-export
May 1, 2026
Merged

Add CSV and PDF export for local appraisals#510
InfinityBowman merged 6 commits into
mainfrom
feat/local-appraisal-export

Conversation

@InfinityBowman
Copy link
Copy Markdown
Owner

@InfinityBowman InfinityBowman commented May 1, 2026

Summary

  • Add CSV export with full detail: AMSTAR2 checkboxes, ROB2/ROBINS-I signalling questions and domain judgments
  • Add PDF export that renders the complete checklist form (questions, answers, judgments, preliminary sections)
  • Export individual appraisals or all at once via dropdown menu on each card and in the section header
  • Reads answer data from Y.Doc for non-finalized checklists so in-progress work is exportable

Closes #508

Test plan

  • Create local appraisals of each type (AMSTAR2, ROB2, ROBINS-I)
  • Export single appraisal as CSV, verify all sub-items are present
  • Export single appraisal as PDF, verify full form renders with answers
  • Export all appraisals at once in both formats
  • Verify non-finalized (in-progress) checklists export with current answers
  • Check dropdown menus don't wrap text

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added CSV and PDF export functionality for individual and bulk appraisal exports
  • Refactor

    • Modernized authentication system to use state store pattern
    • Enhanced type safety for user profile data
  • Style

    • Redesigned error UI components with improved icons and button styling
    • Enhanced visual consistency across error messages and recovery options

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds CSV and PDF export capabilities for appraisals, migrates components from useAuth() hook to Zustand store selectors, exports the AuthUser type with additional fields, deletes the legacy auth hook, redesigns error component UI, and adds type standardization across dashboard components.

Changes

Cohort / File(s) Summary
Package Dependencies
packages/web/package.json
Added jspdf and jspdf-autotable dependencies for PDF generation functionality.
Auth Migration
packages/web/src/components/Navbar.tsx, packages/web/src/lib/auth.ts, packages/web/src/stores/authStore.ts
Removed useAuth() hook, replaced Navbar's authentication data source with Zustand store selectors (useAuthStore(selectIsLoggedIn), useAuthStore(selectUser)), and exported/extended AuthUser interface with givenName and persona optional fields.
Dashboard Type Standardization
packages/web/src/components/dashboard/Dashboard.tsx, packages/web/src/components/dashboard/DashboardHeader.tsx, packages/web/src/components/settings/PersonaSection.tsx
Updated DashboardHeader props to use shared AuthUser | null type, removed inline type assertions, and eliminated unnecessary string type casts on user fields.
Appraisal Export Feature
packages/web/src/components/dashboard/LocalAppraisalCard.tsx, packages/web/src/components/dashboard/LocalAppraisalsSection.tsx, packages/web/src/lib/export-csv.ts, packages/web/src/lib/export-pdf.ts, packages/web/src/primitives/useProject/sync.ts
Added per-card export callbacks (onExportCsv, onExportPdf) with dropdown UI, bulk "Export All" functionality in LocalAppraisalsSection, new CSV export utility supporting AMSTAR2/ROB2/ROBINS-I checklist types with dynamic column composition, new PDF export utility rendering multi-page documents with layout-aware pagination for three checklist types, and exported extractAnswersFromYMap helper for Yjs-driven answer enrichment.
Error Component UI Redesign
packages/web/src/components/RouteError.tsx, packages/web/src/components/project/SectionErrorBoundary.tsx, packages/web/src/routes/__root.tsx
Replaced Alert UI primitives with custom card layouts, changed icons to TriangleAlertIcon, added RefreshCwIcon to buttons, updated button styling from text/underline variants to filled primary buttons with consistent hover/transition effects, and adjusted container shadows/spacing for visual consistency.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • 150 improve yjs handling #151: Both PRs modify Yjs-related project primitives; this PR exports extractAnswersFromYMap and integrates Y.Map-driven answer enrichment in LocalAppraisalsSection for export, while the related PR adjusts Yjs sync gating across useProject hooks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.20% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add CSV and PDF export for local appraisals' directly and clearly summarizes the main feature addition in the changeset.
Linked Issues check ✅ Passed All coding requirements from issue #508 are met: CSV export with sub-items (new export-csv.ts), PDF export with full form rendering (new export-pdf.ts), dropdown UI on cards and section header (LocalAppraisalCard, LocalAppraisalsSection), and Y.Doc answer integration (extractAnswersFromYMap export).
Out of Scope Changes check ✅ Passed Changes to Navbar, RouteError, Dashboard, SectionErrorBoundary, and auth.ts are reasonable refactoring to support the export feature (auth store migration, error UI consistency); all changes align with the core export objectives or are necessary supporting work.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/local-appraisal-export

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@InfinityBowman InfinityBowman merged commit 18eb4c0 into main May 1, 2026
2 of 3 checks passed
@InfinityBowman InfinityBowman deleted the feat/local-appraisal-export branch May 1, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CSV and PDF export for local appraisals

2 participants