Skip to content

fix(ui): resolve file and folder picker buttons not adding inputs - #6

Merged
KakaruHayate merged 1 commit into
KakaruHayate:mainfrom
Xiantaidu:fix/ui-pick-inputs
Oct 4, 2026
Merged

KakaruHayate merged 1 commit into
KakaruHayate:mainfrom
Xiantaidu:fix/ui-pick-inputs

Conversation

@Xiantaidu

@Xiantaidu Xiantaidu commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where clicking the "Add files..." (btn-add-files) or "Add folder..." (btn-add-folder) buttons failed to add any selected files to the input table (the list remained at 0 files), even though dragging and dropping files worked normally.


Root Cause

  1. The inputs:pick-files and inputs:pick-folder IPC handlers in main.js returned { ok: true, ...buildInputs(r.filePaths) }, which contains list and truncated, but does not return a paths property.
  2. In app.js, the click handlers called await addPaths(r.paths). Because r.paths was undefined, addPaths aborted early (if (!paths || !paths.length) return), causing selected files to be silently dropped.
  3. Drag-and-drop worked because it called addFileObjects, which directly resolved absolute paths from the dropped file objects and passed a valid array of path strings to addPaths.

Changes

  • ui/src/main.js:
    • Include paths: r.filePaths in the return object of inputs:pick-files and inputs:pick-folder.
  • ui/src/renderer/app.js:
    • In the click handlers for btn-add-files and btn-add-folder, directly merge the already scanned r.list via mergeInputs(r.list) (avoiding a redundant second filesystem scan across all selected files), with fallback to addPaths(r.paths).

Verification

  • Verified that selecting files via the file dialog properly adds them to the input table and updates the file counter.
  • Verified that selecting a directory recursively scans and populates all audio files.
  • Drag-and-drop functionality remains intact.
  • All 37 UI smoke tests pass (npm run smoke).

Summary by CodeRabbit

  • Improvements
    • Selecting files or folders now displays the scanned results directly in the input table.
    • If scanning is limited, the app shows a notice that only the first files were scanned.
    • File and folder selection continues to support the existing path-based flow.

- return paths in inputs:pick-files and inputs:pick-folder IPC handlers
- directly merge already-scanned list in UI button handlers or fallback to addPaths
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b378444-899e-423a-84a7-660a05de635d
📥 Commits

Reviewing files that changed from the base of the PR and between 6006fcf and e83c9c5.

📒 Files selected for processing (2)
  • ui/src/main.js
  • ui/src/renderer/app.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

File and folder picker IPC responses now include selected paths with pre-scanned input data. The renderer consumes returned lists directly, displays the truncation notice when needed, and retains path-based processing as a fallback.

Changes

File and folder picker inputs

Layer / File(s) Summary
Return selected paths with scanned inputs
ui/src/main.js
File and folder picker responses include selected paths alongside the result from buildInputs.
Handle scanned lists and path fallback
ui/src/renderer/app.js
The renderer merges returned lists and displays the truncation notice when applicable. Responses with paths continue through addPaths.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: kakaruhayate

Merge Risk: ⚪ Minimal · up to e83c9

Picker selections now merge the scanned inputs into the table while preserving the existing path-processing behavior. No concrete introduced regression remains; the change appears ready to merge with normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the fix for file and folder picker selections that were not appearing in the input table.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ghfind-review ghfind-review Bot added the review: medium ghfind author score; see https://ghfind.com label Oct 4, 2026
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Autopilot could not be updated. Open Coding to check access and billing.

@KakaruHayate
KakaruHayate merged commit 6758b1d into KakaruHayate:main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: medium ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants