bito-code-review[bot] commented on code in PR #41636:
URL: https://github.com/apache/superset/pull/41636#discussion_r3541381796


##########
superset-frontend/playwright/pages/ChartCreationPage.ts:
##########
@@ -41,7 +41,14 @@ export class ChartCreationPage {
    * Gets the dataset selector container (includes the displayed selection 
value)
    */
   getDatasetSelectContainer(): Locator {
-    return this.page.getByLabel('Dataset', { exact: false }).first();
+    // antd v6 moved the `aria-label` onto the combobox <input> itself, so
+    // getByLabel('Dataset') resolves to the empty input (no text content). The
+    // selected value is rendered in the `.ant-select-content-has-value` 
element
+    // (which also wraps that input), so scope to it to read the displayed 
value.
+    return this.page
+      .locator('.ant-select-content-has-value')
+      .filter({ has: this.page.getByLabel('Dataset', { exact: false }) })
+      .first();
   }

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incompatible selector for antd v6</b></div>
   <div id="fix">
   
   The selector `.ant-select-content-has-value` was removed in antd v6 for 
single-select mode optimization. Use `.ant-select-selection-item` which is 
stable across both versions, or apply the fallback pattern 
`.ant-select-content-has-value, .ant-select-selection-item` to support v5/v6 
compatibility.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
       // antd v6 moved the `aria-label` onto the combobox <input> itself, so
       // getByLabel('Dataset') resolves to the empty input (no text content). 
The
       // selected value is rendered in the `.ant-select-selection-item` 
element,
       // so scope to it to read the displayed value.
       return this.page
         .locator('.ant-select-selection-item')
         .filter({ has: this.page.getByLabel('Dataset', { exact: false }) })
         .first();
     }
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #483299</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]

Reply via email to