Skip to content

Conversation

@FireFistisDead
Copy link
Contributor

Fixes

It fixes the subjects without display will also be shown in the csv file and also while importing they are getting sucessfully imported
Closes #129

Description

This pull request introduces a comprehensive CSV import feature for schedules and subjects, allowing users to import data directly into the app from CSV files. It includes robust CSV parsing and validation, UI integration for importing, and enhancements to the export format. The changes span the UI, state management, CSV utilities, and Android file provider configuration.

CSV Import Functionality

  • Added a new utility csv-import.ts that robustly parses, validates, and imports schedule/subject data from CSV files, handling both single and multiple register formats, unscheduled subjects, and time slot normalization. It provides user feedback and error handling throughout the process.
  • Added pickCSVFileRaw in csv-picker.ts to fetch raw CSV file content for import, supporting the new import workflow.

UI Integration

  • Added "Import Schedule from CSV" button to SettingsScreen, with logic to trigger the CSV import process, validate, and add subjects to the active register, including error handling and user confirmation dialogs. [1] [2]
  • Updated CustomTabBar to support subject import via CSV, using the new utilities and providing error feedback.

State Management

  • Added a new store action addMultipleCards to efficiently add imported cards to a register, supporting bulk operations from CSV import. [1] [2]

CSV Export Enhancement

  • Improved CSV export format in csv-export.ts to include a section for subjects without scheduled time slots, making exports more informative and compatible with the new import logic. [1] [2] [3]

Android File Provider Support

  • Added provider_paths.xml to configure Android file provider paths, ensuring compatibility for file sharing and CSV import/export on Android devices.

Files Changed

Screenshots/Videos

https://drive.google.com/file/d/1inc5w0eyp6GiSyTfKRI5BemWCFV1UXLL/view?usp=sharing

GSSoC Contributor

  • Yes, I am a GSSoC contributor

Testing Device

  • Physical Android Device

@FireFistisDead
Copy link
Contributor Author

@Irtesaam is this fine??

@FireFistisDead
Copy link
Contributor Author

@Irtesaam can you review this PR

Copy link
Collaborator

@Irtesaam Irtesaam left a comment

Choose a reason for hiding this comment

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

@FireFistisDead The changes looks good but a couple of edge cases you should fix:

  1. Import via Quick Action menu throws import error : Cannot read property 'length' of undefined in some cases while the Settings import works fine. Likely you haven't updated the quick actions import function.
  2. Subjects without slots import correctly, but their classroom isn’t being picked up if no slots are defined.

For now, I am approving and merging these changes as its not a breaking change, but please raise a follow-up issue to fix these.

@Irtesaam Irtesaam merged commit bcd93e8 into Loop-Hive:main Aug 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix subjects without any slots

2 participants