Skip to content

Added data savings estimates to Compare Quality tab - #18

Open
CodyCBakerPhD wants to merge 2 commits into
mainfrom
claude/compare-quality-data-savings-qxfydg
Open

Added data savings estimates to Compare Quality tab#18
CodyCBakerPhD wants to merge 2 commits into
mainfrom
claude/compare-quality-data-savings-qxfydg

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Member

The Compare Quality tab now projects the full file size based on the encoded snippet, showing users how much data the chosen settings would save across the entire video.

Key changes:

  • Added sizeEstimate.ts with projection logic that applies the snippet's compression ratio to the source file's total size, accounting for both video sample data (when available) and non-video overhead
  • Implemented a statistical band around the projection based on how much the file's equal-length windows vary, narrowed by the sampled fraction
  • Created savingsPanel.ts UI components: a headline strip showing the direction and magnitude of change, two bars on a shared scale comparing original vs. projected file size, and a detail block with the underlying numbers
  • Updated the Analysis tab's Compare section to display the projection alongside the segment details
  • Added comprehensive test coverage for projection math, edge cases, and UI rendering
  • Included Storybook stories demonstrating the savings panel in various scenarios

The projection uses a ratio (encoded snippet ÷ same stretch of source) rather than simple multiplication, so a snippet from a busy scene is automatically corrected by dividing by an equally busy original, making the estimate more representative of the file's average compression.

https://claude.ai/code/session_01KDzwviXNsjYHnSVDGCdrxZ

Compare Quality reported only the encoded snippet's byte count, which
says nothing about what the settings do to the file. It now projects the
whole file: the snippet against what the same seconds cost in the
source, that ratio applied to the source's real size, with a headline
figure and two bars above the panes and an Estimate Detail block, its
method and its limits, below the comparison.

Where the container has a sample table the source's cost for the sampled
stretch is summed straight out of it, so a snippet from a busy stretch
divides by an equally busy original rather than pricing the file at its
worst moment; otherwise the file's size is spread evenly over its
running time and the copy says so. The projection carries a range drawn
from how far the file's own equal-length windows sit from one another,
narrowing as more of the file is sampled and dropping away once all of
it has been encoded.

The Full Analysis document reports the same numbers, so a saved report
carries the estimate and its caveats too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDzwviXNsjYHnSVDGCdrxZ
@chromatic-com

chromatic-com Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

UI Tests need review – Review now

🟡 UI Tests: encoding-helper-storybook: 4 changes must be accepted as baselines
🟡 UI Review: encoding-helper-storybook: Go review the new and updated UI
Storybook icon Storybook Publish: encoding-helper-storybook: 11 stories published

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://brain-bbqs.github.io/encoding-helper/pr-preview/pr-18/

Built to branch gh-pages at 2026-08-13 18:01 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@chromatic-com

chromatic-com Bot commented Aug 13, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: encoding-helper-playwright: 2 tests unchanged
🟢 UI Review: encoding-helper-playwright: 2 tests published -- no changes
Storybook icon Test suite publish: encoding-helper-playwright: 2 tests published

@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.95082% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ui/analysisTab.ts 0.00% 12 Missing ⚠️
src/lib/explainers.ts 26.66% 11 Missing ⚠️
src/lib/sizeEstimate.ts 86.79% 4 Missing and 3 partials ⚠️
src/ui/compareTab.ts 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/ui/savingsPanel.ts 100.00% <100.00%> (ø)
src/ui/compareTab.ts 0.00% <0.00%> (ø)
src/lib/sizeEstimate.ts 86.79% <86.79%> (ø)
src/lib/explainers.ts 45.23% <26.66%> (-10.32%) ⬇️
src/ui/analysisTab.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CodyCBakerPhD CodyCBakerPhD self-assigned this Aug 13, 2026
The Estimate Detail block explained how the projection was arrived at
and where it can be wrong in a teach box under the figures. The ⓘ on
Original Segment Size, Projected Full File and Sampled already carry
that, on the figures it bears on, so the prose was a second telling in
the one place the reader is reading numbers.

The Full Analysis document keeps writing it out, since nobody can hover
a saved file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDzwviXNsjYHnSVDGCdrxZ
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