Skip to content

feat: per-download folder picker (builds on #39)#43

Closed
sloevhaug wants to merge 2 commits into
baairon:mainfrom
sloevhaug:feat/selective-download-with-path
Closed

feat: per-download folder picker (builds on #39)#43
sloevhaug wants to merge 2 commits into
baairon:mainfrom
sloevhaug:feat/selective-download-with-path

Conversation

@sloevhaug

Copy link
Copy Markdown

What and why

Builds on @arjavlamsal's #39 (selective file download for multi-file torrents), rebased onto current main, and adds a per-download folder picker on top. Credit for the file-selection work is theirs; the new work in this PR is the folder picker.

Today every download lands in the single global folder (config.downloadDir). This adds a small folder prompt when you start a download from the results detail view: type a destination or pick from a recent-folders list (↑↓), then starts the download — carrying through #39's file selection. The chosen folder is remembered in an MRU list (recentDirs); the global default set via o is left untouched.

Two commits:

  • feat(download): implement selective file download…@arjavlamsal (feat(download): implement selective file download for multi-file torrents #39), rebased onto current main. The only conflict was src/ui/components/Results.tsx against the recent seed:leech-compaction / detail-view changes; resolved by keeping their file checklist and main's tolerant sourceStyle() (so a pasted magnet with no known source doesn't crash).
  • feat: choose the download folder per download — the folder picker (the new contribution here).

If #39 merges first, this collapses to just the folder-picker commit. Happy to reshape however works best for landing #39.

Checklist

  • npm run typecheck is clean
  • npm test passes (100 tests; adds pushRecentDir MRU + DownloadFolderPrompt coverage)
  • New logic has a test (vitest; ink-testing-library for the prompt)
  • If I added a key, I updated both HELP_GROUPS and footerHints (no new global key — d now opens the folder prompt; feat(download): implement selective file download for multi-file torrents #39's space/a/n are already in the cheatsheet)
  • If I added a Store field, I updated makeStore in scripts/render-previews-impl.tsx (openDownloadFolder)
  • OS-touching code works on Windows, macOS, and Linux (paths reuse normalizeDownloadDir/expandHome)
  • One concern, with a Conventional Commits title (feat:)

🤖 Generated with Claude Code

arjavlamsal and others added 2 commits July 3, 2026 14:03
…ents

Multi-file torrents currently download everything, wasting bandwidth and
disk space when the user only wants specific files. This adds an inline
file-selection checklist in the search results detail view so users can
pick exactly which files to grab before starting the download.

- Engine: applyFileSelection deselects unwanted files at the piece level;
  per-file progress tracking; selective totalBytes computation.
- Queue: add() accepts selectedIndices; onMetadata applies selection and
  recalculates size; cleanUnwanted relocates deselected piece data to a
  hidden .unwanted/ directory on completion.
- Detail view: temporary metadata-only fetch populates the file list
  without committing to a download; auto-cleanup on navigation away.
- Keys: space toggle, a all, n none (registered in HELP_GROUPS).
- Display paths strip the torrent root folder prefix for readability.
Builds on the selective file-download work: pressing d now opens a small
folder picker (a path input plus a recent-folders list) before the download
starts, so a torrent can go where you want instead of always the single global
default. The chosen folder is remembered in an MRU list for next time, and the
global default set via `o` is left untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@arjavlamsal

Copy link
Copy Markdown

This looks solid! Thanks for handling the rebase and resolving the conflicts @sloevhaug .

@baairon

baairon commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Thanks for taking this on, and credit to Arjav's #39, but I'm closing it: per-download folders landed via #54 with plain d kept instant, and fetching torrent metadata just from opening a detail view is network cost torlink shouldn't pay. File selection could still work as its own fresh PR.

@baairon baairon closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants