-
Notifications
You must be signed in to change notification settings - Fork 5
Implement Geant4 dataset cache management and status monitoring #2290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@lkwinta take a look on the conflict with geant4 example, use the latest version from master
|
I am aware I will rebase and completely remove changes in ex8 from this PR |
b083a74 to
10a2227
Compare
src/WrapperApp/components/Simulation/Modal/DatasetsFullInfoModal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.
Comments suppressed due to low confidence (2)
src/Geant4Worker/Geant4DatasetManager.ts:15
- Unused imports FC, ReactNode, createContext, useContext.
import {
createContext,
Dispatch,
FC,
ReactNode,
SetStateAction,
useCallback,
useContext,
useEffect,
useRef,
useState
} from 'react';
src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx:22
- Unused import use.
import { JSX, use, useEffect, useState } from 'react';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/WrapperApp/components/Simulation/Modal/DatasetsFullInfoModal.tsx
Outdated
Show resolved
Hide resolved
src/WrapperApp/components/Simulation/Modal/DatasetsFullInfoModal.tsx
Outdated
Show resolved
Hide resolved
src/WrapperApp/components/Simulation/Modal/DatasetsFullInfoModal.tsx
Outdated
Show resolved
Hide resolved
kmichalikk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed two things
-
when download is done and I move to other tab (i.e. Editor) and back, the Dataset Download is open for split second and collapsed again, this doesn't look good
-
I can clear the datasets and the Start Simulation is still valid - now that I see it, I'd consider making it grayed out in this situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
src/Geant4Worker/Geant4DatasetManager.ts:4
- Unused import ref.
import { ref } from 'process';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/Geant4Worker/Geant4DatasetManager.ts:4
- Unused import ref.
import { ref } from 'process';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This pull request introduces a comprehensive browser cache status detection and UI for Geant4 datasets, allowing users to see which datasets are cached locally, how much storage is used, and whether downloads are required. The changes add a new dataset cache service, a React hook for cache status, and UI components to visualize cache status in both the main simulation panel and the full info modal dialog.
Core functionality for cache detection and UI:
Backend/cache service additions:
Geant4DatasetCacheService.tsto detect, query, and clear Geant4 dataset cache from IndexedDB, including dataset definitions, cache status calculation, and browser storage usage estimation.Frontend/cache status hook:
useDatasetCacheStatus.tsReact hook to provide cache status, storage usage, and refresh/clear actions for use in UI components.UI integration in simulation panel:
CacheStatusIndicatorcomponent intoGeant4DatasetDownload.tsx, displaying cache status, storage usage, and per-dataset indicators, with automatic refresh after downloads complete. [1] [2] [3] [4]UI integration in modal dialog:
DatasetsFullInfoModal.tsx, showing cache summary and per-dataset status, and updated explanatory text to reflect the new cache status feature. [1] [2] [3]