-
Notifications
You must be signed in to change notification settings - Fork 229
fix: resolve 4 bugs in termui #3512
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 |
|---|---|---|
|
|
@@ -138,3 +138,5 @@ export class Form extends Widget { | |
| } | ||
| } | ||
| } | ||
|
|
||
| .catch(err => console.error("Promise.all failed:", err)); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,7 +182,7 @@ function _pathsEqual(a: number[], b: number[]): boolean { | |
|
|
||
| function _valuesEqual(a: string[], b: string[]): boolean { | ||
| if (a.length !== b.length) return false; | ||
| const sortedA = [...a].sort(); | ||
| const sortedA = [...a].sort((a, b) => a - b); | ||
|
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 | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 5 '_valuesEqual|sortedA|sortedB|node\.value|selectedValues' \
packages/ui/src/TreeSelect.ts packages/ui/src/TreeSelect.test.ts
fd -H 'tsconfig*.json' . --exec rg -n '"strict"\s*:\s*true' {}Repository: Karanjot786/TermUI Length of output: 7492 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "## package.json scripts / dependencies relevant to type checking"
python3 - <<'PY'
import json
from pathlib import Path
for p in [Path('package.json'), Path('packages/ui/package.json')]:
if p.exists():
data=json.loads(p.read_text())
print(f"--- {p} ---")
print(json.dumps({'scripts': data.get('scripts'), 'devDependencies': data.get('devDependencies'), 'dependencies': data.get('dependencies')}, indent=2, sort_keys=True))
PY
echo
echo "## TreeSelect root/root helpers"
sed -n '1,180p' packages/ui/src/TreeSelect.ts | cat -n
echo
echo "## TreeSelect tests around value content"
sed -n '1,130p' packages/ui/src/TreeSelect.test.ts | cat -n
echo
echo "## TypeScript availability and strict parameter subtraction check"
node - <<'JS'
try {
require.resolve('typescript');
console.log('typescript available');
} catch {
console.log('typescript unavailable');
}
JSRepository: Karanjot786/TermUI Length of output: 12989 Use the same comparator for both value arrays.
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| const sortedB = [...b].sort(); | ||
| for (let i = 0; i < sortedA.length; i++) { | ||
| if (sortedA[i] !== sortedB[i]) return false; | ||
|
|
||
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.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Fix the invalid
.catchexpression before merging.Promise.allis awaited at Line 83, but.catchstarts as a separate statement at Lines 141-142. This is invalid TypeScript, and Biome reports a parse error.Attach the handler directly to the promise or wrap Line 83 in
try/catch. On rejection, reset_isValidatingand callmarkDirty()before returning; otherwise Lines 92 and 97 are skipped and the form can remain stuck in validation.🧰 Tools
🪛 Biome (2.5.6)
[error] 142-142: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.
(parse)
🪛 GitHub Actions: CI / 0_build-and-test.txt
[error] 142-142: The
@termuijs/uibuild failed during tsup/esbuild: unexpected '.' at.catch(err => console.error("Promise.all failed:", err));. TypeScript also reported malformed syntax (TS1128, TS1005, and TS2304).🪛 GitHub Actions: CI / build-and-test
[error] 142-142:
@termuijs/uibuild failed during tsup/esbuild: unexpected '.' at '.catch(err => console.error("Promise.all failed:", err));'. TypeScript also reports syntax errors (TS1128, TS1005, TS2304).🤖 Prompt for AI Agents
Source: Linters/SAST tools