Skip to content

fix: accept .trace files and unblock .log in macOS file picker#10

Merged
tomusdrw merged 1 commit intomainfrom
td-log-trace-upload
Apr 21, 2026
Merged

fix: accept .trace files and unblock .log in macOS file picker#10
tomusdrw merged 1 commit intomainfrom
td-log-trace-upload

Conversation

@tomusdrw
Copy link
Copy Markdown
Member

Summary

  • Add .trace to the upload screen's accepted extensions
  • Broaden the file input's accept attribute with text/plain and application/octet-stream so macOS' UTI-based picker stops greying out .log / .trace files
  • JS validation still strictly rejects anything outside ACCEPTED_EXTENSIONS
  • Sync docs/usage-guide.md and spec/ui/sprint-10-file-upload.md

Test plan

  • Open the Load page in macOS Chrome, click browse, confirm .log and .trace files are selectable (not greyed out)
  • Upload a fixtures/trace-001.log → format badge shows "Trace", file loads
  • Upload a file renamed to .trace → accepted; format auto-detected
  • Upload an unsupported extension (e.g. .txt) → rejected with inline error
  • npm run lint passes
  • npm run build passes

🤖 Generated with Claude Code

Add .trace to the upload screen's accepted extensions and broaden the
file input's accept attribute with text/plain and
application/octet-stream. macOS' UTI-based file picker was greying out
.log (and would do the same for .trace) despite the extensions being
listed; the broader MIME hints let users select them while JS-side
validation still enforces the strict extension allowlist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for pvm-debugger ready!

Name Link
🔨 Latest commit 4950d74
🔍 Latest deploy log https://app.netlify.com/projects/pvm-debugger/deploys/69e71de639604200089e4d7e
😎 Deploy Preview https://deploy-preview-10--pvm-debugger.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

This pull request adds support for .trace file uploads by extending the accepted file extensions list from [.jam, .pvm, .bin, .log, .json] to include .trace. The file upload component is updated with improved MIME type handling for browser file picker filtering, and documentation is updated accordingly.

Changes

Cohort / File(s) Summary
File Upload Component
apps/web/src/components/load/FileUpload.tsx
Added .trace to the allowed filename extensions list and updated the <input> accept attribute to include MIME types (text/plain, application/octet-stream) alongside extensions for improved browser file picker filtering.
Documentation Updates
docs/usage-guide.md, spec/ui/sprint-10-file-upload.md
Updated documentation and specification to reflect the addition of .trace as an accepted file extension in the file upload feature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: adding .trace file support and fixing the macOS file picker to show .log files.
Description check ✅ Passed The description clearly relates to the changeset, detailing the .trace extension addition, MIME type broadening, validation logic, and documentation synchronization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch td-log-trace-upload

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
spec/ui/sprint-10-file-upload.md (1)

72-87: ⚠️ Potential issue | 🟡 Minor

Acceptance/verification sections should include the newly discovered edge cases.

The spec now lists .trace, but the formal Acceptance Criteria and Verification block still miss explicit checks for macOS picker behavior and unsupported-extension rejection.

📌 Suggested spec patch
 ## Acceptance Criteria
 
 - Load page uses a two-column layout.
 - File upload supports drag-and-drop and file picker.
+- File picker allows selecting `.log` and `.trace` on macOS browsers.
 - Selected file shows name and byte count.
 - Format is auto-detected.
 - Continue enables only after valid selection.
+- Unsupported extensions (for example, `.txt`) are rejected with an inline error.
 - `cd apps/web && npx vite build` succeeds.
 - E2E tests pass.
 
 ## Verification
 
 ```bash
 cd apps/web && npx vite build
 npx playwright test e2e/sprint-10-file-upload.spec.ts
+# Manual checks:
+# - In macOS Chrome, confirm `.log` and `.trace` are selectable in file picker.
+# - Upload a `.trace` file and verify Trace format detection.
+# - Upload an unsupported extension (e.g. `.txt`) and verify inline rejection.
</details>

 

As per coding guidelines, `spec/**/*.md`: Mark spec files as implemented by adding `Status: Implemented` to the top and enhance acceptance criteria with edge cases, pitfalls, and verification steps discovered during implementation.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @spec/ui/sprint-10-file-upload.md around lines 72 - 87, Add "Status:
Implemented" at the top of the spec and update the Acceptance Criteria and
Verification sections to explicitly cover the newly discovered edge cases:
include macOS picker behavior (confirm .log and .trace are selectable in
macOS Chrome), verify .trace uploads trigger Trace format auto-detection, and
verify inline rejection for unsupported extensions (e.g., .txt). Update the
Verification block to include the new manual checks (macOS picker selection,
.trace detection, unsupported-extension rejection) alongside the existing
build and E2E commands so the spec and verification steps match the implemented
behavior.


</details>

</blockquote></details>

</blockquote></details>
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@spec/ui/sprint-10-file-upload.md`:
- Around line 72-87: Add "Status: Implemented" at the top of the spec and update
the Acceptance Criteria and Verification sections to explicitly cover the newly
discovered edge cases: include macOS picker behavior (confirm `.log` and
`.trace` are selectable in macOS Chrome), verify `.trace` uploads trigger Trace
format auto-detection, and verify inline rejection for unsupported extensions
(e.g., `.txt`). Update the Verification block to include the new manual checks
(macOS picker selection, `.trace` detection, unsupported-extension rejection)
alongside the existing build and E2E commands so the spec and verification steps
match the implemented behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cddd168f-a55b-4245-bd0b-7930742ff426

📥 Commits

Reviewing files that changed from the base of the PR and between 8cfa4bd and 4950d74.

📒 Files selected for processing (3)
  • apps/web/src/components/load/FileUpload.tsx
  • docs/usage-guide.md
  • spec/ui/sprint-10-file-upload.md

@tomusdrw tomusdrw merged commit 90ea63f into main Apr 21, 2026
7 checks passed
@tomusdrw tomusdrw deleted the td-log-trace-upload branch April 21, 2026 07:20
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