Skip to content

Show MyPressKit download progress and remember output format - #103

Merged
D3SOX merged 3 commits into
masterfrom
mypresskit-progress-format-memory
Aug 11, 2026
Merged

Show MyPressKit download progress and remember output format#103
D3SOX merged 3 commits into
masterfrom
mypresskit-progress-format-memory

Conversation

@D3SOX

@D3SOX D3SOX commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

MyPressKit downloads often stream without Content-Length, so the Web UI stayed at 0% until metadata. Progress now updates from received bytes (with an indeterminate bar when the total is unknown), and safeFetch applies backpressure so progress isn't skipped while the body buffers.

The selected output format is also persisted in localStorage and restored on reload, matching browser mode.

Test plan

  • Download a MyPressKit track (e.g. the DJ Felge Umbrella gate) in headless and confirm the download stage shows growing MB / indeterminate progress instead of stuck 0%
  • Confirm a provider that sends Content-Length still shows a normal percentage bar
  • Change output format, reload the Web UI, and confirm the selection is restored
  • Open a userscript deep link with ?outputFormat=flac and confirm that overrides the stored preference

Made with composer in Cursor

Summary by CodeRabbit

  • New Features

    • Added persistent output-format selection for Original, MP3 320 kbps, and FLAC, with support for URL and saved preferences.
    • Deep links now restore the selected output format when valid settings are provided.
    • Download progress displays clearer percentage and data-size information, including support for downloads with unknown sizes.
  • Bug Fixes

    • Improved download progress updates with throttling and a final completion notification.
    • Improved streaming reliability by managing data flow when downloads are received faster than they can be processed.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a2f7268-9fff-4aa4-9e96-c0518c071ff4

📥 Commits

Reviewing files that changed from the base of the PR and between be0d172 and 726bca0.

📒 Files selected for processing (1)
  • webui/src/components/App.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • webui/src/components/App.tsx

📝 Walkthrough

Walkthrough

The PR adds validated output-format hydration and persistence, throttles download progress reporting, improves progress rendering for unknown sizes, and applies backpressure to safeFetch response streams.

Changes

Output format hydration

Layer / File(s) Summary
Output format validation and parsing
src/types.ts, webui/src/components/deepLink.ts, src/deepLink.test.ts
The shared guard validates supported formats. Deep-link helpers reject invalid URL and stored values. Tests cover valid and invalid inputs.
Output format hydration and persistence
webui/src/components/App.tsx
Startup applies URL or stored preferences. Selector changes persist through updateOutputFormat. Deep-link startup reuses the hydrated format.

Download progress reporting

Layer / File(s) Summary
Throttled download progress
src/mypresskit.ts, webui/src/components/App.tsx
Download updates are throttled to 250 ms, with forced completion events. The UI supports determinate and indeterminate progress and prioritizes server messages.

Response stream backpressure

Layer / File(s) Summary
Pause and resume response delivery
src/safeOutboundUrl.ts
The response pauses when the consumer queue is full and resumes during stream pulls.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant App
  participant URLParser
  participant LocalStorage
  Browser->>App: start application
  App->>URLParser: readRequestedOutputFormat(search)
  App->>LocalStorage: readStoredOutputFormat(storage, key)
  URLParser-->>App: validated OutputFormat or null
  LocalStorage-->>App: validated OutputFormat or null
  App->>LocalStorage: persist selected output format
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: MyPressKit download progress reporting and persistent output-format selection.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mypresskit-progress-format-memory

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webui/src/components/App.tsx`:
- Around line 1533-1555: Update the progress rendering conditions in the job
progress UI around the progress bar and stats to treat numeric totalBytes
values, including 0, as known totals. Replace truthiness checks on
job.progress?.totalBytes with an explicit numeric validation, preserving
indeterminate rendering and omitted totals only when totalBytes is absent or
non-numeric.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 80eba19f-6825-4b37-83fe-259cfc316dd9

📥 Commits

Reviewing files that changed from the base of the PR and between 706bfc2 and be0d172.

📒 Files selected for processing (6)
  • src/deepLink.test.ts
  • src/mypresskit.ts
  • src/safeOutboundUrl.ts
  • src/types.ts
  • webui/src/components/App.tsx
  • webui/src/components/deepLink.ts

Comment thread webui/src/components/App.tsx Outdated
@D3SOX

D3SOX commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@D3SOX
D3SOX merged commit 83d912f into master Aug 11, 2026
2 checks passed
@D3SOX
D3SOX deleted the mypresskit-progress-format-memory branch August 11, 2026 19:18
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