feat(workbench): various UX improvements#8165
Conversation
Triggered by e922695 on branch refs/heads/issue-8153
Update terminology and user-facing copy from 'Upload Plan' to 'Mapping' (or 'Mapping Plan') across the WorkBench.
I suppose I mean that the live validation button is visible by default rather than on automatically. Do you think it would be intrusive if it started as soon as data was being entered? |
|
@grantfitzsimmons ok then it works as expected! |
emenslin
left a comment
There was a problem hiding this comment.
1. Live Validation & Upload Record Counts (Fixes #8153)
- Verify that "Live Validation" is enabled by default.
- Verify that the validation and upload confirmation/results dialogs show a table outlining the records created, updated, deleted, or matched/changed, depending on your dataset operations.
2. Mapping Import/Export & Clear Confirmation
- Verify that you can Export the current plan as a
.jsonfile. - Test the Import feature by selecting a
.jsonfile from your local machine. Verify that uploading a corrupt or invalid JSON file presents an invalid JSON error dialog. - Click Clear Mappings and ensure a confirmation dialog appears asking to verify erasing the mappings before proceeding.
- Switch datasets to one without a mapping. Verify that the dialog now includes a button to Choose Existing Mapping.
3. Base Table Selection Dialog
- Verify the dialog width/height scales properly and that it displays descriptions clarifying what a "base table" is.
4. SvgIcon Alignment in Firefox (Fixes #8155)
- Verify that column/table status icons align correctly and do not shift out of place.
5. Express Search Dialog Shifting (Fixes #8014)
- Verify the dialog does not shift layout when opened/closed.
Overall it looks really good! I didn't run into any major issues but I have a few questions.
- When first looking at results after live validation it shows completely incorrect results and you have to close the dialog and open it again for the results to show correctly. Regular validation does appear correctly first time around so I am not too worried about it since a regular validation is recommended before uploading anyway; however, I figured it was still worth mentioning
06-08_12.47.mp4
- If you import an invalid JSON file or edit the existing file to be invalid, there is no error, instead it just doesn't let you save when you press save.
06-08_12.01.mp4
- Live validation says a row needs to be disambiguated but doesn't let you disambiguate
06-08_10.53.mp4
- Live validation count disappears after it's been run once
- Results and the new records in upload dialog are in opposite orders, this doesn't necessarily matter, but it could be worth considering what way is the best way to display the new records.
-
Should the import mapping dialog match other import dialogs? i.e. have the box where you can choose a file or drag it
- Example when importing a WB data set
-
Lastly, when you import a mapping the columns are sometimes in the incorrect order from the file. I'm getting similar behavior in main so it isn't specific to this issue but I figured it was worth mentioning.
06-08_13.02.mp4
|
More notes: It seems 'Live Validation' believes it is validating a WorkBench data set even in Batch Edit. For example, I was batch editing Collection Object records and used live validation, but it complained about duplicate catalog numbers. I suggest we disable it for Batch Edit in this PR. |
Triggered by ec3b3c0 on branch refs/heads/issue-8153
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Triggered by e3fb771 on branch refs/heads/issue-8153
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
specifyweb/frontend/js_src/lib/components/WbActions/useResults.ts (1)
40-77: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRe-show previously filtered rows/columns before applying the new result set.
This effect now reruns on
cellCountschanges, but it only hides. If a later validation/update makes a row or column contain results, it stays hidden from the earlier run until the panel is closed, so the open results view can only shrink.Possible fix
React.useEffect(() => { if (hot === undefined || !showResults) return; + const hiddenRows = getHotPlugin(hot, 'hiddenRows'); + const hiddenColumns = getHotPlugin(hot, 'hiddenColumns'); const rowsToInclude = new Set<number>(); const colsToInclude = new Set<number>(); Object.entries(workbench.cells.cellMeta).forEach(([physicalRow, rowMeta]) => rowMeta.forEach((metaArray, physicalCol) => { @@ hot.batch(() => { identifyDefaultValues(hot, workbench.mappings); - getHotPlugin(hot, 'hiddenRows').hideRows(rowsToHide); - getHotPlugin(hot, 'hiddenColumns').hideColumns(colsToHide); + hiddenRows.showRows( + hiddenRows + .getHiddenRows() + .filter((row) => !initialHiddenRows.includes(row)) + ); + hiddenColumns.showColumns( + hiddenColumns + .getHiddenColumns() + .filter((column) => !initialHiddenCols.includes(column)) + ); + hiddenRows.hideRows(rowsToHide); + hiddenColumns.hideColumns(colsToHide); workbench.utils.toggleCellTypes('newCells', 'remove'); }); }, [showResults, cellCounts]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@specifyweb/frontend/js_src/lib/components/WbActions/useResults.ts` around lines 40 - 77, The `useResults` effect only hides rows/columns and never restores ones that were hidden by a previous run, so the results view can only shrink as `cellCounts` changes. Update the `React.useEffect` in `useResults` to re-show the previously hidden rows/columns before computing and applying the new hidden sets, using the existing `hiddenRows` and `hiddenColumns` plugins around the `identifyDefaultValues`, `hideRows`, and `hideColumns` calls. Keep the existing `showResults`, `cellCounts`, `hot`, `initialHiddenRows`, and `initialHiddenCols` logic intact while ensuring newly result-containing rows/columns become visible again.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@specifyweb/frontend/js_src/lib/components/WbActions/useResults.ts`:
- Around line 40-77: The `useResults` effect only hides rows/columns and never
restores ones that were hidden by a previous run, so the results view can only
shrink as `cellCounts` changes. Update the `React.useEffect` in `useResults` to
re-show the previously hidden rows/columns before computing and applying the new
hidden sets, using the existing `hiddenRows` and `hiddenColumns` plugins around
the `identifyDefaultValues`, `hideRows`, and `hideColumns` calls. Keep the
existing `showResults`, `cellCounts`, `hot`, `initialHiddenRows`, and
`initialHiddenCols` logic intact while ensuring newly result-containing
rows/columns become visible again.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 338596a0-264d-4203-936f-6597d3bdc594
📒 Files selected for processing (10)
specifyweb/frontend/js_src/lib/components/Header/ExpressSearchTask.tsxspecifyweb/frontend/js_src/lib/components/WbActions/WbNoUploadPlan.tsxspecifyweb/frontend/js_src/lib/components/WbActions/WbValidate.tsxspecifyweb/frontend/js_src/lib/components/WbActions/useResults.tsspecifyweb/frontend/js_src/lib/components/WbPlanView/Mapper.tsxspecifyweb/frontend/js_src/lib/components/WbToolkit/DevShowPlan.tsxspecifyweb/frontend/js_src/lib/components/WorkBench/WbView.tsxspecifyweb/frontend/js_src/lib/localization/batchEdit.tsspecifyweb/frontend/js_src/lib/localization/wbPlan.tsspecifyweb/frontend/js_src/lib/localization/workbench.ts
✅ Files skipped from review due to trivial changes (2)
- specifyweb/frontend/js_src/lib/localization/batchEdit.ts
- specifyweb/frontend/js_src/lib/localization/workbench.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- specifyweb/frontend/js_src/lib/components/WbPlanView/Mapper.tsx
- specifyweb/frontend/js_src/lib/components/WbActions/WbNoUploadPlan.tsx
- specifyweb/frontend/js_src/lib/localization/wbPlan.ts
- specifyweb/frontend/js_src/lib/components/WbToolkit/DevShowPlan.tsx
|
Re: @emenslin
This should be fixed.
This was fixed by using CodeMirror as we do in App Resources here.
I can't recreate this, but it still falls outside the scope of this PR (ostensibly, at least). Can you open a bug if you can recreate this consistently? I think it has to do with that specific agent being created in the same data set in two different roles (e.g. determiner, collector) twice.
This is intentional, as far as I can tell. That number represented the number of rows still to validate.
No, I'd like to keep it distinct. It's not a bad suggestion, but this is an intentional design decision. If you clear the value from the editor, you can actually drag a file into it: Screen.Recording.2026-06-29.at.7.47.23.PM.mov
Can you open a new issue for this? This is an existing bug. |

Fixes #8153
Fixes #8155
Fixes #8014
Fixes #4484
This PR introduces a number of different UI improvements, localization updates, and bug fixes centered around the WorkBench data mapping and upload workflows:
Terminology Updates ("Upload Plan" ➔ "Mapping"):
chooseExistingPlanbecomes "Choose Existing Mapping",uploadPlanis now "Import/Export Mapping").Record Counts & Live Validation:
TableRecordCountscomponent.dataCheck) by default (defaultValue: truein user preferences).Import/Export Mapping Enhancements:
.jsonfile in addition to exporting.Data Mapping Dialog & Usability Improvements:
WorkBench
WorkBench Attachments
UI Fixes:
dy=".35em"on<text>elements inSvgIcon.tsxto fix icon rendering bugs in Firefox.dialogClassNames.extraWideContainerto prevent container shifting and clipping.Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
1. Live Validation & Upload Record Counts (Fixes #8153)
2. Mapping Import/Export & Clear Confirmation
.jsonfile..jsonfile from your local machine. Verify that uploading a corrupt or invalid JSON file presents an invalid JSON error dialog.3. Base Table Selection Dialog
4. SvgIcon Alignment in Firefox (Fixes #8155)
5. Express Search Dialog Shifting (Fixes #8014)
Summary by CodeRabbit
Summary
New Features
Improvements
Bug Fixes