-
Notifications
You must be signed in to change notification settings - Fork 232
fix: resolve 4 bugs in termui #3488
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -104,7 +104,7 @@ class CustomMultiProgress extends (MultiProgressClass as any) { | |
| const value = Math.max(0, Math.min(1, item.value)); | ||
| const filled = Math.round(barWidth * value); | ||
|
|
||
| const pct = Math.round(value * 100); | ||
| const pct = Math.round(value * 100 + Number.EPSILON); | ||
|
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 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
test "$(node -p 'Math.round(0.145 * 100 + Number.EPSILON)')" = "14"Repository: Karanjot786/TermUI Length of output: 156 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "File exists and relevant occurrences:"
wc -l examples/todo-app/src/index.ts
rg -n "Math.round\\(|cand|pct|toFixed|EPSILON" examples/todo-app/src/index.ts || true
echo
echo "Relevant source section:"
sed -n '80,120p' examples/todo-app/src/index.tsRepository: Karanjot786/TermUI Length of output: 2424 Use a scale-aware rounding tolerance. Line 107 adds 🤖 Prompt for AI Agents |
||
| const percentStr = ` ${pct}% `; | ||
| const showPct = barWidth >= percentStr.length; | ||
| const labelStart = showPct ? Math.floor((barWidth - percentStr.length) / 2) : -1; | ||
|
|
||
| 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)); | ||
|
Comment on lines
+141
to
+142
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: #!/bin/bash
set -euo pipefail
npx --no-install biome check packages/ui/src/Form.tsRepository: Karanjot786/TermUI Length of output: 667 🏁 Script executed: #!/bin/bash
set -euo pipefail
fd -a '^Form\.ts$' . | sed 's#^\./##'
wc -l packages/ui/src/Form.ts
sed -n '1,180p' packages/ui/src/Form.tsRepository: Karanjot786/TermUI Length of output: 6721 🌐 Web query:
💡 Result: In TypeScript, encountering an "Identifier expected" error (often TS1003) in the context of trailing member or dot property access typically indicates a syntax mismatch where the parser requires a valid property name (an identifier) but encounters an unexpected token [1][2]. Common causes for this error include: 1. Improper Optional Chaining Syntax: The optional chaining operator must be written as Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
cat packages/ui/tsconfig.json 2>/dev/null || true
cat tsconfig.json 2>/dev/null || true
git status --short packages/ui/src/Form.tsRepository: Karanjot786/TermUI Length of output: 625 🏁 Script executed: #!/bin/bash
set -euo pipefail
if command -v tsc >/dev/null 2>&1; then
tsc --project packages/ui/tsconfig.json --noEmit --pretty false | sed -n '1,80p'
else
echo "tsc command not available"
fiRepository: Karanjot786/TermUI Length of output: 421 Remove the trailing The 🧰 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: tsup build failed: Unexpected "." syntax error. 🪛 GitHub Actions: CI / build-and-test[error] 142-142: tsup build failed: Unexpected "." at src/Form.ts:142. Command 'bun run build' exited with code 1. 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
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 | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 247
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 212
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 1756
Use
!event.ctrlfor the clear-form shortcut.Line [125] uses
event.ctrl !, which is a TypeScript postfix non-null assertion and preserves the Ctrl state. Handle plaincby checking!event.ctrl; otherwise Ctrl+C returns before the clear-form branch can run.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Coding guidelines