Skip to content

fix: address code review issues from PR #9#18

Open
numbers-official wants to merge 3 commits intomainfrom
fix/pr9-review-issues
Open

fix: address code review issues from PR #9#18
numbers-official wants to merge 3 commits intomainfrom
fix/pr9-review-issues

Conversation

@numbers-official
Copy link
Copy Markdown
Collaborator

Summary

Applies targeted fixes to the code introduced in #9, based on review feedback:

  • Remove auto pip install in proofsnap_host.py — replaced with a clear error message and sys.exit(1) to avoid silently running pip install at import time
  • Remove CORS Access-Control-Allow-Origin: * — the HTTP server is only consumed by local scripts (curl/PowerShell), which don't enforce CORS; the wildcard header was allowing any website to trigger captures
  • Fix asyncio.get_event_loop() deprecation — replaced with asyncio.get_running_loop() (deprecated since Python 3.10)
  • Remove dead native messaging filescom.numbersprotocol.proofsnap.json, install.sh, install.ps1 registered a Chrome Native Messaging host that the extension never uses (it connects via raw WebSocket, not chrome.runtime.connectNative())
  • Fix JSX indentation in AssetEditModal error display block

Test plan

  • Run python proofsnap_host.py without websockets installed — should print error and exit
  • Run python proofsnap_host.py with websockets installed — should start normally
  • Verify capture via curl -X POST http://localhost:19999/capture still works
  • Verify popup headline/caption modal renders correctly
  • Verify error message displays for failed assets in edit modal

Generated by Sherry Chung with Omni

Steffdarz and others added 3 commits March 11, 2026 06:25
- Add AssetEditModal component to popup for adding metadata before upload
- Skip auto-upload when capturing from popup to allow user to fill metadata first
- Preserve existing metadata when updating headline/caption
- Add skipAutoUpload flag to capture message payload
- Add CSS styling for the edit modal
- Add delete button in AssetEditModal with confirmation dialog
- Add handleDeleteAsset function to remove screenshots from IndexedDB
- Add CSS styling for delete button
- native-host/proofsnap_host.py
  - Replace silent auto pip-install with a clear error message and sys.exit(1)
  - Remove Access-Control-Allow-Origin: * and do_OPTIONS handler; CORS is
    unnecessary since curl/scripts don't enforce it and browser-based
    access from arbitrary websites is undesirable
  - Use asyncio.get_running_loop() instead of deprecated get_event_loop()

- native-host: remove com.numbersprotocol.proofsnap.json, install.sh,
  install.ps1 — these register a Chrome Native Messaging host that the
  extension never uses (extension connects via raw WebSocket, not
  chrome.runtime.connectNative), so they are dead and misleading code

- src/popup/popup.tsx: fix indentation of edit-modal-error block to
  align with sibling elements
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.

2 participants