lisa/fix-screenshots-only-as-image-types#234
Open
gusfcarvalho wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the workflow evidence submission UI to restrict “screenshot” evidence uploads to image-only file extensions (instead of allowing documents like PDFs), and adds unit tests to verify the new behavior.
Changes:
- Make the
<input type="file">acceptattribute dynamic based on selected evidence type (document vs screenshot). - Add client-side validation to reject files whose extensions aren’t allowed for the selected evidence type (both on file selection and on submit).
- Add Vitest coverage for screenshot-vs-document accepted extensions and validation messaging.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/views/workflow-executions/partials/EvidenceSubmissionForm.vue | Adds per-evidence-type file extension allowlists, dynamic accept, and validation error handling. |
| src/views/workflow-executions/partials/tests/EvidenceSubmissionForm.spec.ts | Introduces tests validating screenshot-only image extensions and preserved document support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/composables/workflows/useStepExecutions.ts:165
- The extension-based MIME type fallback map is missing entries for
.doc/.docx, even though the UI allows those file types fordocumentevidence. If a browser provides an empty/unknownFile.type, document uploads will be sent asapplication/octet-streaminstead of the expected Word MIME types. Adddocanddocxmappings here (and any other supported extensions) to keep the inferredmediaTypeconsistent with the upload constraints.
} else if (ev.fileName) {
// Guess from extension
const ext = ev.fileName.split('.').pop()?.toLowerCase();
const mimeTypes: Record<string, string> = {
pdf: 'application/pdf',
png: 'image/png',
jpg: 'image/jpeg',
jpeg: 'image/jpeg',
gif: 'image/gif',
webp: 'image/webp',
txt: 'text/plain',
json: 'application/json',
xml: 'application/xml',
};
Contributor
Author
|
lisa: implementation done. no actionable copilot review threads found. |
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.
automated implementation by lisa.