Skip to content

[FEATURE] Add export/download options for code history — download as .zip or push to GitHub Gist #714

@Abhushan187

Description

@Abhushan187

Problem

Users can save code to Firestore history, but there is no way to bulk export their saved files or share them externally. Users who want to backup their work, submit assignments, or share solutions must manually copy-paste each file individually.


Proposed Improvement

Add export functionality to the History Panel allowing users to download all saved code as a structured .zip file or publish directly to GitHub Gist. The feature should:

  • Add "Download as ZIP" button to HistoryPanel.jsx exporting all saved files with original filenames
  • Add "Publish to Gist" button creating a public/private GitHub Gist via GitHub API
  • Preserve language file extensions (.py, .js, .cpp, etc.) in the export
  • Include a metadata JSON file with save timestamps and language info
  • Show export progress and success/error toasts
  • Respect GitHub Gist's 100-file limit with pagination warnings

Expected Impact

  • Better user experience with portable code backups
  • Improved accessibility for students submitting coursework
  • Higher usability for developers sharing code snippets
  • Better long-term scalability with pluggable export providers

Possible Implementation

  • Add exportHistory.js utility in src/utils/ using JSZip for .zip generation
  • Add gistService.js in src/services/ for GitHub Gist API integration (OAuth token from user)
  • Extend HistoryPanel.jsx with export action buttons and progress modal
  • Add ExportProgressModal component with progress bar and cancel option
  • Store GitHub OAuth token encrypted in localStorage (reuse existing AES-GCM pattern)
  • Add GITHUB_GIST_API_URL to environment config
  • Write tests for ZIP generation, Gist creation, and error handling (network failure, auth failure)

I'm GSSoC'26 contributor, Please assign this task to me!

Metadata

Metadata

Assignees

No one assigned

    Labels

    gssocOfficial GSSoC '26 issue tagtype:bugVulnerability or logical bug fixestype:featureNew functional feature additionstype:refactorCode refactoring and cleanliness updatestype:securitySecurity patches and threat fixestype:testingIntegration and unit test coverage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions