-
Notifications
You must be signed in to change notification settings - Fork 229
fix: resolve 4 bugs in termui #3518
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); | ||
| const sortedB = [...b].sort(); | ||
|
Comment on lines
+185
to
186
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 | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
npx --no-install tsc --noEmit --pretty falseRepository: Karanjot786/TermUI Length of output: 5708 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)TreeSelect\.(ts|test\.ts)$|(^|/)tsconfig.*\.json$|package\.json$' || true
echo "== TreeSelect outline =="
ast-grep outline packages/ui/src/TreeSelect.ts || true
echo "== relevant TreeSelect code =="
cat -n packages/ui/src/TreeSelect.ts | sed -n '140,210p'
echo "== test relevant code =="
cat -n packages/ui/src/TreeSelect.test.ts | sed -n '1,120p'
echo "== package tsconfig =="
for f in tsconfig.json packages/tsconfig.json; do
[ -f "$f" ] && { echo "-- $f"; cat -n "$f"; }
done
echo "== build typecheck with project config =="
npx --no-install tsc --showConfig --build --dry 2>&1 | head -50 || true
npx --no-install tsc -b --noEmit 2>&1 | head -200 || trueRepository: Karanjot786/TermUI Length of output: 11804 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "== root/package configs =="
for f in package.json packages/ui/package.json packages/ui/tsconfig.json packages/ui/tsconfig.typecheck.json tsconfig.base.json; do
[ -f "$f" ] && { echo "-- $f"; cat -n "$f"; }
done
echo "== TypeScript invocation with project =="
npx --no-install tsc -p packages/ui/tsconfig.typecheck.json --noEmit 2>&1
echo "== local JS sort/comparator behavior =="
node2 - <<'JS'
for (const pairs of [
[['2', '10'], ['10', '2']],
[['s', 'a'], ['a', 's']],
[['one', 'two'], ['two', 'one']],
]) {
const a = [...pairs[0]].sort((a, b) => a - b);
const b = [...pairs[0]].sort();
console.log(pairs[0].join(','), 'cmpA=', a.join(','), 'sort=', b.join(','));
}
JSRepository: Karanjot786/TermUI Length of output: 5927 Fix the value-equality comparator.
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| 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
Attach the rejection handler to
Promise.allcorrectly.Line 142 starts a standalone
.catchexpression. Biome reports this as a parse error, sopackages/ui/src/Form.tscannot compile.Use
try/catcharound theawait Promise.all(validationPromises)at Line 83. In the rejection path, reset_isValidatingand callmarkDirty()before returning or rethrowing. Do not continue withresultsafterPromise.allrejects.🧰 Tools
🪛 Biome (2.5.6)
[error] 142-142: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.
(parse)
🤖 Prompt for AI Agents
Source: Linters/SAST tools