bito-code-review[bot] commented on code in PR #39245:
URL: https://github.com/apache/superset/pull/39245#discussion_r3206118024
##########
superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx:
##########
@@ -109,8 +155,22 @@ const SSHTunnelForm = ({
placeholder={t('e.g. Analytics')}
value={db?.ssh_tunnel?.username || ''}
onChange={onSSHTunnelParametersChange}
+ onBlur={() => markBlurred('username')}
+ aria-invalid={
+ fieldError('username', db?.ssh_tunnel?.username) || undefined
+ }
+ aria-describedby={
+ fieldError('username', db?.ssh_tunnel?.username)
+ ? 'ssh-username-error'
+ : undefined
+ }
data-test="ssh-tunnel-username-input"
/>
+ {fieldError('username', db?.ssh_tunnel?.username) && (
+ <span id="ssh-username-error" role="alert"
css={fieldErrorStyles}>
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent Error ID Naming</b></div>
<div id="fix">
Error element IDs for form fields are inconsistently named
('server-address-error', 'server-port-error', 'ssh-username-error'), reducing
maintainability in this module-level component. Standardize by removing the
'ssh-' prefix from the username error ID.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
- fieldError('username', db?.ssh_tunnel?.username)
- ? 'ssh-username-error'
- : undefined
+ fieldError('username', db?.ssh_tunnel?.username)
+ ? 'username-error'
+ : undefined
@@ -170,1 +170,1 @@
- <span id="ssh-username-error" role="alert"
css={fieldErrorStyles}>
+ <span id="username-error" role="alert"
css={fieldErrorStyles}>
```
</div>
</details>
</div>
<small><i>Code Review Run #0bd36a</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]