codeant-ai-for-open-source[bot] commented on code in PR #41128:
URL: https://github.com/apache/superset/pull/41128#discussion_r3430438749


##########
superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx:
##########
@@ -30,9 +30,10 @@ import {
 import { EditorHost } from 'src/core/editors';
 import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
 
-const StyledEditorHost = styled(EditorHost)`
-  &.ace_editor {
+const EditorOutline = styled.div`
+  & .ace_editor {
     border: 1px solid ${({ theme }) => theme.colorBorder};
+    border-radius: ${({ theme }) => theme.borderRadius}px;
   }
 `;

Review Comment:
   **Suggestion:** The new outline styling only targets descendants with the 
`.ace_editor` class, so it will not render when `EditorHost` resolves to a 
non-Ace extension editor (which `EditorHost` explicitly supports). This creates 
an integration bug where template parameter editors lose the visual frame 
depending on provider; apply the border/radius to the wrapper itself so all 
editor implementations are consistently outlined. [css layout issue]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Template parameters editor unframed for non-Ace providers.
   - ⚠️ Visual inconsistency between Ace and extension editors.
   - ⚠️ Undermines generic editor extension API guarantees.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Note that `EditorHost` resolves editors via the extension system in
   `superset-frontend/src/core/editors/EditorHost.tsx:62-83`, using
   `EditorProviders.getInstance().getProvider(language)` and falling back to
   `AceEditorProvider` only when no provider is registered.
   
   2. The extension API for registering custom editors is documented in
   `superset-frontend/packages/superset-core/src/editors/index.ts:24-35`, where
   `editors.registerEditor({ id, languages: [...] }, MonacoSQLEditor)` replaces 
the default
   Ace-based editor for the given languages.
   
   3. In
   
`superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx:54-57,91-99`,
   `TemplateParamsEditor` renders `<EditorHost>` inside `EditorOutline` with
   `language={language === 'yaml' ? 'yaml' : 'json'}`, so any extension that 
registers a
   non-Ace editor for `json` or `yaml` will be used here.
   
   4. The `EditorOutline` styles at
   
`superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx:33-38` 
only apply
   `border` and `border-radius` to descendants matching `.ace_editor`; when an
   extension-provided editor is rendered that does not emit an `.ace_editor` 
element (e.g., a
   Monaco-based editor), the wrapper div has no matching descendant, so no 
border is applied
   and the template parameters editor renders without the intended visual frame.
   
   5. Contrast this with `StyledEditorHost = styled(EditorHost)` in
   
`superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx:15-18`,
   which applies border styles directly to the host component, ensuring 
consistent framing
   regardless of the underlying editor implementation—demonstrating that 
styling the wrapper
   rather than an Ace-specific class is the established, provider-agnostic 
pattern.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=06cb617fd5d444a69a77edc12bad3717&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=06cb617fd5d444a69a77edc12bad3717&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx
   **Line:** 33:38
   **Comment:**
        *Css Layout Issue: The new outline styling only targets descendants 
with the `.ace_editor` class, so it will not render when `EditorHost` resolves 
to a non-Ace extension editor (which `EditorHost` explicitly supports). This 
creates an integration bug where template parameter editors lose the visual 
frame depending on provider; apply the border/radius to the wrapper itself so 
all editor implementations are consistently outlined.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41128&comment_hash=702b34b6908660b29c7376170c87df2a5b1b7ea189aca8d234eace1a4279cd0b&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41128&comment_hash=702b34b6908660b29c7376170c87df2a5b1b7ea189aca8d234eace1a4279cd0b&reaction=dislike'>👎</a>



-- 
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]

Reply via email to