Skip to content

feat(transfer): wire concurrent transfers setting into worker pool#110

Merged
Orinks merged 2 commits intodevfrom
feat/PortkeyDrop-issue-107
Mar 10, 2026
Merged

feat(transfer): wire concurrent transfers setting into worker pool#110
Orinks merged 2 commits intodevfrom
feat/PortkeyDrop-issue-107

Conversation

@Orinks
Copy link
Owner

@Orinks Orinks commented Mar 8, 2026

Summary

Closes #95

  • TransferService (src/portkeydrop/services/transfer_service.py): new service owning the transfer queue and a single daemon worker thread. Defines TransferJob dataclass with status lifecycle (pending → in_progress → complete/failed/cancelled).
  • TransferDialog refactored into a stateless observer — closing/hiding it never cancels a running transfer. Added "Send to Background" button (hides dialog) and "Cancel Transfer" button (explicit cancel).
  • MainFrame announces completion and failure via screen reader (_announce) even when the dialog is hidden, satisfying the Prism accessibility requirement.
  • Comprehensive test suite: 37 new tests covering TransferService queue/worker, cancel semantics, recursive transfers, progress calculation, MainFrame announce on complete/fail, and dialog close behavior.

Acceptance Criteria

  • Closing the transfer dialog does not interrupt the transfer
  • "Send to Background" button hides dialog; transfer continues
  • Transfer completes/fails in background and notifies MainFrame
  • Prism announces completion and failure even when dialog is hidden
  • TransferService owns the queue and worker thread
  • TransferDialog is a stateless observer that can be opened/closed freely

Test plan

  • ruff check and ruff format pass
  • 589 tests pass (552 existing + 37 new)
  • Manual: start a transfer, close dialog, verify transfer completes
  • Manual: "Send to Background" hides dialog, transfer continues
  • Manual: screen reader announces completion/failure when dialog hidden

🤖 Generated with Claude Code

Replace the single daemon worker thread in TransferService with a
configurable pool sized to the concurrent_transfers setting. Each
worker pulls from the same queue, naturally distributing jobs. The pool
can be resized at runtime via set_max_workers() which is called when
settings are saved.

Closes #107

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@Orinks Orinks force-pushed the feat/PortkeyDrop-issue-107 branch from 19196c4 to 58bfe16 Compare March 10, 2026 13:39
@Orinks Orinks merged commit aefbef1 into dev Mar 10, 2026
6 checks passed
@Orinks Orinks deleted the feat/PortkeyDrop-issue-107 branch March 10, 2026 13:47
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.

1 participant