Skip to content

fix(file_browser): Tailwind v4 opacity fix, selection toggle, hover colors, and cleanup#9259

Merged
kirangadhave merged 1 commit intomainfrom
kg/file-browser-selection
Apr 18, 2026
Merged

fix(file_browser): Tailwind v4 opacity fix, selection toggle, hover colors, and cleanup#9259
kirangadhave merged 1 commit intomainfrom
kg/file-browser-selection

Conversation

@kirangadhave
Copy link
Copy Markdown
Member

Summary

Closes #9157

  • There was a bug with selection checkbox disappearing immediately on hover
    • Cause by tailwind 4 upgrade. we were using an old class bg-opacity-*. Replaced with newer bg-primary/25. The fully saturated blue hid the checkbox
  • But with toggling the selection using checkbox when multiple=False. The checkbox let you select, but no deselect.
  • Hovering now uses hover:bg-accent which is more inline with rest of the styles
  • Removed some deadcode, extracted some code to a file level component for readability.
  • label is a prop and was being mutated, fixed that

Before

Screen.Recording.2026-04-17.at.7.26.25.PM.mov

After

Screen.Recording.2026-04-17.at.7.28.03.PM.mov

@kirangadhave kirangadhave added bug Something isn't working enhancement New feature or request labels Apr 18, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 18, 2026 2:30am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes FileBrowser selection/hover UX issues introduced by the Tailwind v4 upgrade, and improves selection toggling behavior for multiple=false.

Changes:

  • Replace deprecated Tailwind opacity utilities with bg-*/NN syntax and adjust hover/selected row colors.
  • Fix single-selection toggling so the checkbox can deselect the current selection.
  • Refactor checkbox/icon rendering into a small component and avoid mutating the label prop.
Comments suppressed due to low confidence (2)

frontend/src/plugins/impl/FileBrowserPlugin.tsx:324

  • selectAllFiles() currently only skips directories when canSelectDirectories is false, but it never skips regular files when canSelectFiles is false (e.g. selectionMode === "directory"). This will cause “Select all” to select files even when only directory selection is allowed; add the symmetric !canSelectFiles && !file.is_directory guard (or reuse the selectable list).
    for (const file of files) {
      if (!canSelectDirectories && file.is_directory) {
        continue;
      }
      if (selectedPaths.has(file.path)) {
        continue;
      }

frontend/src/plugins/impl/FileBrowserPlugin.tsx:330

  • In selectAllFiles(), selection/deduping uses file.path directly, but row rendering normalizes paths that start with "//" (see filePath = filePath.slice(1)). If the backend returns "//..." paths, “Select all” can add a differently-normalized path than click-selection, leading to inconsistent selectedPaths.has(...) results and duplicates. Normalize file.path the same way in selectAllFiles() before checking/adding.
    for (const file of files) {
      if (!canSelectDirectories && file.is_directory) {
        continue;
      }
      if (selectedPaths.has(file.path)) {
        continue;
      }
      const fileInfo = createFileInfo({
        path: file.path,
        name: file.name,
        isDirectory: file.is_directory,
      });
      filesInView.push(fileInfo);

@kirangadhave kirangadhave merged commit 504aa24 into main Apr 18, 2026
37 checks passed
@github-actions
Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.2-dev54

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

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Checkbox is not visible for mo.file_browser

3 participants