Repository navigation
Conversation
…input files, add aria-label for unavailable simulator
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads # Conflicts: # package-lock.json # package.json
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads # Conflicts: # package-lock.json # package.json # src/WrapperApp/components/Simulation/RunSimulationForm.tsx
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads
ReviewGiven the size, I focused on the shared state, the detection bridge, file reading and writing, the camelCase fix, and the submit path. I only skimmed the UI. Looks correct
Issues / suggestions
Minor
Verdict: It's a solid, well-tested rework, and the design (one shared state, the converter owns the rules) is right. I'd want points 1 and 2 fixed before merging. Points 3–4 are small improvements, and 5–6 are about making the PR easier to review. 🤖 Generated with Claude Code |
|
Fixed: |
f277cd1 to
7cfdf4e
Compare
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads
…ut-files-tab-detect-simulators-choose-files-to-run-fix-downloads
Closes #2479
Changes:
One shared state for input files and the run selection.
InputFilesContextProviderholds the files, the selection, the simulator to run and where the files came from. The Input files tab and the run form are two views of it, so a checkbox in the tab and a chip in the run form always agree. All updates are based on the latest state, so files added while a dialog is open or a conversion is running are not lost.The converter decides which simulator can run.
detect_simulatorsandREQUIRED_INPUT_FILESfrom the converter run in Pyodide. Only file names are sent to the converter. The UI keeps no copy of the rules. A simulator can run when all its required files are present and selected:beam.dat,geo.dat,mat.dat,detect.datfl_sim.inpgeometry.gdml,run.macAny other file is allowed with any simulator and never blocks a run. File content is not checked.
If the converter can't check the files (e.g. an outdated cached wheel), the tab and the run form show "Couldn't check the input files. Reload the page…" instead of "Checking files…" forever.
Input files tab
.zipfiles, so Download all can be uploaded back. Binary files are skipped with a message. The same file can be picked again after deleting it.fl_sim (1).inp), other letter case (BEAM.DAT) or an extra.txtextension (fl_sim.inp.txt).notes.txt) keep the simulator chosen by hand. Files added before Pyodide is ready switch it once the converter has loaded.Run form (source Input Files Data)
Shows file chips. Clicking a chip includes or excludes the file.
Simulators that can't run are greyed out, with the reason ("Missing fl_sim.inp"), also for screen readers.
Select required files selects the required files of the chosen simulator.
Start simulation stays disabled, with the reason shown, until the run can start. The file selection stays visible with Use batch config.
Number of primary particles is disabled for input files, because the number is read from the files.
Geant4 always runs in direct mode, even if Batch Run was chosen before switching to it.
The source follows where the files came from. After another project is loaded or the editor is cleared, the form switches to Editor Project Data. Choosing the older files shows "These input files were added before the current project was loaded."
The default simulation name follows the source:
A typed name is kept, also when switching tabs.
Downloads
fflate). The zip is named after the project or past simulation, the simulator and a timestamp; the files inside keep their exact names.Fixes outside the tab
fl_sim.inpcame back asflSim.inp), so Use these input files works for FLUKA.editorCleared, which now means only that the project was cleared.@testing-library/reactis added back as a dev dependency (removed in remove unused @testing-library/react dependency #2514 as unused): the newInputFilesContextProvidertest uses it.Known limitation: for runs from input files the backend still guesses the simulator from file names instead of
sim_type, so a FLUKA run withbeam.dator a second.inpfile among the selected files is run incorrectly. This needs a backend fix.Tests:
npx tsc --noEmit,npm run buildCI=true npm test(the converter E2E tests neednpm startrunning)InputFilesContextProvider.test.tsx: simulator switching, detection errors, files from another project, files title, lost-content dialogs;readInputFiles.test.ts: zip upload, binary files;saveInputFiles.test.ts: zip names;Notation.test.ts: file names ininput_files.