Skip to content

Update dataset editor file browser modal to use spx theme css#292

Open
klpoland wants to merge 8 commits into
masterfrom
feature-kpoland-enhanced-dataset-editor-file-browser
Open

Update dataset editor file browser modal to use spx theme css#292
klpoland wants to merge 8 commits into
masterfrom
feature-kpoland-enhanced-dataset-editor-file-browser

Conversation

@klpoland

@klpoland klpoland commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Large front-end change to dataset create/edit file selection (DOM rendering, folder bulk select, and form Enter handling); backend impact is limited to a test fix.

Overview
Replaces the dataset editor file browser modal table (#file-tree-table) with a SpectrumX-themed accessible tree (#file-tree-root inside .file-browser-modal), including new modal controls and styling.

UI & markup: file_browser.html drops the striped table for a role="tree" list, adds Select folders mode, Clear selections, and help text. spectrumx_theme.css adds modal-specific row/hover/selection styles, visually hidden checkboxes, and folder expand chevrons when folder mode is on; components.css retargets the scroll container to #file-tree-root.

Behavior (AssetSearchHandler): renderFileTree now builds folders/files with DOM APIs and textContent instead of HTML strings; supports keyboard activation, click-to-select rows, lazy folder expand, bulk folder selection (all descendant files), getFileSelectionDataById for metadata/relative_path, and guards against duplicate event binding. Empty states no longer call render-html for table rows.

Wiring: Create/edit handlers, PageLifecycleManager, and tests switch selectors from #file-tree-table to #file-tree-root; creation modal file metadata comes from the search handler/tree when possible. Edit mode blocks accidental submit on Enter (except textareas).

Other: Cursor rule documents prefer programmatic DOM over JS template literals for user data. API test uses a fresh unauthenticated APIClient instead of force_authenticate(None).

Reviewed by Cursor Bugbot for commit cbee2db. Bugbot is set up for automated code reviews on this repo. Configure here.

@klpoland klpoland self-assigned this Jun 4, 2026
@klpoland klpoland requested a review from lucaspar June 4, 2026 13:07
@klpoland klpoland added feature New feature or request gateway Gateway component javascript Pull requests that update non-trivial javascript code labels Jun 4, 2026
lucaspar

This comment was marked as resolved.

Comment thread gateway/sds_gateway/static/js/search/AssetSearchHandler.js Outdated
Comment thread gateway/sds_gateway/static/js/search/AssetSearchHandler.js Outdated
Comment thread gateway/sds_gateway/static/js/search/AssetSearchHandler.js
Comment thread gateway/sds_gateway/static/js/search/AssetSearchHandler.js Outdated
Comment thread gateway/sds_gateway/static/js/search/AssetSearchHandler.js Outdated
@klpoland klpoland force-pushed the feature-kpoland-enhanced-dataset-editor-file-browser branch from a430e87 to 8e6ebdb Compare June 11, 2026 13:37
@creinkin

Copy link
Copy Markdown
Collaborator

bugbot run

Comment thread gateway/sds_gateway/static/js/dataset/DatasetCreationHandler.js
Comment thread gateway/sds_gateway/static/js/dataset/DatasetEditingHandler.js
Comment thread gateway/sds_gateway/static/js/search/AssetSearchHandler.js

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cbee2db. Configure here.

}

this.updateSelectAllCheckboxState()
this.updateSelectedFilesList()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear selections wipes confirmed files

High Severity

In dataset create mode, clicking "Clear selections" in the file tree modal incorrectly removes newly selected files from the main form's selection. This happens because updateSelectedFilesList is called, overwriting formHandler.selectedFiles with the modal's temporary state, discarding new choices made before the modal was opened.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cbee2db. Configure here.

})
this.syncFileCheckboxVisual(file.id, true)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folder select desyncs modal state

Medium Severity

Folder selection mode updates the search handler map and checkbox visuals via toggleDirectorySelection / syncFileCheckboxVisual without firing checkbox change events, so DatasetCreationHandler.modalSelectedFiles is not updated. On Confirm, the handler still merges modalSelectedFiles into the main set, which can re-add files that were deselected in folder mode or omit folder-only picks depending on handler order.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cbee2db. Configure here.

}

this.updateSelectAllCheckboxState()
this.updateSelectedFilesList()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear leaves stale modal set

Medium Severity

clearModalFileSelections resets checkboxes and the search handler map but never clears DatasetCreationHandler.modalSelectedFiles. On Confirm Selection, the creation handler still merges that set into selectedFiles, so files the user cleared in the UI can be added back after confirm.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cbee2db. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request gateway Gateway component javascript Pull requests that update non-trivial javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants