Skip to content

File index cache, cross-platform folder browser, and persistence fixes#4

Merged
anderstorstensson merged 13 commits intomainfrom
dev
Feb 4, 2026
Merged

File index cache, cross-platform folder browser, and persistence fixes#4
anderstorstensson merged 13 commits intomainfrom
dev

Conversation

@anderstorstensson
Copy link
Member

Summary

  • Add disk-based file index cache for fast app startup, avoiding expensive recursive directory scans on subsequent launches
  • Replace platform-specific folder dialogs with cross-platform shinyFiles browser that opens at the currently configured path
  • Fix class list file not surviving package reinstalls by storing it in the user config directory
  • Improve sample selectize input with server-side rendering for large sample lists
  • Several documentation, screenshot, and housekeeping updates

Changes

New features

  • File index cache — Scanned folder results are cached to ~/.config/R/ClassiPyR/file_index.json for instant startup. Includes sync button, cache age indicator, auto-sync setting, and a headless rescan_file_index() function for cron jobs
  • Cross-platform folder browser — shinyFiles-based directory picker works on all platforms. Uses a dynamic_roots S3 class to work around a shinyFiles 0.9.3 bug, so the dialog opens at the path currently typed in the text field
  • Server-side selectize for the sample dropdown, improving responsiveness with large sample lists

Bug fixes

  • Class list persistenceclass2use_saved.mat is now stored in ~/.config/R/ClassiPyR/ instead of the package install directory, so it survives reinstalls
  • Empty ADC files — Check file size before attempting to parse, avoiding errors on 0-byte ADC files
  • Python venv priority — Explicitly specified venv paths now take precedence over auto-detection

Other

  • Silenced noisy startup messages
  • Updated screenshots and documentation
  • Cache invalidation when folder paths change in settings

Test plan

  • All 229 existing tests pass
  • Verify folder browser opens at configured path (not working directory)
  • Verify switching volumes in the folder browser does not crash
  • Verify class list persists after devtools::install() reinstall
  • Verify file index cache loads on second app launch without rescanning
  • Verify rescan button refreshes the file index

Implement disk-based file index cache to avoid expensive recursive
directory scans on startup. The cache stores ROI, classification, and
annotation file locations in a JSON file alongside settings. Add sync
button and cache age indicator to the sidebar. Support headless cache
updates via rescan_file_index() for cron jobs.

Replace platform-specific folder dialogs (tcltk/utils::choose.dir)
with shinyFiles web-based directory browser for cross-platform support.

Additional improvements:
- Add adc_folder parameter to save_sample_annotations() for non-standard
  folder structures
- Handle empty (0-byte) ADC files gracefully in read_roi_dimensions()
- Invalidate cache automatically when folder paths change in settings
- Update vignettes, FAQ, NEWS, README, and pkgdown config for new features
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

anderstorstensson and others added 2 commits February 3, 2026 14:42
…oss reinstalls

Make shinyDirChoose use dynamic roots via a custom dynamic_roots S3 class
that works around shinyFiles 0.9.3 not handling function roots in
sendDirectoryData. The browse dialog now opens at the directory typed in
the corresponding text field instead of always starting at the working
directory.

Save class2use file to user config directory (~/.config/R/ClassiPyR/)
instead of the package install directory so it survives reinstalls.
Measure tool: position SVG and label inside .gallery-drag-area with
position:absolute so the line scrolls with images instead of drifting.
Use z-index below the sticky toolbar so the line tucks behind it.
Skip image selection toggle while in measure mode to prevent re-renders
from removing the measurement overlay.

Vignettes: correct config directory paths to match
tools::R_user_dir("ClassiPyR", "config"), fix ROI folder structure
docs to reflect that any layout works (recursive scan), document
reset_settings behavior with class list, add initial "No sample loaded"
state to mode indicator docs, and misc corrections.
@anderstorstensson anderstorstensson merged commit ff60f5b into main Feb 4, 2026
15 of 17 checks passed
@anderstorstensson anderstorstensson deleted the dev branch February 4, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants