-
Notifications
You must be signed in to change notification settings - Fork 0
π¨ Palette: νμ νΌ νλ λΉμ μνμ λν μΈλΌμΈ κ²μ¦ νΌλλ°± κ°μ #494
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
9ad22e0
67e8cf6
0273afc
efa90c6
942a85a
f07d284
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 |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ | |
| ### Fixed | ||
| - λ¨μΌΒ·μΌκ΄ λμ ν¬κΈ° μ λ ₯μ λΉμ μ λ μ΄μ custom validityμ `aria-invalid` μνλ₯Ό μ¦μ μ΄κΈ°νν΄ νμ¬ νμ μ λ ₯ μνλ₯Ό μ νν μ λ¬ν©λλ€. | ||
| - μ λ‘λ νμΌλͺ μ κ²½λ‘ κ΅¬λΆμλ₯Ό μ κ·ννμ¬ POSIXμμλ Windows νμμ ν΄λΌμ΄μΈνΈ κ²½λ‘κ° μΌκ΄λ basenameμΌλ‘ κΈ°λ‘λλλ‘ μμ νμ΅λλ€. | ||
| - λ¨μΌ/μΌκ΄ νμΌ μ λ ₯ λ° λμ λ°μ΄νΈ μ λ ₯ νλλ₯Ό λΉμΈ λ 컀μ€ν JS κ²μ¦μ΄ μ‘°μ©ν μνλ₯Ό μ΄κΈ°ννμ¬ μ κ·Όμ± νΌλλ°±μ΄ λλ½λλ λ¬Έμ λ₯Ό ν΄κ²°νκ³ , λΉ¨κ°μ μλ¬ λ©μμ§μ `aria-invalid`λ₯Ό μ€μ νμ¬ νΌ μν κ°μμ±μ κ°μ νμ΅λλ€. | ||
|
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. π Maintainability & Code Quality | π‘ Minor | β‘ Quick win μ€λ³΅λκ³ μμΆ©νλ λ³κ²½ λ‘κ·Έ νλͺ©μ μ 리νμΈμ.
π€ Prompt for AI Agents |
||
|
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. π Batch handlers wired before their elements exist The inline script runs during parse inside the first (Refers to this code) Was this helpful? React with π or π to provide feedback. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,7 +225,10 @@ async def add_security_headers(request: Request, call_next): | |
| input.removeAttribute('aria-invalid'); | ||
| preview.style.color = '#0f6674'; | ||
| if (!file) { | ||
| preview.innerText = ''; | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| input.setCustomValidity('This field is required.'); | ||
| input.setAttribute('aria-invalid', 'true'); | ||
|
Comment on lines
+228
to
+231
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 π Supported by static analysisπ Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- applicable repository context ---'
for f in /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/contextualwisdomlab-codec-carver-ba5d139d/*.md \
/tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/learnings/*.md \
/tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/architecture/*.md; do
[ -f "$f" ] || continue
printf '\n### %s\n' "$f"
head -80 "$f"
done
printf '%s\n' '--- saas_web.py target ranges ---'
sed -n '180,255p;285,355p' saas_web.py
printf '%s\n' '--- file-input event bindings and handlers ---'
rg -n -C 5 'update(FileSizePreview|BatchFilePreview)|fileInput|batchFileInput|addEventListener|onchange|cancel' saas_web.pyRepository: ContextualWisdomLab/codec-carver Length of output: 16400 π Web query:
π‘ Result: The cancel event on an HTMLInputElement (for type="file") does bubble, which differs from the initial suggestion in the development history of the event [1][2]. According to official MDN documentation, the cancel event "is not cancelable but can bubble" [1]. This event is fired when a user cancels the file picker dialog (via the Escape key or the "Cancel" button) or when they re-select the same files that were already selected [1][3]. It is distinct from the change event, which only fires when the user modifies the element's value (i.e., makes a new selection) [3][4]. Prior to the introduction of the cancel event, detecting these user actions was difficult and often relied on hacks, as browsers historically handled file picker cancellation inconsistently [5][6][7][8]. During the development of the specification, there was internal discussion regarding the event's bubbling behavior, but the final implementation was established as having bubbles set to true [9][2]. Citations:
νμΌ μ νκΈ°μ
π Affects 1 file
π€ Prompt for AI AgentsSource: MCP tools |
||
| return; | ||
| } | ||
| const text = formatBinaryBytes(file.size); | ||
|
|
@@ -257,9 +260,10 @@ async def add_security_headers(request: Request, call_next): | |
| }); | ||
|
|
||
| if (this.value === '') { | ||
| preview.innerText = ''; | ||
| this.setCustomValidity(''); | ||
| this.removeAttribute('aria-invalid'); | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('This field is required.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
|
|
@@ -291,9 +295,10 @@ async def add_security_headers(request: Request, call_next): | |
| }); | ||
|
|
||
| if (this.value === '') { | ||
| preview.innerText = ''; | ||
| this.setCustomValidity(''); | ||
| this.removeAttribute('aria-invalid'); | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('This field is required.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
|
|
@@ -324,7 +329,10 @@ async def add_security_headers(request: Request, call_next): | |
|
|
||
| const files = input.files; | ||
| if (!files || files.length === 0) { | ||
| preview.innerText = ''; | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| input.setCustomValidity('This field is required.'); | ||
| input.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,9 +51,10 @@ def _assert_empty_branch(self, handler: str) -> None: | |
| empty_marker = "if (this.value === '') {" | ||
| invalid_marker = "if (isNaN(val) || val <= 0) {" | ||
| self.assertIn(empty_marker, handler) | ||
| self.assertIn("preview.innerText = '';", handler) | ||
| self.assertIn("this.setCustomValidity('');", handler) | ||
| self.assertIn("this.removeAttribute('aria-invalid');", handler) | ||
| self.assertIn("preview.innerText = 'This field is required.';", handler) | ||
| self.assertIn("preview.style.color = '#dc3545';", handler) | ||
| self.assertIn("this.setCustomValidity('This field is required.');", handler) | ||
| self.assertIn("this.setAttribute('aria-invalid', 'true');", handler) | ||
|
Comment on lines
+54
to
+57
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. π Maintainability & Code Quality | π‘ Minor | β‘ Quick win π Supported by static analysisπ Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository conventions and learnings ---'
for f in /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/contextualwisdomlab-codec-carver-ba5d139d/*.md \
/tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/learnings/*.md \
/tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/architecture/*.md; do
[ -f "$f" ] || continue
printf '\n### %s ###\n' "$f"
head -80 "$f"
done
printf '%s\n' '--- changed test hunk ---'
git diff -- tests/test_empty_target_validation.py
printf '%s\n' '--- relevant source files ---'
fd -t f -i 'saas_web.py' .
fd -t f -i 'test_empty_target_validation.py' .
for f in $(fd -t f -i 'saas_web.py' .) $(fd -t f -i 'test_empty_target_validation.py' .); do
printf '\n### %s (%s lines) ###\n' "$f" "$(wc -l < "$f")"
if [[ "$f" == *saas_web.py ]]; then
sed -n '190,250p;295,355p' "$f"
else
cat -n "$f"
fi
doneRepository: ContextualWisdomLab/codec-carver Length of output: 14233 π Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- available repository knowledge files ---'
find /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d \
-maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- single-file input handler ---'
nl -ba saas_web.py | sed -n '215,250p'
printf '%s\n' '--- batch-file input handler ---'
nl -ba saas_web.py | sed -n '315,350p'
printf '%s\n' '--- file-preview handler bindings and test references ---'
rg -n -C 3 \
"updateFileSizePreview|updateBatchFilePreview|file_size_preview|batch_files_preview|files=\{|cancel|filename|No file uploaded" \
saas_web.py tests/test_saas_web.py tests/test_empty_target_validation.py
printf '%s\n' '--- focused test classes and coverage configuration ---'
rg -n -C 4 \
"coverage|test.*file|file.*test|updateFileSizePreview|updateBatchFilePreview|100%" \
pyproject.toml setup.cfg tox.ini .coveragerc Makefile README.md tests 2>/dev/null || trueRepository: ContextualWisdomLab/codec-carver Length of output: 50388 π Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- saas-web review convention ---'
cat /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/conventions/saas-web-py.md
printf '%s\n' '--- test convention ---'
cat /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/conventions/tests.md
printf '%s\n' '--- exact single-file branch ---'
sed -n '221,245p' saas_web.py
printf '%s\n' '--- exact batch-file branch ---'
sed -n '324,350p' saas_web.py
printf '%s\n' '--- tests near single-file UI checks ---'
sed -n '1,75p' tests/test_saas_web.py
printf '%s\n' '--- tests near batch-file UI checks ---'
sed -n '650,680p' tests/test_saas_web.py
printf '%s\n' '--- repository-owned coverage commands and thresholds ---'
rg -n -C 3 \
'coverage|--cov|fail-under|100%|html|JavaScript|browser|playwright|selenium' \
pyproject.toml .github Makefile README.md tests \
/tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/conventions \
2>/dev/null | head -240Repository: ContextualWisdomLab/codec-carver Length of output: 19256 π Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- configured application modules and test/coverage workflow ---'
sed -n '1,130p' pyproject.toml
find .github -maxdepth 3 -type f -print 2>/dev/null | sort
rg -n -C 4 \
'coverage|pytest|unittest|interrogate|saas_web\.py|--cov' \
.github pyproject.toml Makefile tox.ini setup.cfg 2>/dev/null || true
printf '%s\n' '--- all file-preview references outside the reviewed files ---'
rg -n \
'updateFileSizePreview|updateBatchFilePreview|file_size_preview|batch_files_preview|files\.length === 0|if \(!file\)' \
--glob '!saas_web.py' --glob '!tests/test_empty_target_validation.py' .
printf '%s\n' '--- focused test assertions versus file-handler contracts ---'
rg -n \
'This field is required|aria-invalid|setCustomValidity|file_size_preview|batch_files_preview|function update(File|Batch)' \
tests/test_empty_target_validation.py tests/test_saas_web.pyRepository: ContextualWisdomLab/codec-carver Length of output: 7955 νμΌ μ
λ ₯ λΆκΈ°μ κ³μ½ ν
μ€νΈλ₯Ό μΆκ°νμΈμ. νμ¬ ν
μ€νΈλ νΈλ€λ¬μ HTML μ°κ²°λ§ νμΈν©λλ€. λΉ νμΌ λλ νμΌ μ ν μ·¨μ μνμμ λ νΈλ€λ¬μ π€ Prompt for AI AgentsSource: Coding guidelines |
||
| self.assertIn( | ||
| "return;", | ||
| handler[handler.index(empty_marker) : handler.index(invalid_marker)], | ||
|
|
||
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.
π Maintainability & Code Quality | π‘ Minor | β‘ Quick win
κΈ°μ‘΄ νμ΅ νλͺ©κ³Όμ μΆ©λμ ν΄μνμΈμ.
μ νλͺ©μ λΉ νλμ
aria-invalid="true"λ₯Ό μ€μ νλΌκ³ κΆμ₯ν©λλ€. κ·Έλ¬λ κ°μ νμΌμ Line 85-87μ λΉ λ¬Έμμ΄μμthis.removeAttribute('aria-invalid')λ₯Ό νΈμΆνλΌκ³ κΆμ₯ν©λλ€. λ κ·μΉμ ν¨κ» λλ©΄ νμ ꡬνμ΄ μ΄λ² μ κ·Όμ± λμμ λλ릴 μ μμ΅λλ€. κΈ°μ‘΄ νλͺ©μ μ€λλ μνλ₯Ό μ΄κΈ°νν λ€ νμ μ€λ₯ μνλ₯Ό μ€μ νλ κ·μΉμΌλ‘ μμ νκ±°λ, μ νλͺ©μ΄ μ°μ ν¨μ λͺ μνμΈμ.π€ Prompt for AI Agents