Repository navigation
TT-7764 Show compressed size estimate in too big message,Calc compressed size estimate based on num channels - #754
sarahentzel wants to merge 16 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Localization regressions, a stale live channel estimate, misleading rounding, and a failing test expectation remain unresolved.
6 open findings
Complete selector mock and assertion for compression error · New Unit rename breaks existing localized media tab translations · New Renaming unit ID disconnects existing translations · New Use live channel count during recording size estimation · New Display over-limit file estimates above the configured limit · New Round file size upward to avoid hiding oversize errors · New
What changed in this PR
Adds channel-aware compressed-size estimates and clearer oversized-file handling for recordings and uploads.
Changes:
- Estimates Opus output size using duration and channel count.
- Blocks oversized encoded or fallback WAV uploads.
- Displays file sizes in localized limit messages and expands tests.
| File | Description |
|---|---|
web/src/utils/filterFilesBySizeLimit.ts |
Formats rejected files with sizes. |
web/src/store/localization/reducers.tsx |
Adds and renames size-related strings. |
web/src/store/localization/model.tsx |
Updates localization interfaces. |
web/src/store/localization/exported-strings-name.json |
Points to the regenerated bundle. |
web/src/components/Uploader.tsx |
Uses the renamed upload error string. |
web/src/components/Uploader.test.tsx |
Removes an unused import. |
web/src/components/MediaUploadContent.tsx |
Shows each rejected file’s size. |
web/src/components/MediaUpload.test.ts |
Tests oversized-file formatting. |
web/src/components/mediaRecordSize.ts |
Implements channel-aware estimates. |
web/src/components/mediaRecordSize.test.ts |
Tests size and WAV-channel calculations. |
web/src/components/MediaRecord.tsx |
Integrates estimates and post-encode validation. |
web/src/components/MediaRecord.test.tsx |
Expands recording-size tests. |
web/src/components/MediaRecord.load.test.tsx |
Updates localization mocks. |
localization/TranscriberAdmin-en.xlf |
Adds and updates localized messages. |
localization/TranscriberAdmin-en-1.2.xliff |
Mirrors localization source changes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I reviewed StandardsBreaks the localization rules in docs/ai/localization.md
These parts follow the rules: the generated Judgement calls
Spec (commit messages used as the spec)Implemented, but wrong
Missing or partial
Not asked for
Confirmed correct:
Summary: Standards has 2 hard violations and 7 judgement calls; the worst is the XLIFF id order. Spec has 3 wrong implementations, 2 partial items and 2 out-of-scope changes; the worst is that renaming the ids breaks existing translations in 9 locales. The simplest fix for both is to keep the old |
gtryus
left a comment
There was a problem hiding this comment.
was web/.lintstagedrc supposed to only be on your computer or was it supposed to be part of this commit?
| "husky": { | ||
| "hooks": {} | ||
| "hooks": { | ||
| "pre-commit": "lint-staged" |
There was a problem hiding this comment.
will this work on my machine? I don't have a lint-staged in my package.json file?
There was a problem hiding this comment.
it's on develop, so yes
There was a problem hiding this comment.
🟡 Changes recommended
WAV parsing and byte-based estimation can incorrectly reject valid audio files with noncanonical headers, sample rates, or bit depths.
3 open findings
6 resolved since last review
Complete selector mock and assertion for compression error Round file size upward to avoid hiding oversize errors Display over-limit file estimates above the configured limit Use live channel count during recording size estimation Renaming unit ID disconnects existing translations Unit rename breaks existing localized media tab translations
🧠 Review effort: Balanced
| const format = header.getUint16(20, true); | ||
| const channels = header.getUint16(22, true) >= 2 ? 2 : 1; | ||
| return { channels, source: format === 3 ? 'float32' : 'pcm' }; |
| case 'float32': | ||
| if (ratio === 1) return sourceBytes; | ||
| return compressed(sourceBytes / 2); | ||
| case 'pcm': | ||
| if (ratio === 1) return sourceBytes; | ||
| return compressed(sourceBytes); |
There was a problem hiding this comment.
Enough. If it fails after conversion, the user can deal with it. 99% of the time the recording will be all ours and not some loaded and then edited recording.
Show compressed size estimate in too big message
handle file too big after conversion (estimate was off)
fix stereo estimate
run lint on commit files
fix review comments
keep too big message after compression toobig add safety margin in estimate use downloaded recordings size fix non english strings
recalc estimateduploadbytes for live
remember blob is rejected until a new blob arrives
move record size check into hook simplify size check based on the fact that we uncompress files and always save to opus add toError helper
moved more into save hook



Show compressed size estimate in too big message