bito-code-review[bot] commented on code in PR #44359:
URL: https://github.com/apache/superset/pull/44359#discussion_r4079154688
##########
superset-frontend/src/dashboard/components/gridComponents/Row/Row.tsx:
##########
@@ -450,7 +441,22 @@ const Row = memo((props: RowProps) => {
)}
editMode
style={{
- height: containerHeight,
+ // Only the last target in a full row (the absolutely
+ // positioned "side" target) actually resolves a
+ // percentage height -- for every other, in-flow
+ // target, GridRow's height is `fit-content`
+ // (indefinite), and a percentage height on a flex
+ // item under an indefinite-height parent resolves to
+ // `auto`/is ignored per the CSS flexbox spec, which
+ // defeats the `align-self: stretch` the CSS above
+ // already declares for it. `height: 'auto'` lets that
+ // stretch actually apply instead of collapsing the
+ // target to its content size.
+ height:
+ remainColumnCount === 0 &&
+ itemIndex === rowItems.length - 1
+ ? '100%'
+ : 'auto',
...(remainColumnCount === 0 &&
itemIndex === rowItems.length - 1 && { width: 16 }),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicated side-target condition</b></div>
<div id="fix">
The predicate `remainColumnCount === 0 && itemIndex === rowItems.length - 1`
is duplicated for the `height` ternary and the `width` spread. If one is edited
without the other, the side target's height and width diverge. Extract it to a
local const in the map callback.
</div>
</div>
<small><i>Code Review Run #ad471a</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]