-
Notifications
You must be signed in to change notification settings - Fork 232
fix: resolve 4 bugs in termui #3561
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 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 Attach the rejection handler to At Line 142, Attach the handler to the Proposed fix- const results = await Promise.all(validationPromises);
+ const results = await Promise.all(validationPromises).catch((err) => {
+ console.error("Promise.all failed:", err);
+ this._isValidating = false;
+ this.markDirty();
+ return undefined;
+ });
+ if (results === undefined) return;
...
-.catch(err => console.error("Promise.all failed:", err));📝 Committable suggestion
Suggested change
🧰 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: esbuild failed to parse TypeScript/JS: Unexpected "." at src/Form.ts:142:0. Code shown: [error] 142-142: TypeScript DTS build failed with syntax errors at src/Form.ts(142,1): TS1128 Declaration or statement expected. [error] 142-142: TypeScript DTS build failed at src/Form.ts(142,2): TS1005 'try' expected. [error] 142-142: TypeScript DTS build failed at src/Form.ts(142,12): TS1005 ')' expected. [error] 142-142: TypeScript DTS build failed at src/Form.ts(142,56): TS1005 ';' expected. [error] 142-142: TypeScript DTS build failed at src/Form.ts(142,52): TS2304 Cannot find name 'err'. 🪛 GitHub Actions: CI / build-and-test[error] 142-142: esbuild build failed in package [error] 142-142: TypeScript DTS build failed with TS1128: Declaration or statement expected (src/Form.ts:142:1). [error] 142-142: TypeScript DTS build failed with TS1005: 'try' expected (src/Form.ts:142:2). [error] 142-142: TypeScript DTS build failed with TS1005: ')' expected (src/Form.ts:142:12). [error] 142-142: TypeScript DTS build failed with TS1005: ';' expected (src/Form.ts:142:56). [error] 142-142: TypeScript DTS build failed with TS2304: Cannot find name 'err' (src/Form.ts:142:52). 🤖 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 | 🟡 Minor | ⚡ Quick win
Move
Number.EPSILONbefore percentage scaling in both renderers.Adding epsilon after multiplication by 100 can leave the floating-point error unchanged. Apply the fix at the normalized-value scale.
examples/pomodoro-timer/src/index.tsx#L185-L185: useMath.round((this._value + Number.EPSILON) * 100).examples/todo-app/src/index.ts#L107-L107: useMath.round((value + Number.EPSILON) * 100).📍 Affects 2 files
examples/pomodoro-timer/src/index.tsx#L185-L185(this comment)examples/todo-app/src/index.ts#L107-L107🤖 Prompt for AI Agents