Repository navigation
feat(files): drag explorer files into Claude Code and Codex terminals - #23
Conversation
The header's first line showed the open project's name as static text. It is now the control that changes the project: a dropdown listing recent projects, current one first with a checkmark and its parent directory underneath (home collapsed to ~), plus "Open Project..." below a divider. Selecting a row calls ProjectDataProvider.selectProject, the same host call the top bar's own project menu makes, so the switch belongs to the WINDOW rather than to this panel: the top bar name, the sidebar panels and every project-scoped tab follow it. Re-picking the open project is a no-op instead of re-running the host's project-selection flow to land where we already are. Two defects on the picker path, both of which made a folder chosen from "Open Project..." appear to do nothing: - The picker ran from inside the menu's own composition. Under HARDWARE rendering the menu is a heavyweight always-on-top AWT window (BossWindow provides LocalHeavyweightOverlays = true), and the host's picker parents its native FileDialog to KeyboardFocusManager.activeWindow. Dismissing the menu and opening the picker in one event therefore handed the modal dialog an owner that the same frame disposes. The pick request now crosses back into the panel's own composition and runs a frame later, once the menu window is gone. - The macOS picker returns dialog.directory WITH a trailing separator when nothing inside the folder was selected. PathUtils.name of that is "", so such a pick reached the host as a project literally named "Unknown", on a path that did not match the recents entry for the same folder. New PathUtils.trimTrailingSeparator runs first; the dropdown's dedupe key shares the same helper, so one folder cannot occupy two rows. The picker path is logged at INFO throughout. It is driven by a native dialog inside the host, so without those lines there is no way to tell a cancelled dialog from a missing provider from a callback the host ignored. Tests: 19 new (dropdown ordering and matching incl. Windows separators; picker result handling). slf4j-simple joins the test runtime because BossLogger binds slf4j in its static init, so any test reaching a log call died without it.
|
Review: drag explorer files into terminals This change is small and easy to follow. Keeping the path logic in BOSS conventions
Possible issues
Nits
Performance Security Tests
Overall this looks good. Items 1 and 3 are the ones I'd most like addressed or confirmed before marking it ready, and item 2 should go on the manual checklist. |
|
Addressed review in 5e0eb84:
|
|
Review: drag explorer files into terminals This is a clean, focused PR. The drag logic sits in its own small ✅ What's good
🧹 Minor / style
🔢 Versioning ⚡ Performance 🔒 Security 🧪 Tests Overall this looks good to merge once the manual checks pass and the version is bumped. Item 1 is the one I'd watch most closely during manual testing. |
Review: drag explorer files into terminalsOverall this is a well-scoped change. The drag logic lives in its own pure object ( Potential bugs / behavior to verify
Code quality
BOSS plugin conventions
Performance
Security
Test coverageThe eight new tests are thorough. They cover ordering, hidden selections, compacted folders, deduplication, flavors, payload immutability, copy-only actions and rejection paths. Possible additions:
UI wiring (the Nice work overall. Items 1 and 2 are the ones I'd most like checked during the manual pass. |
|
Review: drag explorer files into terminals The drag logic is small, separate from the UI and well tested. The pure 1. Scope: this PR includes #20 2. A right-button drag may start a native drag (please verify) 3. Stale selection rejects the whole drag 4. Minor / optional
Conventions checklist
Tests Nice work overall. Once it's rebased onto #20 and the right-drag behaviour is confirmed, this looks close to ready. |
Review: drag explorer files into terminalsThis review covers the drag-and-drop changes ( Overall this is a careful, well-scoped change. The payload is native Conventions ✅
Things worth looking at1. Which mouse button can start a drag ( 2. A modal dialog opens while the drag gesture is still in progress 3. Hidden selections are ordered as strings, not in tree order 4. A stale hidden selection cancels the whole drag 5. Small points
SecurityRejecting ISO control characters (including C1 like TestsThe unit coverage is good. One gap: no test covers the Compose wiring itself, i.e. that a drag on a selected row keeps the multi-selection rather than SummaryNo blocking problems in the drag code. The main risks are gesture interactions (secondary-button drags, the dialog opening mid-drag), and your manual checklist already targets them. Once #20 lands and those checks pass, this looks good to merge. 👍 |
Merge order
Merge #20 first, then this PR. This branch includes project-switcher head
beb3fc4; combined fixes are validated together. Version 1.7.1 follows #20 version 1.7.0.What changes
The FILES explorer already supports selecting and copying paths, but cannot drag those files into an existing terminal prompt. Add a native drag source to each tree row so users can reference files while working in Claude Code, Codex, or a shell.
javaFileListFlavorwith actual file references. Compacted directories resolve to their displayed end directory. No file contents are read and no Enter is sent by the source.Closes #22.
Validation
CI=true ./gradlew test buildPluginJar --console=plain -Pkotlin.daemon.jvmargs=-Xmx2gagainst released API 1.0.87: 258 combined tests passed across 31 suites, zero failures/errors/skips, including eight drag tests and the project-switcher regressions.git diff --checkpassed.Manual checks before marking ready
Browsing Downloads/Documents independently of the active project remains a follow-up from #22.