Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/web/src/components/load/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ import {
} from "react";
import { formatBadgeIntent, formatByteCount, formatLabel } from "./format";

const ACCEPTED_EXTENSIONS = [".jam", ".pvm", ".bin", ".log", ".json"];
const ACCEPT_STRING = ACCEPTED_EXTENSIONS.join(",");
const ACCEPTED_EXTENSIONS = [".jam", ".pvm", ".bin", ".log", ".trace", ".json"];
// Include broad MIME types so browsers (esp. macOS) don't grey out
// .log/.trace files in the system picker due to UTI matching quirks.
const ACCEPT_STRING = [
...ACCEPTED_EXTENSIONS,
"text/plain",
"application/octet-stream",
].join(",");

export interface FileUploadResult {
rawPayload: RawPayload;
Expand Down
2 changes: 1 addition & 1 deletion docs/usage-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Use the examples column on the right to open bundled programs. The six categorie

### From File Upload

Drop a file or use the browse button to load `.jam`, `.pvm`, `.bin`, `.log`, or `.json` input from disk.
Drop a file or use the browse button to load `.jam`, `.pvm`, `.bin`, `.log`, `.trace`, or `.json` input from disk.

![Loader with an uploaded branch.pvm file selected](usage-screenshots/load-upload.png)

Expand Down
4 changes: 2 additions & 2 deletions spec/ui/sprint-10-file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add file upload as a program source on the load page. Users can drag-and-drop or

- Load page has a two-column layout: sources (left) + examples (right)
- File upload supports drag-and-drop and file picker
- Accepted extensions: `.jam`, `.pvm`, `.bin`, `.log`, `.json`
- Accepted extensions: `.jam`, `.pvm`, `.bin`, `.log`, `.trace`, `.json`
- Selected file shows name and byte count
- Format is auto-detected through `detectFormat()`
- `Continue` button appears and enables after valid file selection
Expand Down Expand Up @@ -46,7 +46,7 @@ Use `loadUpload()` and `detectFormat()` from the content package.
Rules:

- support both drag-and-drop and file picker
- accept `.jam`, `.pvm`, `.bin`, `.log`, `.json`
- accept `.jam`, `.pvm`, `.bin`, `.log`, `.trace`, `.json`
- show selected file name and byte count after selection
- detect format automatically
- the UI must not reimplement loading or format detection
Expand Down
Loading