Skip to content

Conversation

@david-roper
Copy link
Collaborator

@david-roper david-roper commented Oct 22, 2025

add excelSubjectTable download function to excel utils

Add excel wide and long options to subject table download

add test for the method and confirming its contents

closes issue #904

Summary by CodeRabbit

Release Notes

  • New Features
    • Added Excel export format options ("Excel" and "Excel Long") to data table export functionality
    • Users can now export subject data in Excel format alongside existing CSV, TSV, and JSON options
    • Excel Long export provides an extended data view with reformatted columns for better readability

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR adds Excel export functionality to the instrument visualization system. It introduces a new downloadSubjectTableExcel utility function, extends the export hook to handle Excel and Excel Long formats alongside existing options, adds corresponding test coverage, and exposes these formats in the data table UI dropdown.

Changes

Cohort / File(s) Summary
Excel utility
apps/web/src/utils/excel.ts
New exported function downloadSubjectTableExcel that creates and writes Excel workbooks from a records array
Excel utility tests
apps/web/src/utils/__tests__/excel.test.ts
Basic test asserting the new function is defined
Export hook
apps/web/src/hooks/useInstrumentVisualization.ts
Extended dl function to accept 'Excel' and 'Excel Long' export options with corresponding switch cases for wide and long row generation
Export hook tests
apps/web/src/hooks/__tests__/useInstrumentVisualization.test.ts
Two new test suites validating Excel and Excel Long exports trigger the download mock, generate correct filenames, and produce expected data structures
Data table UI
apps/web/src/routes/_app/datahub/$subjectId/table.tsx
Added "Excel" and "Excel Long" options to the export format dropdown

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Changes follow existing patterns with straightforward additions to export logic and test coverage. Minimal logic density and consistent pattern application across files.

Possibly related PRs

Suggested reviewers

  • joshunrau
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfe3f6b and c7c5af6.

📒 Files selected for processing (5)
  • apps/web/src/hooks/__tests__/useInstrumentVisualization.test.ts (3 hunks)
  • apps/web/src/hooks/useInstrumentVisualization.ts (3 hunks)
  • apps/web/src/routes/_app/datahub/$subjectId/table.tsx (1 hunks)
  • apps/web/src/utils/__tests__/excel.test.ts (1 hunks)
  • apps/web/src/utils/excel.ts (1 hunks)

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

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

@joshunrau joshunrau merged commit 47b7479 into DouglasNeuroInformatics:main Oct 22, 2025
1 of 2 checks passed
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.

2 participants