Skip to content

1.5.3#18

Merged
ram6ert merged 18 commits intomasterfrom
dev
Oct 7, 2025
Merged

1.5.3#18
ram6ert merged 18 commits intomasterfrom
dev

Conversation

@ram6ert
Copy link
Owner

@ram6ert ram6ert commented Oct 4, 2025

No description provided.

ram6ert and others added 18 commits September 26, 2025 14:58
- Add centralized download manager with streaming support to prevent memory overflow
- Support up to 3 concurrent downloads with automatic queueing
- Implement smart filename detection from GET response headers
- Add stream pause/resume mechanism to extract real filenames before showing save dialog
- Create Download Center UI component with real-time progress tracking
- Replace all legacy download APIs with unified system
- Fix homework attachment downloads with correct URL construction (id/noteId parameters)
- Add comprehensive documentation for download system
- Remove HEAD request dependency, use GET response headers instead
- Always prompt user for save location with server-provided filename

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add DownloadCenter component to App.tsx for global download management
- Create .eslintignore to exclude build and release directories from linting
- Update download system documentation with integration details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Split the large api.ts file (1398 lines) into focused, maintainable modules:

- api/utils.ts: Shared utilities (interceptors, rate limiting, sanitization)
- api/homework.ts: Homework operations (submit, fetch, download)
- api/course.ts: Course operations (list, details, caching)
- api/document.ts: Document operations (fetch, streaming)
- api/schedule.ts: Schedule operations (fetch, parse)
- api/index.ts: Main entry point aggregating all modules
- api.ts: Backward compatibility re-export layer

Benefits:
- Improved code organization and separation of concerns
- Better readability and maintainability
- Easier to locate and modify specific functionality
- Maintains backward compatibility with existing imports
- Updated documentation to reflect new structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add batch download functionality to DocumentList allowing users to select multiple documents and download them all to a single folder at once. Features include:
- Checkbox-based multi-select with select all/clear controls
- Folder selection dialog for batch downloads
- Keyboard shortcuts (Cmd-A/Ctrl-A for select all, Cmd-S/Ctrl-S for batch download)
- Automatic integration with download center
- Full i18n support (English/Chinese)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed batch download to create all tasks in parallel instead of sequentially:
- Download manager: start tasks asynchronously without blocking
- DocumentList: use Promise.allSettled() instead of sequential await loop
- Up to 3 downloads now run concurrently as designed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Consolidated all download operations to use the unified downloadAddTask API:
- Removed deprecated download handlers (downloadCourseDocument, downloadHomeworkAttachment, downloadSubmittedHomework)
- Updated DocumentList and HomeworkCard to use unified API
- Cleaner, more consistent download system

Added comprehensive ID field documentation across all files:
- Internal system IDs (courseId, homeworkId, etc.): numeric IDs as strings (e.g., "12345")
- Human-readable identifiers (courseNumber, courseCode): alphanumeric display codes (e.g., "M302005B")
- Updated all docs, type definitions, and code comments
- Added JSDoc warnings to prevent ID type confusion

Documentation files updated:
- @docs/download-system.md: Unified API examples, ID conventions
- @docs/data-models-types.md: ID field conventions section
- @docs/backend-apis-services.md: API ID conventions
- All TypeScript type definitions with inline comments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add DocumentDirectory type for folder/subdirectory structures
- Update fetchCourseDocumentsByType to accept upId parameter for directory navigation
- Enhance API responses to include both documents and directories
- Add sanitizeDocumentDirectory function for data transformation
- Update streaming functions to support hierarchical navigation
- Modify IPC handlers to accept upId in options
- Update cache keys to include upId for proper cache isolation
- Comment out STATUS field from CourseDocumentsResponse (server indicator only)

This enables navigation of nested document directories by using a directory's
id as the upId parameter in subsequent queries. Root level uses upId=0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add DocumentDirectory import and state management
- Implement directory navigation with breadcrumb UI
- Add folder display with click-to-enter functionality
- Update stream handlers to process directories from API
- Add navigation functions (handleEnterDirectory, handleNavigateToPath)
- Update API calls to pass upId parameter for directory navigation
- Display directories before documents with folder icon (📁)
- Show current path with interactive breadcrumb navigation
- Reset to root directory when switching courses
- Clear selection when navigating between directories
- Update item counts to include both documents and directories
- Filter directories by search term along with documents

Users can now navigate through document directories by clicking on folders,
and use breadcrumb navigation to go back to parent directories. The UI
clearly distinguishes between folders and files with appropriate icons.
Switching courses automatically resets to the root directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add selectedDirs state to track selected directories
- Add toggleDirSelection function for directory selection
- Implement fetchAllDocumentsFromDirectory for recursive traversal
- Update batch download to handle both documents and directories
- Add checkboxes to directory items with click prevention on navigation
- Update toggleSelectAll to include directories
- Clear directory selections when navigating
- Update keyboard shortcuts to work with combined selections
- Show detailed selection count (X files, Y folders)
- Create folder structure automatically when downloading directories
- Recursively fetch all documents from selected directories and subdirectories

Users can now select multiple directories and download all contained documents
with the folder structure automatically created in the download location.
The system recursively traverses all subdirectories to collect all documents.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add upId parameter to getCourseDocuments options in preload TypeScript types
- Add upId parameter to refreshDocuments and streamDocuments options
- Fix return type from any[] to any for getCourseDocuments (returns object not array)
- Fix fetchAllDocumentsFromDirectory to not check for non-existent success field
- getCourseDocuments now properly accepts upId for directory navigation

This fixes the empty return issue when recursively fetching documents from
directories. The API now correctly supports the upId parameter for navigating
the directory hierarchy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add directory existence check before creating write stream
- Use fs.mkdirSync with recursive: true to create all parent directories
- Ensures nested folder structures are created for directory downloads

This fixes download failures when batch downloading directories with nested
folder structures. The system now automatically creates any missing parent
directories before attempting to save files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive type definitions for all API methods and event handlers:
- Imported domain types (Course, Homework, HomeworkDetails, etc.)
- Created SessionData, CacheData, UpdateStatusData, UpdateDownloadData interfaces
- Replaced all any types with IpcRendererEvent and domain-specific types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ram6ert ram6ert merged commit b1c0290 into master Oct 7, 2025
6 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.

1 participant