-
Notifications
You must be signed in to change notification settings - Fork 0
π¨ Palette: λμ λ°μ΄νΈ μ λ ₯ νλμ μ΅λκ° μΈλΌμΈ κ²μ¦ μΆκ° #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,7 +178,7 @@ async def add_security_headers(request: Request, call_next): | |
| </p> | ||
| <p> | ||
| <label for="target_bytes">Target Bytes: <span class="required-star" aria-hidden="true">*</span></label><br> | ||
| <input type="number" id="target_bytes" name="target_bytes" value="2000000000" min="1" aria-describedby="target_bytes_help target_bytes_preview" required> | ||
| <input type="number" id="target_bytes" name="target_bytes" value="2000000000" min="1" max="5368709120" aria-describedby="target_bytes_help target_bytes_preview" required> | ||
| <br><span id="target_bytes_help" class="help-text">Maximum allowed file size in bytes (e.g., 2000000000 for ~1.86 GiB)</span> | ||
| <br><span id="target_bytes_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #1e7e34;">1.86 GiB</span> | ||
| <div id="preset_buttons_container" class="preset-container" role="group" aria-label="Preset target sizes"> | ||
|
|
@@ -190,6 +190,31 @@ async def add_security_headers(request: Request, call_next): | |
| </p> | ||
| <button type="submit" id="submit-btn">Upload and Shrink</button> | ||
| </form> | ||
| </div> | ||
| <div class="box" id="batch-drop-zone" style="margin-top: 20px;"> | ||
| <h2>Shrink Multiple Files</h2> | ||
| <form action="/shrink-batch" method="post" enctype="multipart/form-data" id="shrink-batch-form"> | ||
| <p> | ||
| <label for="batch_files">Media Files (up to 20): <span class="required-star" aria-hidden="true">*</span></label><br> | ||
| <input type="file" id="batch_files" name="files" accept="audio/*,video/*" multiple aria-describedby="batch_files_help batch_files_preview" required onchange="updateBatchFilePreview(this)"> | ||
| <br><span id="batch_files_help" class="help-text">Select several audio or video files, or drag and drop them here. You get back one zip with every output plus a results.json manifest.</span> | ||
| <br><span id="batch_files_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #0f6674;"></span> | ||
| </p> | ||
| <p> | ||
| <label for="batch_target_bytes">Target Bytes (per file): <span class="required-star" aria-hidden="true">*</span></label><br> | ||
| <input type="number" id="batch_target_bytes" name="target_bytes" value="2000000000" min="1" max="5368709120" aria-describedby="batch_target_bytes_help batch_target_bytes_preview" required> | ||
| <br><span id="batch_target_bytes_help" class="help-text">Maximum allowed size in bytes for each output file</span> | ||
| <br><span id="batch_target_bytes_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #1e7e34;">1.86 GiB</span> | ||
| <div id="batch_preset_buttons_container" class="preset-container" role="group" aria-label="Preset target sizes for batch"> | ||
| <button type="button" class="preset-btn" data-bytes="26214400" aria-pressed="false">25 MiB</button> | ||
| <button type="button" class="preset-btn" data-bytes="104857600" aria-pressed="false">100 MiB</button> | ||
| <button type="button" class="preset-btn" data-bytes="524288000" aria-pressed="false">500 MiB</button> | ||
| <button type="button" class="preset-btn" data-bytes="1073741824" aria-pressed="false">1 GiB</button> | ||
| </div> | ||
| </p> | ||
| <button type="submit" id="batch-submit-btn">Upload and Shrink Batch</button> | ||
| </form> | ||
| </div> | ||
| <script> | ||
| const MAX_UPLOAD_BYTES = 5 * 1024 * 1024 * 1024; | ||
| function formatBinaryBytes(value) { | ||
|
|
@@ -268,6 +293,12 @@ async def add_security_headers(request: Request, call_next): | |
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('Must be greater than 0.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
| } else if (val > MAX_UPLOAD_BYTES) { | ||
| const limitText = formatBinaryBytes(MAX_UPLOAD_BYTES); | ||
| preview.innerText = 'Must be ' + limitText + ' or less.'; | ||
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('Must be ' + limitText + ' or less.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
|
Comment on lines
+296
to
+301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π― Functional Correctness | π‘ Minor | β‘ Quick win μ€λ₯ 문ꡬλ₯Ό μꡬμ¬νκ³Ό μΌμΉμν€μΈμ.
Also applies to: 336-341 π€ Prompt for AI Agentsπ― Functional Correctness | π‘ Minor | β‘ Quick win π§© Analysis chainπ Script executed: node - <<'NODE'
const raw = '6e9';
console.log({ parseInt: parseInt(raw, 10), number: Number(raw) });
NODERepository: ContextualWisdomLab/codec-carver Length of output: 206 π Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- relevant handlers and parseInt uses ---'
rg -n -C 12 "parseInt|MAX_UPLOAD_BYTES|valueAsNumber|addEventListener\\(['\"]change|addEventListener\\(['\"]input" saas_web.py
printf '%s\n' '--- surrounding lines 260-355 ---'
sed -n '260,355p' saas_web.py
printf '%s\n' '--- input declarations ---'
rg -n -C 5 'type=["'\"']number|multiple|MAX_UPLOAD_BYTES' saas_web.pyRepository: ContextualWisdomLab/codec-carver Length of output: 27401 λ target μ
λ ₯ νΈλ€λ¬μμ
π€ Prompt for AI Agents |
||
| } else { | ||
| preview.innerText = formatBinaryBytes(val); | ||
| } | ||
|
|
@@ -302,6 +333,12 @@ async def add_security_headers(request: Request, call_next): | |
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('Must be greater than 0.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
| } else if (val > MAX_UPLOAD_BYTES) { | ||
| const limitText = formatBinaryBytes(MAX_UPLOAD_BYTES); | ||
| preview.innerText = 'Must be ' + limitText + ' or less.'; | ||
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('Must be ' + limitText + ' or less.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
| } else { | ||
| preview.innerText = formatBinaryBytes(val); | ||
| } | ||
|
|
@@ -404,31 +441,6 @@ async def add_security_headers(request: Request, call_next): | |
| }, false); | ||
| } | ||
| </script> | ||
| </div> | ||
| <div class="box" id="batch-drop-zone" style="margin-top: 20px;"> | ||
| <h2>Shrink Multiple Files</h2> | ||
| <form action="/shrink-batch" method="post" enctype="multipart/form-data" id="shrink-batch-form"> | ||
| <p> | ||
| <label for="batch_files">Media Files (up to 20): <span class="required-star" aria-hidden="true">*</span></label><br> | ||
| <input type="file" id="batch_files" name="files" accept="audio/*,video/*" multiple aria-describedby="batch_files_help batch_files_preview" required onchange="updateBatchFilePreview(this)"> | ||
| <br><span id="batch_files_help" class="help-text">Select several audio or video files, or drag and drop them here. You get back one zip with every output plus a results.json manifest.</span> | ||
| <br><span id="batch_files_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #0f6674;"></span> | ||
| </p> | ||
| <p> | ||
| <label for="batch_target_bytes">Target Bytes (per file): <span class="required-star" aria-hidden="true">*</span></label><br> | ||
| <input type="number" id="batch_target_bytes" name="target_bytes" value="2000000000" min="1" aria-describedby="batch_target_bytes_help batch_target_bytes_preview" required> | ||
| <br><span id="batch_target_bytes_help" class="help-text">Maximum allowed size in bytes for each output file</span> | ||
| <br><span id="batch_target_bytes_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #1e7e34;">1.86 GiB</span> | ||
| <div id="batch_preset_buttons_container" class="preset-container" role="group" aria-label="Preset target sizes for batch"> | ||
| <button type="button" class="preset-btn" data-bytes="26214400" aria-pressed="false">25 MiB</button> | ||
| <button type="button" class="preset-btn" data-bytes="104857600" aria-pressed="false">100 MiB</button> | ||
| <button type="button" class="preset-btn" data-bytes="524288000" aria-pressed="false">500 MiB</button> | ||
| <button type="button" class="preset-btn" data-bytes="1073741824" aria-pressed="false">1 GiB</button> | ||
| </div> | ||
| </p> | ||
| <button type="submit" id="batch-submit-btn">Upload and Shrink Batch</button> | ||
| </form> | ||
| </div> | ||
| </body> | ||
| </html> | ||
| """ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ποΈ Data Integrity & Integration | π‘ Minor | β‘ Quick win
π§© Analysis chain
π Script executed:
Repository: ContextualWisdomLab/codec-carver
Length of output: 10797
π Script executed:
Repository: ContextualWisdomLab/codec-carver
Length of output: 29260
π Script executed:
Repository: ContextualWisdomLab/codec-carver
Length of output: 843
π Script executed:
Repository: ContextualWisdomLab/codec-carver
Length of output: 417
π Script executed:
Repository: ContextualWisdomLab/codec-carver
Length of output: 392
λ°°μΉ μ λ‘λ ν¬κΈ° κ²μ¬λ₯Ό μλ²μ μΌμΉμν€μΈμ.
ν΄λΌμ΄μΈνΈλ
totalSize > MAX_UPLOAD_BYTESμ΄λ©΄ μ μΆμ μ°¨λ¨ν©λλ€. μλ²λ κ° νμΌμbytes_writtenλ§ κ²μ¬ν©λλ€.3 GiBμ2 GiB + 1 byteνμΌμ μλ² μ ν λ΄μμ μ²λ¦¬λ μ μμ§λ§ ν΄λΌμ΄μΈνΈμμ μ°¨λ¨λ©λλ€. νμΌλ³ μ νμ΄λ©΄ ν΄λΌμ΄μΈνΈλ κ° νμΌμ κ²μ¬νμΈμ. λ°°μΉ μ 체 μ νμ΄λ©΄shrink_media_batchμ ν©κ³ κ²μ¬λ₯Ό μΆκ°νμΈμ.π€ Prompt for AI Agents