[refactor] add Chat Message component with File Text parsing API#96
Open
[refactor] add Chat Message component with File Text parsing API#96
Conversation
- Add models/File.ts with FileModel class for uploading files via signed links - Add file attach button (left of input) triggering multi-file selector - Add paste/drop handlers on TextField to extract and upload files - Each uploaded file is sent as a separate ConsultMessage (markdown link/image) - Send button disabled during file or message upload - Add attach_files translation key to all 3 locale files Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for file upload and parsing in demand assessment page
feat: file upload support on requirement evaluation chat page
Mar 6, 2026
TechQuery
requested changes
Mar 6, 2026
- Extract paste/drop handling into standalone PasteDropBox component that reads text/html, text/plain, and files from DataTransfer and fires separate onHTML, onText, onFiles callbacks - Replace hidden input + ref + onClick with MUI component="label" pattern on IconButton (sr-only input inside the button label) - Wrap TextField with PasteDropBox in project evaluation page Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
[refactor] simplify Copilot codes [optimize] upgrade to ESLint 10 & other latest Upstream packages
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.
Adds file attach, paste, and drop support to the project evaluation chat input. Each uploaded file is sent as its own
ConsultMessagewith a markdown image embed or link.Changes
models/File.ts(new)FileModel extends TableModel<Base>— wraps the signed-link file upload flowupload(file: File | Blob): POSTs tofile/signed-link/{name}for a{ putLink, getLink }pair, PUTs the file directly to the CDN URL via nativefetch, returns the public download URLcrypto.randomUUID()for Blob filenames to avoid collisionscomponents/PasteDropBox.tsx(new)<PasteDropBox />wrapper component that interceptsonPasteandonDropevents from its childrenDataTransferItemListand fires separate callbacks:onFiles(files: File[])text/html) →onHTML(html: string)text/plain) →onText(text: string)preventDefault()is only called when the corresponding callback is providedpages/dashboard/project/[id].tsxcomponent="label"pattern —<IconButton component="label">with asr-only<input type="file" multiple>inside, eliminating the need for a ref and manual click handlerTextFieldis wrapped with<PasteDropBox onFiles={this.handleFiles}>to proxy paste and drop file eventshandleFiles: uploads each file sequentially, sendsConsultMessageasfor images or[name](url)otherwisefileStore.uploading > 0 || messageStore.uploading > 0Translation (
en-US/zh-CN/zh-TW)attach_fileskey for the file button tooltipOriginal prompt
Human changes
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.