-
Notifications
You must be signed in to change notification settings - Fork 229
fix: resolve 4 bugs in termui #3496
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)); | ||
|
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 Attach the rejection handler correctly and preserve submit cleanup. Line 142 is a standalone When validation rejects, execution also bypasses Lines 92 and 97. Move 🧰 Tools🪛 Biome (2.5.5)[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 🪛 GitHub Actions: CI / build-and-test[error] 142-142: The 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ export function collectDeps(content: string): string[] { | |
| const deps = new Set<string>(); | ||
| let m: RegExpExecArray | null; | ||
| while ((m = re.exec(content)) !== null) deps.add(m[1]!); | ||
| return [...deps].sort(); | ||
| return [...deps].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 | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
npx tsc --noEmit --pretty false
npx vitest run scripts/build-registry.test.tsRepository: Karanjot786/TermUI Length of output: 5708 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '== files ==\n'
git ls-files | rg '(^|/)(build-registry|build-registry\.test)\.(ts|tsx)$|tsconfig.*\.json$|package\.json$' || true
printf '\n== build-registry outline ==\n'
ast-grep outline scripts/build-registry.ts --view expanded || true
printf '\n== relevant build-registry lines ==\n'
sed -n '1,100p' scripts/build-registry.ts
printf '\n== relevant tests around dependency order ==\n'
sed -n '100,160p' scripts/build-registry.test.ts
printf '\n== tsconfig files ==\n'
for f in $(git ls-files 'tsconfig*.json'); do
echo "--- $f"
cat -n "$f"
done
printf '\n== runtime comparator behavior probe ==\n'
node - <<'JS'
const deps = ['foo', 'bar', 'baz'];
console.log([...deps].sort((a, b) => a - b));
console.log('comparator returns NaN:', Number.isNaN((a, b) => a - b) ? true : ((a,b)=>a-b)('foo','bar'));
JSRepository: Karanjot786/TermUI Length of output: 13309 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '== package scripts/typecheck fields ==\n'
node - <<'JS'
const { readFileSync } = require('node:fs');
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
console.log(JSON.stringify({ scripts: pkg.scripts, dependencies: pkg.dependencies }, null, 2));
JS
printf '\n== lockfile snippets around bun/tsc packages if present ==\n'
git ls-files | rg '(^|/)(bun\.lockb|bun\.lock|pnpm-lock\.yaml|package-lock\.json|yarn\.lock)$' || trueRepository: Karanjot786/TermUI Length of output: 816 Use a string comparator for package specifiers.
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } | ||
|
|
||
| export function toSlug(name: string): string { | ||
|
|
||
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 | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 186
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 268
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 2624
Scale the epsilon before rounding.
Adding
Number.EPSILONaftervalue * 100does not correct some floating-point rounding boundaries. For example,0.575 * 100can be57.49999999999999, which still rounds to57instead of58.Add the epsilon before scaling and add a regression test for this boundary value.
Proposed fix
🤖 Prompt for AI Agents