bito-code-review[bot] commented on code in PR #35986:
URL: https://github.com/apache/superset/pull/35986#discussion_r2490910049
##########
superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx:
##########
@@ -207,6 +207,44 @@ export function AsyncAceEditor(
}
}, [keywords, setCompleters]);
+ // Move autocomplete popup to the nearest parent container with
data-ace-container
+ useEffect(() => {
+ const editorInstance = (ref as any)?.current?.editor;
+ if (!editorInstance) return;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Prohibited `any` types in TypeScript code</b></div>
<div id="fix">
The code uses `any` types for accessing the Ace editor instance and handling
the command event, which violates the project's TypeScript standards that
explicitly prohibit `any` types to maintain type safety. This affects the
`ExtendedAceEditor` component's autocomplete popup repositioning logic,
potentially leading to type-related bugs in production. The fix replaces these
with proper types using `OrigEditor` for the editor and a structured type for
the event.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
const editorInstance = (ref as
React.RefObject<AceEditor>)?.current?.editor as OrigEditor | undefined;
if (!editorInstance) return;
````
</div>
</details>
</div>
<details>
<summary><b>Citations</b></summary>
<ul>
<li>
Rule Violated: <a
href="https://github.com/apache/superset/blob/46a89fc/.cursor/rules/dev-standard.mdc#L16">dev-standard.mdc:16</a>
</li>
<li>
Rule Violated: <a
href="https://github.com/apache/superset/blob/46a89fc/AGENTS.md#L16">AGENTS.md:16</a>
</li>
</ul>
</details>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35986#issuecomment-3486456071>#caf867</a></i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]