Skip to content

Desktop app: Batch Import reads folders on the computer (D5.2) - #54

Merged
NCCU-Schultz-Lab merged 1 commit into
mainfrom
claude/d5-folders
Nov 6, 2026
Merged

NCCU-Schultz-Lab merged 1 commit into
mainfrom
claude/d5-folders

Conversation

@NCCU-Schultz-Lab

@NCCU-Schultz-Lab NCCU-Schultz-Lab commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The desktop app (#53) shipped with folder import switched off: its Python runs on Pyodide, whose file system isn't the computer's, so a typed path such as C:\Users\you\data pointed at nothing. This PR turns it on.

  • eagleplot/utils/host_folders.py: local_folder(text) mounts the folder the user typed into the app (Emscripten NODEFS, the mechanism @stlite/desktop already uses for nodefsMountpoints) and returns the path to read. Elsewhere it returns the path unchanged.
    • Accepts full Windows, macOS and Linux paths, forward or back slashes, ~ for the home folder, and the quotes added by Windows "Copy as path".
    • Only folders the user names are mounted, each once (case-insensitively on Windows and macOS). A failed mount is not remembered.
    • Relative paths and missing folders get a plain message ("Type the folder's full path…", "Not a folder EaglePlot can open: …").
  • runtime / access: the desktop profile now has local_folders=True. The desktop app reads the user's own disk with no server in between, so the shared-server IP check doesn't apply. The browser build is unchanged: still no folders.
  • Data Upload → Batch Import passes the typed folder through local_folder().
  • Desktop smoke test: Batch Import loads a real folder (2 CSVs plus a .txt that is skipped), and a missing folder shows the message.
  • README, CHANGELOG, and the workflow's trigger paths are updated.

Test plan

  • tests/test_host_folders.py: path normalisation on win32/darwin/linux, relative paths, mounting once, and that failed mounts aren't remembered. Run on Python 3.13 and 3.9.
  • Full suite locally: 1313 passed, 7 skipped.
  • Built the Linux desktop app and ran scripts/desktop/smoke.js as a non-root user under Xvfb: everything passes, including the two new Batch Import checks. Start-up is about 12 s and there are no network requests.
  • CI: tests on every OS, plus the desktop builds on all three OSes with the Linux smoke test.

🤖 Generated with Claude Code

The desktop app's Python runs on Pyodide, whose file system isn't the computer's. The
folder the user types is now mounted into the app (Emscripten NODEFS) when it's read:
full Windows, macOS or Linux paths, ~ for the home folder, quotes from Copy as path.
Only folders the user names are mounted, each once.

- eagleplot/utils/host_folders.py: host_path() (pure) and local_folder()
- runtime: desktop local_folders=True; access: the desktop app reads its own disk
- Data Upload passes the typed folder through local_folder()
- desktop smoke test: Batch Import loads a real folder, a missing one gets a message

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NCCU-Schultz-Lab
NCCU-Schultz-Lab merged commit 3e4a54b into main Nov 6, 2026
12 checks passed
@NCCU-Schultz-Lab NCCU-Schultz-Lab mentioned this pull request Nov 7, 2026
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