feat: support MD/TXT file upload alongside PDF#41
Open
YizukiAme wants to merge 4 commits intoTHU-MAIC:mainfrom
Open
feat: support MD/TXT file upload alongside PDF#41YizukiAme wants to merge 4 commits intoTHU-MAIC:mainfrom
YizukiAme wants to merge 4 commits intoTHU-MAIC:mainfrom
Conversation
When AI generates whiteboard elements that exceed the fixed 1000x562.5 canvas, content was clipped by overflow-hidden with no way to view it. This commit adds interactive navigation to the whiteboard: - Auto-fit: when elements overflow, content is scaled and centered to ensure nothing is clipped (with 24px padding) - Drag-to-pan: hold and drag to pan around the whiteboard - Scroll-to-zoom: mouse wheel zooms in/out (0.2x to 5x range) - Double-click or Reset View button to return to default view - View auto-resets when new whiteboard content loads When content fits within the canvas, behavior is unchanged - no extra cursor, no transforms, no visual regression. Fixes THU-MAIC#19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enable uploading Markdown (
.md,.markdown) and plain text (.txt) files as course material, alongside existing PDF support. Text files bypass the OCR pipeline entirely — their content is read client-side and passed directly to the generation pipeline.Why
Many users have learning materials in Markdown or plain text format. Previously, the upload UI only accepted
.pdffiles, requiring users to convert their notes before uploading.Changes
components/generation/generation-toolbar.tsxacceptfilter to.pdf,.md,.txt,.markdown; addisSupportedFile()helper; update UI labelapp/page.tsxFileReader.readAsText()to populatepdfTextdirectly, skippingstorePdfBlob()and OCRlib/i18n/common.tsdocUploadi18n keylib/i18n/generation.tsHow it works
The generation-preview page already checks
hasPdfToAnalyze = !!pdfStorageKey && !pdfText— whenpdfTextis already populated (text files), it skips directly to outline generation. Zero changes needed in generation-preview.Extensibility
The
isSupportedFile()helper and extension-based branching make it easy to add more formats (.docx,.csv, etc.) in the future.Testing
npx tsc --noEmit).mdfile → content passes to generation.txtfile → content passes to generation.pdffile → existing OCR flow works (no regression)