In Stage 1 (Generate Target), clicking "Import Dataset..." (btn-import-dataset) erroneously invokes select_target_file, opening a "Save Target File (.ti1)" dialog instead of an "Open File" dialog for measurement datasets (.ti3, .txt, .cgats, .csv). Additionally, importing does not initialize wizardState.basename or cwd if they are currently blank, leaving Stage 4 profiling in a broken state after navigation.
Details & Root Cause
In src/js/cgats_interop.js (lines 23–45):
asynchandleImport(){try{constfilePath=awaitinvoke('select_target_file');if(!filePath)return;constsummary=awaitinvoke('import_measurement_dataset',{filePath,targetCwd:this.appState.cwd,targetBasename:this.appState.basename,});this.appState.showNotice(`Successfully imported dataset (${summary.patch_count} patches)`,'success');awaitthis.appState.updateGating();this.appState.currentStage=4;this.appState.applyStageDOM(4);}catch(e){this.appState.showNotice(`Failed to import dataset: ${e}`,'error');}}
select_target_file in src-tauri/src/commands.rs executes builder.save_file() configured with .add_filter("ArgyllCMS Target", &["ti1"]).
this.appState.cwd and this.appState.basename are empty strings if the user has not previously entered a target name in Stage 1. Calling import_measurement_dataset with empty strings fails or outputs .ti3 into the current working directory, and wizardState.setTarget is never called. When jumping to Stage 4, profileBasename is empty and run_colprof cannot locate the target.
cgats_interop.js also attaches a click listener to btn-export-dataset, which is not present in src/index.html.
Steps to Reproduce
Launch ICCery (starts on Stage 1).
Click "Import Dataset...".
Notice the native dialog is a file SAVE dialog prompting for a .ti1 target name rather than an OPEN dialog for existing CGATS/TI3 data.
If a file is selected, the application navigates to Stage 4 with an empty profile basename.
Proposed Remediation
Add a Tauri command select_dataset_file in src-tauri/src/commands.rs using app.dialog().file().add_filter("Measurement Dataset", &["ti3", "txt", "cgats", "csv"]).pick_file(...).
Register select_dataset_file in src-tauri/src/lib.rs.
In cgats_interop.js, call select_dataset_file, derive default basename and cwd from the chosen file path if appState.cwd/appState.basename are empty, call wizardState.setTarget(basename, cwd) upon successful import, and remove or implement the missing export button.
### Summary
In Stage 1 (Generate Target), clicking "Import Dataset..." (`btn-import-dataset`) erroneously invokes `select_target_file`, opening a "Save Target File (.ti1)" dialog instead of an "Open File" dialog for measurement datasets (`.ti3`, `.txt`, `.cgats`, `.csv`). Additionally, importing does not initialize `wizardState.basename` or `cwd` if they are currently blank, leaving Stage 4 profiling in a broken state after navigation.
### Details & Root Cause
In `src/js/cgats_interop.js` (lines 23–45):
```javascript
async handleImport() {
try {
const filePath = await invoke('select_target_file');
if (!filePath) return;
const summary = await invoke('import_measurement_dataset', {
filePath,
targetCwd: this.appState.cwd,
targetBasename: this.appState.basename,
});
this.appState.showNotice(`Successfully imported dataset (${summary.patch_count} patches)`, 'success');
await this.appState.updateGating();
this.appState.currentStage = 4;
this.appState.applyStageDOM(4);
} catch (e) {
this.appState.showNotice(`Failed to import dataset: ${e}`, 'error');
}
}
```
1. `select_target_file` in `src-tauri/src/commands.rs` executes `builder.save_file()` configured with `.add_filter("ArgyllCMS Target", &["ti1"])`.
2. `this.appState.cwd` and `this.appState.basename` are empty strings if the user has not previously entered a target name in Stage 1. Calling `import_measurement_dataset` with empty strings fails or outputs `.ti3` into the current working directory, and `wizardState.setTarget` is never called. When jumping to Stage 4, `profileBasename` is empty and `run_colprof` cannot locate the target.
3. `cgats_interop.js` also attaches a click listener to `btn-export-dataset`, which is not present in `src/index.html`.
### Steps to Reproduce
1. Launch ICCery (starts on Stage 1).
2. Click "Import Dataset...".
3. Notice the native dialog is a file SAVE dialog prompting for a `.ti1` target name rather than an OPEN dialog for existing CGATS/TI3 data.
4. If a file is selected, the application navigates to Stage 4 with an empty profile basename.
### Proposed Remediation
1. Add a Tauri command `select_dataset_file` in `src-tauri/src/commands.rs` using `app.dialog().file().add_filter("Measurement Dataset", &["ti3", "txt", "cgats", "csv"]).pick_file(...)`.
2. Register `select_dataset_file` in `src-tauri/src/lib.rs`.
3. In `cgats_interop.js`, call `select_dataset_file`, derive default basename and cwd from the chosen file path if `appState.cwd`/`appState.basename` are empty, call `wizardState.setTarget(basename, cwd)` upon successful import, and remove or implement the missing export button.
Resolved in commit 9f2ff01 on development (released as part of v0.8.3).
Implemented select_dataset_file Tauri command in src-tauri/src/commands.rs with filters for Measurement Dataset (*.ti3, *.txt, *.cgats, *.csv).
Registered select_dataset_file in the Tauri invoke handler in src-tauri/src/lib.rs.
Updated src/js/cgats_interop.js to invoke select_dataset_file, extract the parent directory and file stem, synchronize targetCwd and targetBasename in wizardState.setTarget(...), update Stage 1 input fields (#targetBasename and #selectedPathDisplay), and guard top-level globals for safe module evaluation.
Successfully verified on development: all 91 Rust unit tests and 68 frontend unit tests passing. Bumped version to v0.8.3.
Resolved in commit `9f2ff01` on `development` (released as part of `v0.8.3`).
- Implemented `select_dataset_file` Tauri command in `src-tauri/src/commands.rs` with filters for `Measurement Dataset (*.ti3, *.txt, *.cgats, *.csv)`.
- Registered `select_dataset_file` in the Tauri invoke handler in `src-tauri/src/lib.rs`.
- Updated `src/js/cgats_interop.js` to invoke `select_dataset_file`, extract the parent directory and file stem, synchronize `targetCwd` and `targetBasename` in `wizardState.setTarget(...)`, update Stage 1 input fields (`#targetBasename` and `#selectedPathDisplay`), and guard top-level globals for safe module evaluation.
- Successfully verified on `development`: all 91 Rust unit tests and 68 frontend unit tests passing. Bumped version to `v0.8.3`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
In Stage 1 (Generate Target), clicking "Import Dataset..." (
btn-import-dataset) erroneously invokesselect_target_file, opening a "Save Target File (.ti1)" dialog instead of an "Open File" dialog for measurement datasets (.ti3,.txt,.cgats,.csv). Additionally, importing does not initializewizardState.basenameorcwdif they are currently blank, leaving Stage 4 profiling in a broken state after navigation.Details & Root Cause
In
src/js/cgats_interop.js(lines 23–45):select_target_fileinsrc-tauri/src/commands.rsexecutesbuilder.save_file()configured with.add_filter("ArgyllCMS Target", &["ti1"]).this.appState.cwdandthis.appState.basenameare empty strings if the user has not previously entered a target name in Stage 1. Callingimport_measurement_datasetwith empty strings fails or outputs.ti3into the current working directory, andwizardState.setTargetis never called. When jumping to Stage 4,profileBasenameis empty andrun_colprofcannot locate the target.cgats_interop.jsalso attaches a click listener tobtn-export-dataset, which is not present insrc/index.html.Steps to Reproduce
.ti1target name rather than an OPEN dialog for existing CGATS/TI3 data.Proposed Remediation
select_dataset_fileinsrc-tauri/src/commands.rsusingapp.dialog().file().add_filter("Measurement Dataset", &["ti3", "txt", "cgats", "csv"]).pick_file(...).select_dataset_fileinsrc-tauri/src/lib.rs.cgats_interop.js, callselect_dataset_file, derive default basename and cwd from the chosen file path ifappState.cwd/appState.basenameare empty, callwizardState.setTarget(basename, cwd)upon successful import, and remove or implement the missing export button.Resolved in commit
9f2ff01ondevelopment(released as part ofv0.8.3).select_dataset_fileTauri command insrc-tauri/src/commands.rswith filters forMeasurement Dataset (*.ti3, *.txt, *.cgats, *.csv).select_dataset_filein the Tauri invoke handler insrc-tauri/src/lib.rs.src/js/cgats_interop.jsto invokeselect_dataset_file, extract the parent directory and file stem, synchronizetargetCwdandtargetBasenameinwizardState.setTarget(...), update Stage 1 input fields (#targetBasenameand#selectedPathDisplay), and guard top-level globals for safe module evaluation.development: all 91 Rust unit tests and 68 frontend unit tests passing. Bumped version tov0.8.3.