-
Notifications
You must be signed in to change notification settings - Fork 232
fix: resolve 4 bugs in termui #3446
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -122,7 +122,7 @@ class FormsExampleApp extends Widget { | |||||
| return false; // Quit | ||||||
| } | ||||||
|
|
||||||
| if (event.key === 'c' && event.ctrl === false) { | ||||||
| if (event.key === 'c' && event.ctrl !) { | ||||||
|
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 Fix the invalid TypeScript condition.
Proposed fix- if (event.key === 'c' && event.ctrl !) {
+ if (event.key === 'c' && !event.ctrl) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| this.modal.show(); | ||||||
| return true; | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,7 +27,7 @@ function decodeEntities(value: string): string { | |||||||||||||
|
|
||||||||||||||
| return value.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (match, entity: string) => { | ||||||||||||||
| if (entity.startsWith('#x')) { | ||||||||||||||
| const codePoint = Number.parseInt(entity.slice(2), 16); | ||||||||||||||
| const codePoint = Number.parseInt(entity.slice(2, 10), 16); | ||||||||||||||
|
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 Reject overlong hexadecimal entities instead of truncating them. The regular expression captures every hexadecimal digit, but If eight digits is the intended limit, reject longer entities before parsing. Proposed fix- const codePoint = Number.parseInt(entity.slice(2, 10), 16);
+ const digits = entity.slice(2);
+ if (digits.length > 8) {
+ return match;
+ }
+ const codePoint = Number.parseInt(digits, 16);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| return Number.isFinite(codePoint) ? String.fromCodePoint(codePoint) : match; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
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: 156
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 2606
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 278
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 6672
Avoid using
window.__intervalwithout a type declaration.Under strict TypeScript checks,
window.__intervalhas no declaration in the repo, so this example can failnpx -y tsc --strict --lib ES2022,DOMunless the type definitions are intentionally relying on the run-time host. Add aWindowaugmentation or type the handle explicitly with a comment if the global is intentional.🤖 Prompt for AI Agents
Source: Coding guidelines