Skip to content

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

Open
klpoland wants to merge 7 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 7 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 file picking (selection state, folder bulk select, and DOM structure); regression risk in create/edit flows, though API auth test change is low risk.

Overview
Replaces the dataset file browser modal table (#file-tree-table) with a SpectrumX .file-browser-modal tree (#file-tree-root), including new theme CSS for click-to-select rows, visually hidden checkboxes, and folder expand/collapse.

AssetSearchHandler now builds the tree with DOM APIs (not HTML strings), adds folder selection mode (toggle to select/deselect all selectable files under a folder), Clear selections, guarded one-time event binding, and Enter-key handling on file search. Call sites (PageLifecycleManager, create/edit handlers) point at #file-tree-root; edit mode blocks accidental form submit on Enter.

The file_browser.html partial gains folder-mode controls and help text. Minor test fix: unauthenticated dataset-files test uses a fresh APIClient instead of force_authenticate(None). Cursor rules document preferring safe DOM construction for user-controlled text.

Reviewed by Cursor Bugbot for commit a4a87c7. 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

@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 a4a87c7. Configure here.

handleSelectAllFiles(checked) {
const checkboxes = document.querySelectorAll(
'#file-tree-table input[name="files"]',
'#file-tree-root input[name="files"]',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Modal selection still expects table

High Severity

The file browser's structure changed to li elements, but handleModalFileSelection and getFileDataFromRow still expect tr and td elements. This mismatch causes getFileDataFromRow to throw an error when processing file selections, including 'select all', breaking file selection in dataset creation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a4a87c7. Configure here.

datasetForm.addEventListener("keypress", (e) => {
if (e.key === "Enter") {
e.preventDefault()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Enter guard blocks textarea lines

Medium Severity

The new datasetForm keypress handler calls preventDefault on every Enter key, including Enter pressed inside multiline fields such as the dataset description, so users cannot insert new lines while editing.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a4a87c7. Configure here.

if (expandable) {
toggle.textContent = isExpanded ? "▶" : "▼"
li.appendChild(rowSpan)
li.appendChild(childUl)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Expanded folders stay hidden

High Severity

Folder rows set aria-expanded on the li and nest child lists as li > ul, but theme CSS hides every .file-browser li > ul and only shows ul as a sibling of [aria-expanded="true"]. Nested lists never become visible, so expanding folders in the modal does not reveal files or subfolders.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a4a87c7. 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