Skip to content

Export & Import task#80

Merged
MaddieWright merged 2 commits intoUBCMint:mainfrom
Tiya-Verma:main
Mar 24, 2026
Merged

Export & Import task#80
MaddieWright merged 2 commits intoUBCMint:mainfrom
Tiya-Verma:main

Conversation

@Tiya-Verma
Copy link
Copy Markdown
Contributor

Pull Request Template

What?

Implemented full-stack functionality to allow users to export their recorded EEG session data to CSV files and load existing CSV data back into active web sessions.

How?

  • Backend Integration & Proxy: Created two New Next.js API route handlers (/api/sessions/[session_id]/eeg_data/export & import) to securely proxy frontend requests to the Python backend API.
  • API Helper Library: Added exportEEGData, importEEGData, and downloadCSV helper functions to ib/eeg-api.ts to manage API requests and handle the browser-side file downloads using Blob URLs.
  • Frontend Dialog Components: Built the ExportDialog and ImportDialog
  • UI Hooks via App Header: Plumbed the new components into app-header.tsx, adding the toggle state and triggering the dialogs via the "Export Data" & "Import Data" buttons.

Testing

  • Uploaded a .csv datasets through the Import dialog and verified that the importEEGData function correctly posts the data payload up to the proxy endpoint.
  • Tested exporting an entire session (by leaving Start and End time blank) and verified that the browser receives and correctly downloads the generated session_[id]_[timestamp].csv file.
  • Ran Next.js component build checks (npx tsc) successfully.

Copy link
Copy Markdown
Collaborator

@MaddieWright MaddieWright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add some slight ui changes, but looks amazing, good work!

@MaddieWright MaddieWright merged commit ff600a1 into UBCMint:main Mar 24, 2026
1 check failed
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