Skip to content

Conversation

@grzanka
Copy link
Contributor

@grzanka grzanka commented Nov 29, 2025

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:

  • Added Geant4DatasetCacheService.ts to detect, query, and clear Geant4 dataset cache from IndexedDB, including dataset definitions, cache status calculation, and browser storage usage estimation.

Frontend/cache status hook:

  • Added useDatasetCacheStatus.ts React hook to provide cache status, storage usage, and refresh/clear actions for use in UI components.

UI integration in simulation panel:

  • Integrated a new CacheStatusIndicator component into Geant4DatasetDownload.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:

  • Added a cache status section to DatasetsFullInfoModal.tsx, showing cache summary and per-dataset status, and updated explanatory text to reflect the new cache status feature. [1] [2] [3]

This comment was marked as outdated.

@grzanka
Copy link
Contributor Author

grzanka commented Dec 8, 2025

@lkwinta take a look on the conflict with geant4 example, use the latest version from master

Screenshot 2025-12-08 at 12 28 41

@lkwinta
Copy link
Contributor

lkwinta commented Dec 8, 2025

@lkwinta take a look on the conflict with geant4 example, use the latest version from master

Screenshot 2025-12-08 at 12 28 41

I am aware I will rebase and completely remove changes in ex8 from this PR

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

@kmichalikk kmichalikk left a 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

  1. 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

  2. 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

@lkwinta lkwinta changed the title feat: implement Geant4 dataset cache management and status monitoring Implement Geant4 dataset cache management and status monitoring Dec 13, 2025
@lkwinta lkwinta marked this pull request as ready for review December 13, 2025 22:11
Copy link
Contributor

Copilot AI left a 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.

Copy link

Copilot AI commented Dec 14, 2025

@lkwinta I've opened a new pull request, #2308, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@grzanka grzanka merged commit 64500e9 into master Dec 15, 2025
11 checks passed
@grzanka grzanka deleted the caching_geant4_displayed branch December 15, 2025 20:32
@lkwinta lkwinta self-assigned this Dec 19, 2025
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.

4 participants