Skip to content

Export & Import task#80

Open
Tiya-Verma wants to merge 1 commit intoUBCMint:mainfrom
Tiya-Verma:main
Open

Export & Import task#80
Tiya-Verma wants to merge 1 commit intoUBCMint:mainfrom
Tiya-Verma:main

Conversation

@Tiya-Verma
Copy link
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.

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.

1 participant