You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2026/08/11 17:00:10 UTC

[PR] Initial container design [superset]

michael-s-molina opened a new pull request, #43065:
URL: https://github.com/apache/superset/pull/43065

   ### SUMMARY
   - Refactor the code to isolate the root grid from building blocks
   - Adds 3 examples of containers
   - Improves layout a little bit (not final version but more flexible than previous version)
   - Adds drag and drop of building blocks
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   
   https://github.com/user-attachments/assets/cd1cbbfe-c806-43de-a973-19e3b4666145
   
   
   ### TESTING INSTRUCTIONS
   Prototype. No tests required.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] Initial container design [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #43065:
URL: https://github.com/apache/superset/pull/43065#issuecomment-5255851896

   ### <span aria-hidden="true">โœ…</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">๐Ÿ”จ</span> Latest commit | cf5d742479889d96f0f4824c292c0be9b5a8e479 |
   |<span aria-hidden="true">๐Ÿ”</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a7b4bb0ae2e0f0008c8b2b5 |
   |<span aria-hidden="true">๐Ÿ˜Ž</span> Deploy Preview | [https://deploy-preview-43065--superset-docs-preview.netlify.app](https://deploy-preview-43065--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">๐Ÿ“ฑ</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQzMDY1LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.IuAvbwUbiNEsb-rK4Jr_U_kIqrIRvQtKt1D9YHGgFlU)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">๐Ÿค–</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#q1YqKMrPLShRslJS0lFKKkrMS84AslMSizOS8hOLUnST8_NKEjPzUouKgfIpqQU5-ZWeKUAVZonmSSZJSQaJqUapBmkGBgYWyRZJRkmmSrUA) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-43065--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] Initial container design [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #43065:
URL: https://github.com/apache/superset/pull/43065#discussion_r3759791112


##########
superset-frontend/src/core/dashboard/RootGrid.test.tsx:
##########
@@ -176,6 +175,19 @@ test('the grid is told not to start a drag from the remove control', () => {
   ).not.toBeNull();
 });
 
+test('the grid is also told not to start a drag from a nested block resize handle', () => {
+  mount();
+
+  // The same guard as the remove control, for the same reason โ€” a `tabs`
+  // block sitting on this grid renders its own resize handle (see
+  // `TabsBlock`'s `FlowItem`) for a block flowed into one of its panes, and
+  // without this, resizing that block also drags the `tabs` item holding it.
+  const cancel = screen
+    .getByTestId('rgl')
+    .getAttribute('data-draggable-cancel');
+  expect(cancel).toContain('[data-block-resize]');
+});

Review Comment:
   **Suggestion:** The regression test claims to cover a nested block resize handle, but `mount()` only creates two markdown blocks and renders no `tabs` container or nested flow item. Consequently, the assertion checks only the static `draggableCancel` string and would pass even if nested resize handles were not actually prevented from dragging their parent. Construct a tabs container with a nested block and assert the rendered nested resize handle is covered by the cancellation behavior. [possible bug]
   
   <details>
   <summary><b>Severity Level:</b> Minor ๐Ÿงน</summary>
   
   ```mdx
   - โš ๏ธ RootGrid test does not cover nested resize interactions.
   - โš ๏ธ Future selector regressions can pass unnoticed.
   - โŒ Nested block resizing could drag its parent container.
   ```
   </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=414559ad01be4491ad0a591219334c22&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=414559ad01be4491ad0a591219334c22&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/RootGrid.test.tsx
   **Line:** 178:189
   **Comment:**
   	*Possible Bug: The regression test claims to cover a nested block resize handle, but `mount()` only creates two markdown blocks and renders no `tabs` container or nested flow item. Consequently, the assertion checks only the static `draggableCancel` string and would pass even if nested resize handles were not actually prevented from dragging their parent. Construct a tabs container with a nested block and assert the rendered nested resize handle is covered by the cancellation behavior.
   
   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%2F43065&comment_hash=a3194158da2520368f10179086de30fcfd7ae6e54679d885aefaceb253e65cb2&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=a3194158da2520368f10179086de30fcfd7ae6e54679d885aefaceb253e65cb2&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset-frontend/src/core/dashboard/blocks/TabsBlock.tsx:
##########
@@ -0,0 +1,241 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { useLayoutEffect, useState } from 'react';
+import type { ReactElement } from 'react';
+import { t } from '@apache-superset/core/translation';
+import { css, styled } from '@apache-superset/core/theme';
+import { ActionButton } from '@superset-ui/core/components';
+import { Icons } from '@superset-ui/core/components/Icons';
+import { provider, useDashboardRevision } from '../store';
+import { FlowContent } from './flowContent';
+
+/**
+ * A pane's own child type โ€” not registered as a building block in its own
+ * right (see `registerBuiltInBuildingBlocks`), since nothing ever resolves
+ * one through `resolveBuildingBlockView`: this component renders a pane's
+ * `children` directly rather than rendering the pane node itself through
+ * `BuildingBlockView`. It only needs to be a *container* type (so
+ * `addBuildingBlock` gives it a `children` array) โ€” see
+ * `registerContainerType` in `DashboardProvider`.
+ */
+export const TAB_TYPE = 'tab';
+
+/**
+ * The negative margin is what keeps the tab bar full-width.
+ *
+ * `BuildingBlockView` now insets every block's content by the card's own
+ * padding (see its own comment) โ€” right for a chart or a table, which is a
+ * single thing filling the card, but wrong for a strip of tabs, which reads
+ * as cut short the moment it does not reach the card's edges the way a
+ * header would. `FlowContent` keeps its own inset (see its own comment) for
+ * the content flowed into a pane, which is the single-thing case the
+ * padding was written for; this cancels that same padding for the chrome
+ * around it โ€” on three sides only. The top is not the card's own padding to
+ * begin with:
+ * this box starts right where the header already ends, not at the card's
+ * true top edge, so cancelling it as well pulled the tab bar up past the
+ * header instead of just to the card's left/right/bottom edges, overlapping
+ * the two.
+ */
+const Root = styled.div`
+  ${({ theme }) => css`
+    display: flex;
+    flex-direction: column;
+    width: 100%;
+    height: 100%;
+    margin: 0 -${theme.padding}px -${theme.padding}px;
+  `}
+`;
+
+const TabBar = styled.div`
+  ${({ theme }) => css`
+    display: flex;
+    align-items: center;
+    gap: ${theme.sizeUnit}px;
+    flex: 0 0 auto;
+    padding: 0 ${theme.sizeUnit * 2}px;
+    border-bottom: 1px solid ${theme.colorBorderSecondary};
+    overflow-x: auto;
+  `}
+`;
+
+const TabButton = styled.button<{ $active: boolean }>`
+  ${({ theme, $active }) => css`
+    appearance: none;
+    border: none;
+    background: none;
+    flex: 0 0 auto;
+    padding: ${theme.sizeUnit * 2}px ${theme.sizeUnit * 3}px;
+    font-size: ${theme.fontSizeSM}px;
+    font-weight: ${$active ? theme.fontWeightStrong : theme.fontWeightNormal};
+    color: ${$active ? theme.colorPrimaryText : theme.colorTextSecondary};
+    border-bottom: 2px solid ${$active ? theme.colorPrimary : 'transparent'};
+    white-space: nowrap;
+    cursor: pointer;
+    transition:
+      color ${theme.motionDurationMid},
+      border-color ${theme.motionDurationMid};
+
+    &:hover {
+      color: ${theme.colorPrimaryText};
+    }
+
+    &:focus-visible {
+      outline: 2px solid ${theme.colorPrimaryBorder};
+      outline-offset: -2px;
+    }
+  `}
+`;
+
+/**
+ * A tab and its own remove control, as siblings rather than one nested
+ * inside the other.
+ *
+ * `TabButton` is a real `<button>` โ€” switching tabs is what most presses on
+ * it mean, and a button is what answers Enter/Space and reads as one to a
+ * screen reader. The remove control is `ActionButton`, itself a `<button>`,
+ * and a button inside a button is invalid HTML that nothing downstream can
+ * reliably navigate into. Wrapped here as two controls sharing a row
+ * instead, the same shape `BuildingBlockView`'s own header takes for a name
+ * and its own remove control.
+ */
+const TabItem = styled.span`
+  display: flex;
+  align-items: center;
+  flex: 0 0 auto;
+`;
+
+/** What a pane is called before an author (or the assistant) names it. */
+const untitledLabel = (index: number): string => t('Tab %s', index + 1);
+
+/**
+ * The built-in `tabs` building block โ€” a container whose own children (each
+ * a `tab` pane, itself a container) are switchable rather than all shown at
+ * once. Registered like any other block (see `registerBuiltInBuildingBlocks`),
+ * it holds children of its own like the root's own grid does โ€” but unlike
+ * the root, it has no grid: which pane is showing is this component's own
+ * concern, not a `layout` fact the document carries. Per the
+ * composition/layout design doc, that's the point โ€” a container answers
+ * "how do I arrange what's inside me" for itself, and this is simply one
+ * answer among many, no more privileged than the root's own grid.
+ *
+ * Which pane is *active* is intentionally not persisted: it's a fact about
+ * who's looking at the dashboard right now, not about the dashboard itself
+ * (the same reasoning `DashboardProvider`'s own `selection` field is
+ * host-internal rather than part of a node). It resets to the first pane
+ * whenever the previously active one no longer exists โ€” most commonly right
+ * after that pane is removed, or on a first render with no pane yet.
+ */
+export default function TabsBlock({ nodeId }: { nodeId: string }): ReactElement | null {
+  useDashboardRevision();
+  const node = provider.getNode(nodeId);
+  const panes = node?.children ?? [];
+
+  const [activeTabId, setActiveTabId] = useState<string | undefined>(panes[0]);
+  const activeIsValid = activeTabId !== undefined && panes.includes(activeTabId);
+  if (!activeIsValid && activeTabId !== panes[0]) {
+    setActiveTabId(panes[0]);
+  }
+
+  const addTab = (): void => {
+    const id = provider.addBuildingBlock(nodeId, panes.length, {
+      type: TAB_TYPE,
+      props: { label: untitledLabel(panes.length) },
+    });
+    setActiveTabId(id);
+  };
+
+  // A tabs block with nothing in it yet has nothing to switch between โ€”
+  // the first thing anyone would do with one is press + once anyway, so
+  // this does it for them. An effect rather than done inline during render:
+  // render must not mutate the document itself, only read it. Laid out
+  // rather than a plain effect so the fill-in happens before the browser
+  // ever paints the empty state, which would otherwise flash for one frame
+  // on every block placed from the palette.
+  useLayoutEffect(() => {
+    if (node && panes.length === 0) {
+      addTab();
+    }
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [nodeId, node, panes.length]);
+
+  if (!node) return null;
+
+  return (
+    <Root data-test={`tabs-${nodeId}`}>
+      <TabBar role="tablist" aria-label={t('Tabs')}>
+        {panes.map((paneId, index) => {
+          const pane = provider.getNode(paneId);
+          const label =
+            (pane?.props?.label as string | undefined) || untitledLabel(index);
+          const active = paneId === activeTabId;
+          return (
+            <TabItem key={paneId}>
+              <TabButton
+                type="button"
+                role="tab"
+                tabIndex={0}
+                aria-selected={active}
+                $active={active}
+                data-test={`tab-${paneId}`}
+                onClick={() => setActiveTabId(paneId)}
+              >
+                {label}
+              </TabButton>
+              {/* Offered once there is a second tab to fall back to โ€”
+                  removing the only one just left a blank tabs block the
+                  effect above would immediately refill, which reads as the
+                  control having silently done nothing. */}
+              {panes.length > 1 && (
+                <ActionButton
+                  label={t('Remove tab')}
+                  tooltip={t('Remove tab')}
+                  placement="bottom"
+                  dataTest={`tab-remove-${paneId}`}
+                  icon={<Icons.CloseOutlined iconSize="s" />}
+                  onClick={() => provider.removeBuildingBlock(paneId)}
+                />
+              )}
+            </TabItem>
+          );
+        })}
+        <ActionButton
+          label={t('Add tab')}
+          tooltip={t('Add tab')}
+          placement="bottom"
+          dataTest={`tabs-add-${nodeId}`}
+          icon={<Icons.PlusOutlined iconSize="s" />}
+          onClick={addTab}

Review Comment:
   **Suggestion:** The tab buttons and add/remove `ActionButton` controls are inside a root-grid item but are not marked with any selector included in `RootGrid`'s `draggableCancel`, nor do they stop pointer-down propagation. Pressing or clicking these controls can therefore start dragging the entire tabs block instead of only switching, adding, or removing a tab. Mark the controls or their shared bar as a draggable-cancel region. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major โš ๏ธ</summary>
   
   ```mdx
   - โŒ Tab interactions can move the entire tabs block.
   - โš ๏ธ Add and remove controls conflict with dragging.
   - โš ๏ธ Switching tabs becomes unreliable during pointer movement.
   ```
   </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=a95a0c2d42424f7bbbb5b448c1887fa2&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=a95a0c2d42424f7bbbb5b448c1887fa2&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/blocks/TabsBlock.tsx
   **Line:** 205:224
   **Comment:**
   	*Logic Error: The tab buttons and add/remove `ActionButton` controls are inside a root-grid item but are not marked with any selector included in `RootGrid`'s `draggableCancel`, nor do they stop pointer-down propagation. Pressing or clicking these controls can therefore start dragging the entire tabs block instead of only switching, adding, or removing a tab. Mark the controls or their shared bar as a draggable-cancel region.
   
   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%2F43065&comment_hash=9bbc81e80b82f3a8bc10e6e8e503ba4698f0a96c44b24462fd4a68639a60d2f7&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=9bbc81e80b82f3a8bc10e6e8e503ba4698f0a96c44b24462fd4a68639a60d2f7&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset-frontend/src/core/dashboard/blocks/CollapsibleBlock.tsx:
##########
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { ReactElement } from 'react';
+import { t } from '@apache-superset/core/translation';
+import { css, styled } from '@apache-superset/core/theme';
+import { provider, useDashboardRevision } from '../store';
+import { FlowContent } from './flowContent';
+
+/**
+ * The negative margin is what lets `FlowContent`'s own inset (see its own
+ * comment) reach the card's true edges instead of sitting inside it twice โ€”
+ * see `TabsBlock`'s identical `Root`, which this mirrors for the identical
+ * reason. The top is left alone, since this box already starts below the
+ * card's header rather than at its true top edge.
+ */
+const Root = styled.div`
+  ${({ theme }) => css`
+    width: 100%;
+    height: 100%;
+    margin: 0 -${theme.padding}px -${theme.padding}px;

Review Comment:
   **Suggestion:** The collapsible content root has `height: 100%` but is not a flex container, while `FlowArea` relies on `flex: 1 1 auto` to fill the available block height. Consequently, an un-sized child in a collapsible does not fill the container and falls back to its minimum height instead, producing a short content area with unused space. Make this root a column flex container or give the flow area an explicit available height. [css layout issue]
   
   <details>
   <summary><b>Severity Level:</b> Major โš ๏ธ</summary>
   
   ```mdx
   - โš ๏ธ Expanded collapsibles show undersized content areas.
   - โš ๏ธ Unsized children do not fill available card height.
   - โš ๏ธ Empty-state and child layouts appear vertically compressed.
   ```
   </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=151a51969dfc4adaaf862de18c192c3c&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=151a51969dfc4adaaf862de18c192c3c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/blocks/CollapsibleBlock.tsx
   **Line:** 34:36
   **Comment:**
   	*Css Layout Issue: The collapsible content root has `height: 100%` but is not a flex container, while `FlowArea` relies on `flex: 1 1 auto` to fill the available block height. Consequently, an un-sized child in a collapsible does not fill the container and falls back to its minimum height instead, producing a short content area with unused space. Make this root a column flex container or give the flow area an explicit available height.
   
   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%2F43065&comment_hash=04ec2052081a946492cbb4c4d5bdb36c14e9ce058e8aa685dd764a79e80418f0&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=04ec2052081a946492cbb4c4d5bdb36c14e9ce058e8aa685dd764a79e80418f0&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset-frontend/src/core/dashboard/RootGrid.tsx:
##########
@@ -0,0 +1,544 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { useCallback } from 'react';
+import type { DragEvent as ReactDragEvent } from 'react';
+// The v1-compatible flat-props API (this component's own model: a plain
+// `cols`/`rowHeight`/`margin` grid, no responsive breakpoints โ€” see the
+// design doc's "Explicitly deferred" section) lives at this subpath in v2;
+// the package's main entry exports only the newer composable API.
+import GridLayoutLegacy, { WidthProvider } from 'react-grid-layout/legacy';
+import type { Layout, LayoutItem } from 'react-grid-layout/legacy';
+import 'react-grid-layout/css/styles.css';
+import type { dashboard as dashboardApi } from '@apache-superset/core';
+import { css, styled, useTheme } from '@apache-superset/core/theme';
+import { provider, useDashboardRevision } from './store';
+import { resolveGridMetrics } from './layoutStyle';
+import { availableDropSpan, packChildLayout } from './gridPacking';
+import { FALLBACK_ROW_SPAN, PALETTE_MIME, placeBlock, placeBlockAt } from './placement';
+import BuildingBlockView from './BuildingBlockView';
+
+type LayoutProps = dashboardApi.LayoutProps;
+
+const ResizableGridLayout = WidthProvider(GridLayoutLegacy);
+
+/** `react-grid-layout`'s own item id for the live drop preview โ€” see `handleDropDragOver`. Distinct from `DashboardProvider`'s own `node_<n>` ids by construction, so it can never collide with a real node while a drag is in progress. */
+const DROPPING_ITEM_ID = '__dropping-block__';
+
+/**
+ * Where a dragged or (via `isDroppable`, below) freshly dropped block is
+ * about to land โ€” the one on-screen answer to "where, exactly" for a
+ * gesture that otherwise only shows the cursor.
+ *
+ * `react-grid-layout/css/styles.css` (imported above) styles its
+ * `.react-grid-placeholder` red at 0.2 opacity by default โ€” a rectangle this
+ * restyles in the app's own primary colour instead, rather than editing the
+ * package's own stylesheet (not this codebase's to change, and gone on the
+ * next install). A descendant selector under this element's own generated
+ * class outweighs the plain two-class rule it is overriding, so this wins
+ * without needing `!important`.
+ *
+ * `react-grid-layout` renders the identical placeholder for a *resize* too,
+ * carrying its own extra `placeholder-resizing` class โ€” resizing an
+ * existing block already shows that block's own edges moving live under the
+ * pointer, so a second box drawn on top of it would only repeat what is
+ * already on screen. The extra class is what tells the two apart; the base
+ * rule is left for the drag/drop case this was actually added for.
+ */
+const GridSurface = styled.div`
+  ${({ theme }) => css`
+    width: 100%;
+    height: 100%;
+    overflow-x: hidden;
+    overflow-y: auto;
+
+    .react-grid-item.react-grid-placeholder {
+      background-color: ${theme.colorPrimaryBg};
+      border: 2px dashed ${theme.colorPrimary};
+      border-radius: ${theme.borderRadiusLG}px;
+      opacity: 1;
+
+      &.placeholder-resizing {
+        background: transparent;
+        border: none;
+        opacity: 0;
+      }
+    }
+  `}
+`;
+
+// DEBUG INSTRUMENTATION โ€” kept in place on purpose while the drag/resize
+// interaction is still being worked out; remove only when explicitly asked
+// to. Logs which node id/type a gesture actually started on (so it's
+// obvious, e.g., when a click lands on a nested container instead of the
+// chart the user meant to grab) and what RootGrid ends up committing at the end
+// of it.
+const DASHBOARD_DRAG_DEBUG = true;
+function debugLog(event: string, detail: Record<string, unknown>) {
+  if (!DASHBOARD_DRAG_DEBUG) return;
+  // eslint-disable-next-line no-console
+  console.debug(`[dashboard-drag] ${event}`, detail);
+}
+function describeNode(id: string | undefined) {
+  if (!id) return undefined;
+  const node = provider.getNode(id);
+  return { id, type: node?.type };
+}
+
+/**
+ * Finds the deepest dashboard container actually under a screen point,
+ * ignoring `excludeEl`'s own subtree โ€” the block being dragged might itself
+ * be, or contain, a container, and a drop "onto itself" isn't a valid
+ * reparent target. Every container's outer element carries
+ * `data-container-id` (this component's own does; others set it on whatever
+ * DOM they render a drop target from), so this is the one piece of
+ * cross-container awareness a drag needs: which container the pointer is
+ * over right now, at any nesting depth, without any container needing to
+ * know about any other container's existence.
+ *
+ * `excludeEl`'s `pointer-events` is toggled off for the single synchronous
+ * `elementFromPoint` call so the hit-test sees through the dragged element
+ * to whatever is actually underneath it on screen (otherwise the dragged
+ * element โ€” positioned directly under the cursor by definition โ€” would
+ * always be its own top hit).
+ */
+function findContainerIdAt(
+  clientX: number,
+  clientY: number,
+  excludeEl: HTMLElement,
+): string | null {
+  const previousPointerEvents = excludeEl.style.pointerEvents;
+  excludeEl.style.pointerEvents = 'none';
+  const hit = document.elementFromPoint(clientX, clientY);
+  excludeEl.style.pointerEvents = previousPointerEvents;
+  return (
+    hit?.closest<HTMLElement>('[data-container-id]')?.dataset.containerId ??
+    null
+  );
+}
+
+/**
+ * The dashboard's own grid โ€” not a Building Block (see the composition/
+ * layout design doc), which is why it lives here rather than in `blocks/`
+ * alongside the things that get placed on it. There is exactly one of these
+ * per dashboard, rendered for the root and only the root: `BuildingBlockView`
+ * resolves the root's renderer to this component directly, rather than
+ * through the `dashboard.buildingBlocks` registry every real building block
+ * goes through โ€” nothing places a `RootGrid`, and nothing ever will, the same
+ * way nothing places the dashboard itself.
+ *
+ * Backed by `react-grid-layout`. All position/size math โ€” including
+ * collision handling โ€” is `react-grid-layout`'s: resizing a block never
+ * shrinks a sibling, only displaces it to the next open slot (clamped to
+ * `minW`/`minH: 1`), which leaves every block's own authored (hand- or
+ * AI-set) span untouched. This component's job is translating between the
+ * stored `col`/`row`/`colSpan`/`rowSpan` schema (which allows a child to
+ * omit its position entirely, to be auto-placed) and `react-grid-layout`'s
+ * own `{x, y, w, h}` โ€” see `packChildLayout` for the auto-placement piece RGL
+ * has no concept of โ€” and committing back to the store only once a gesture
+ * ends (`onDragStop`/`onResizeStop`), never on every intermediate frame.
+ *
+ * Dragging a block into a *different* container (reparenting, as opposed to
+ * repositioning within this one) is handled by hit-testing which
+ * `data-container-id` is under the pointer when the drag ends โ€” deliberately
+ * not something `react-grid-layout` (scoped to one grid instance) handles on
+ * its own.
+ */
+export default function RootGrid({ nodeId }: { nodeId: string }) {
+  useDashboardRevision();
+  const theme = useTheme();
+  const node = provider.getNode(nodeId);
+
+  const commitLayout = useCallback(
+    (rglLayout: Layout) => {
+      const updates: Record<string, Partial<LayoutProps>> = {};
+      rglLayout.forEach(item => {
+        updates[item.i] = {
+          col: item.x + 1,
+          row: item.y + 1,
+          colSpan: item.w,
+          rowSpan: item.h,
+        };
+      });
+      debugLog('commitLayout', { containerId: nodeId, updates });
+      provider.updateLayouts(updates);
+    },
+    [nodeId],
+  );
+
+  const handleDragStart = useCallback(
+    (_layout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('dragStart', {
+        containerId: nodeId,
+        dragged: describeNode(newItem?.i),
+      });
+    },
+    [nodeId],
+  );
+
+  const handleResizeStart = useCallback(
+    (_layout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('resizeStart', {
+        containerId: nodeId,
+        resized: describeNode(newItem?.i),
+      });
+    },
+    [nodeId],
+  );
+
+  const handleResizeStop = useCallback(
+    (rglLayout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('resizeStop', {
+        containerId: nodeId,
+        resized: describeNode(newItem?.i),
+      });
+      commitLayout(rglLayout);
+    },
+    [nodeId, commitLayout],
+  );
+
+  const handleDragStop = useCallback(
+    (
+      rglLayout: Layout,
+      _oldItem: unknown,
+      newItem: { i: string } | null,
+      _placeholder: unknown,
+      event: Event,
+      element: HTMLElement | null,
+    ) => {
+      const { clientX, clientY } = event as MouseEvent;
+      const targetContainerId =
+        newItem && element && clientX != null && clientY != null
+          ? findContainerIdAt(clientX, clientY, element)
+          : null;
+
+      debugLog('dragStop', {
+        containerId: nodeId,
+        dragged: describeNode(newItem?.i),
+        targetContainerId,
+        reparenting: !!targetContainerId && targetContainerId !== nodeId,
+      });
+
+      if (targetContainerId && targetContainerId !== nodeId && newItem) {
+        try {
+          // moveBuildingBlock itself clears col/row and clamps colSpan to
+          // the destination's own column count โ€” old coordinates were only
+          // ever meaningful in *this* container's grid.
+          const destIndex =
+            provider.getNode(targetContainerId)?.children?.length ?? 0;
+          provider.moveBuildingBlock(newItem.i, targetContainerId, destIndex);
+          return;
+        } catch {
+          // Dropped onto itself or one of its own descendants โ€” not a valid
+          // reparent target. Fall through and keep it in this container.
+        }
+      }
+
+      commitLayout(rglLayout);
+    },
+    [nodeId, commitLayout],
+  );
+
+  if (!node) return null;
+
+  const { columns, gap, rowUnitPx } = resolveGridMetrics(node.layout, theme);
+  const children = node.children ?? [];
+
+  const packed = packChildLayout(children, columns, provider.getNode);
+  const layout: Layout = children.map(id => ({
+    i: id,
+    minW: 1,
+    minH: 1,
+    ...packed[id],
+  }));
+
+  /**
+   * How wide a block being dragged in from the palette should preview at,
+   * for wherever the pointer currently is โ€” react-grid-layout's own
+   * `isDroppable` calls this on every dragover and merges the `w`/`h` it
+   * returns into the live placeholder, so this is the one place that decides
+   * "how much room is actually here" rather than the block always claiming
+   * a fixed span regardless of what it is being dropped next to.
+   *
+   * Not a palette drag at all (a file from the desktop, dragged text, โ€ฆ) is
+   * `false`: nothing else on the grid should react to it, and returning
+   * anything else would show a preview for a drop this grid never accepts
+   * in the first place.
+   *
+   * Hovering over a *nested* container (a `tabs`/`collapsible`/`carousel`
+   * block sitting on this grid, or anything a third party contributes) is
+   * `false` for the identical reason: that container has its own drop
+   * target (`FlowContent`/`EmptyArea`, tagged `data-container-id`, the same
+   * way this component's own `GridSurface` is) and is where the block
+   * actually belongs, not beside or on top of the container's own card on
+   * *this* grid. Without this, both react to the same hover โ€” this preview
+   * showing a push-down where the container sits, the container's own
+   * unaware that anything is above it โ€” and only one of them ever runs its
+   * cleanup on drop (`FlowContent`'s own `onDrop` stops the event there),
+   * leaving this one's placeholder on screen with nothing left to clear it.
+   *
+   * The width and height themselves are `availableDropSpan`'s own call (see
+   * `gridPacking.ts`) โ€” this only has to translate the cursor's pixel
+   * position into the grid cell underneath it, the same conversion
+   * `react-grid-layout` itself does internally to place every other item. A
+   * gap between two existing blocks that is already tall enough on its own
+   * is exactly where that matters: without shrinking to fit it, the preview
+   * would keep asking for its own full, unshrunk height regardless of how
+   * little of it the gap actually has room for, and collide its way into
+   * shoving the block below down to clear space that was never short to
+   * begin with.
+   *
+   * `dragOffsetX`/`dragOffsetY` correct for something react-grid-layout does
+   * on its own that reads wrong for this gesture: left uncorrected, it
+   * centers the preview *on* the cursor, so a block six rows tall starts
+   * three rows above wherever the pointer actually is. Dropped "just below"
+   * a row of blocks, that is enough to land back on top of them instead โ€”
+   * exactly what this offsets away, by feeding back half of whatever pixel
+   * size the preview is about to be (`react-grid-layout`'s own
+   * `calcGridItemWHPx` math, reproduced here since nothing shorter reaches
+   * it) so the centering it does and the anchoring this undoes cancel out,
+   * and the preview's top-left corner ends up *at* the cursor instead.
+   */
+  const handleDropDragOver = (
+    event: ReactDragEvent<HTMLDivElement>,
+  ): {
+    w?: number;
+    h?: number;
+    dragOffsetX?: number;
+    dragOffsetY?: number;
+  } | false => {
+    if (!event.dataTransfer.types.includes(PALETTE_MIME)) {
+      return false;
+    }
+
+    const hoveredContainerId = (
+      event.target as HTMLElement
+    ).closest<HTMLElement>('[data-container-id]')?.dataset.containerId;
+    if (hoveredContainerId && hoveredContainerId !== nodeId) {
+      return false;
+    }
+
+    const gridRect = event.currentTarget.getBoundingClientRect();
+    const colWidth = (gridRect.width - gap * (columns - 1)) / columns;
+    const colStride = colWidth + gap;
+    const rowStride = rowUnitPx + gap;
+    const cursorCol = Math.min(
+      columns - 1,
+      Math.max(0, Math.floor((event.clientX - gridRect.left) / colStride)),
+    );
+    const cursorRow = Math.max(
+      0,
+      Math.floor((event.clientY - gridRect.top) / rowStride),
+    );
+
+    const { w, h } = availableDropSpan(
+      packed,
+      columns,
+      cursorCol,
+      cursorRow,
+      FALLBACK_ROW_SPAN,
+    );
+    const pixelWidth = Math.round(colWidth * w + Math.max(0, w - 1) * gap);
+    const pixelHeight = Math.round(
+      rowUnitPx * h + Math.max(0, h - 1) * gap,
+    );
+
+    return {
+      w,
+      h,
+      dragOffsetX: pixelWidth / 2,
+      dragOffsetY: pixelHeight / 2,
+    };
+  };
+
+  /**
+   * Where a palette drag actually lands, once released โ€” the counterpart to
+   * `GridSurface`'s own plain `onDrop` (below, for a drop that missed the
+   * grid entirely, into the leftover space past its last row): this one
+   * fires when react-grid-layout's own `isDroppable` resolved a real x/y/w/h
+   * for the drop, live, during the drag itself (see `handleDropDragOver`),
+   * so there is no position left to compute here โ€” only a type to read off
+   * the browser's own drag data, and where among the existing children this
+   * new one's own row/col actually falls (see `placeBlockAt`'s own doc
+   * comment for why that has to be figured out here rather than left to
+   * default to "at the end").
+   */
+  const handleExternalDrop = (
+    _rglLayout: Layout,
+    item: LayoutItem | undefined,
+    event: Event,
+  ) => {
+    const type = (event as DragEvent).dataTransfer?.getData(PALETTE_MIME);
+    if (!type || !item) return;
+
+    const readingOrderIndex = children.findIndex(id => {
+      const rect = packed[id];
+      return rect.y > item.y || (rect.y === item.y && rect.x >= item.x);
+    });
+    const index =
+      readingOrderIndex === -1 ? children.length : readingOrderIndex;
+
+    debugLog('dropOnGrid', { containerId: nodeId, type, item, index });
+    placeBlockAt(nodeId, type, index, {
+      col: item.x + 1,
+      row: item.y + 1,
+      colSpan: item.w,
+      rowSpan: item.h,
+    });
+  };
+
+  return (
+    <GridSurface
+      data-container-id={nodeId}
+      data-test="grid-container"
+      // The grid itself (`ResizableGridLayout`, below) now answers a drop
+      // anywhere over its own rendered rows via `isDroppable` โ€” this pair
+      // only still fires for the leftover space past its last row (the
+      // grid is exactly as tall as its content, and this element is not),
+      // where appending full-width at the end is still the right answer,
+      // the same one it always was.
+      //
+      // Every container is a drop target, not just the root: a nested
+      // section is exactly where an author means to put something when they
+      // drag it there, and the stop (in `onDrop`, below) is what makes the
+      // innermost container under the pointer the one that takes it rather
+      // than every ancestor claiming the same drop.
+      onDragOver={event => {
+        if (event.dataTransfer.types.includes(PALETTE_MIME)) {
+          event.preventDefault();
+          event.dataTransfer.dropEffect = 'copy';
+        }
+      }}
+      onDrop={event => {
+        const type = event.dataTransfer.getData(PALETTE_MIME);
+        if (type !== '') {
+          event.preventDefault();
+          event.stopPropagation();
+          placeBlock(nodeId, type);
+        }
+      }}

Review Comment:
   **Suggestion:** When a palette drop occurs over a non-accepting nested flow area, that area's `onDrop` intentionally does nothing, but the event continues bubbling to this fallback handler. The root then appends the block to itself even though the pointer was over a full nested container, making rejected drops silently land in the wrong container. Stop propagation for rejected nested drops or have the root fallback verify that the drop target is not an occupied/non-accepting container. [incorrect condition logic]
   
   <details>
   <summary><b>Severity Level:</b> Major โš ๏ธ</summary>
   
   ```mdx
   - โŒ Full collapsibles silently receive blocks in the root.
   - โš ๏ธ Users see placement differ from the drop location.
   - โš ๏ธ Single-child container behavior becomes misleading.
   ```
   </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=faae18b4cb644eee8fe7c677151d8197&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=faae18b4cb644eee8fe7c677151d8197&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/RootGrid.tsx
   **Line:** 427:434
   **Comment:**
   	*Incorrect Condition Logic: When a palette drop occurs over a non-accepting nested flow area, that area's `onDrop` intentionally does nothing, but the event continues bubbling to this fallback handler. The root then appends the block to itself even though the pointer was over a full nested container, making rejected drops silently land in the wrong container. Stop propagation for rejected nested drops or have the root fallback verify that the drop target is not an occupied/non-accepting container.
   
   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%2F43065&comment_hash=a671bdde76f17871c060dbb3d0bea5bb01d56f0e0054257878aa3563641afd85&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=a671bdde76f17871c060dbb3d0bea5bb01d56f0e0054257878aa3563641afd85&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset-frontend/src/core/dashboard/RootGrid.tsx:
##########
@@ -0,0 +1,544 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { useCallback } from 'react';
+import type { DragEvent as ReactDragEvent } from 'react';
+// The v1-compatible flat-props API (this component's own model: a plain
+// `cols`/`rowHeight`/`margin` grid, no responsive breakpoints โ€” see the
+// design doc's "Explicitly deferred" section) lives at this subpath in v2;
+// the package's main entry exports only the newer composable API.
+import GridLayoutLegacy, { WidthProvider } from 'react-grid-layout/legacy';
+import type { Layout, LayoutItem } from 'react-grid-layout/legacy';
+import 'react-grid-layout/css/styles.css';
+import type { dashboard as dashboardApi } from '@apache-superset/core';
+import { css, styled, useTheme } from '@apache-superset/core/theme';
+import { provider, useDashboardRevision } from './store';
+import { resolveGridMetrics } from './layoutStyle';
+import { availableDropSpan, packChildLayout } from './gridPacking';
+import { FALLBACK_ROW_SPAN, PALETTE_MIME, placeBlock, placeBlockAt } from './placement';
+import BuildingBlockView from './BuildingBlockView';
+
+type LayoutProps = dashboardApi.LayoutProps;
+
+const ResizableGridLayout = WidthProvider(GridLayoutLegacy);
+
+/** `react-grid-layout`'s own item id for the live drop preview โ€” see `handleDropDragOver`. Distinct from `DashboardProvider`'s own `node_<n>` ids by construction, so it can never collide with a real node while a drag is in progress. */
+const DROPPING_ITEM_ID = '__dropping-block__';
+
+/**
+ * Where a dragged or (via `isDroppable`, below) freshly dropped block is
+ * about to land โ€” the one on-screen answer to "where, exactly" for a
+ * gesture that otherwise only shows the cursor.
+ *
+ * `react-grid-layout/css/styles.css` (imported above) styles its
+ * `.react-grid-placeholder` red at 0.2 opacity by default โ€” a rectangle this
+ * restyles in the app's own primary colour instead, rather than editing the
+ * package's own stylesheet (not this codebase's to change, and gone on the
+ * next install). A descendant selector under this element's own generated
+ * class outweighs the plain two-class rule it is overriding, so this wins
+ * without needing `!important`.
+ *
+ * `react-grid-layout` renders the identical placeholder for a *resize* too,
+ * carrying its own extra `placeholder-resizing` class โ€” resizing an
+ * existing block already shows that block's own edges moving live under the
+ * pointer, so a second box drawn on top of it would only repeat what is
+ * already on screen. The extra class is what tells the two apart; the base
+ * rule is left for the drag/drop case this was actually added for.
+ */
+const GridSurface = styled.div`
+  ${({ theme }) => css`
+    width: 100%;
+    height: 100%;
+    overflow-x: hidden;
+    overflow-y: auto;
+
+    .react-grid-item.react-grid-placeholder {
+      background-color: ${theme.colorPrimaryBg};
+      border: 2px dashed ${theme.colorPrimary};
+      border-radius: ${theme.borderRadiusLG}px;
+      opacity: 1;
+
+      &.placeholder-resizing {
+        background: transparent;
+        border: none;
+        opacity: 0;
+      }
+    }
+  `}
+`;
+
+// DEBUG INSTRUMENTATION โ€” kept in place on purpose while the drag/resize
+// interaction is still being worked out; remove only when explicitly asked
+// to. Logs which node id/type a gesture actually started on (so it's
+// obvious, e.g., when a click lands on a nested container instead of the
+// chart the user meant to grab) and what RootGrid ends up committing at the end
+// of it.
+const DASHBOARD_DRAG_DEBUG = true;
+function debugLog(event: string, detail: Record<string, unknown>) {
+  if (!DASHBOARD_DRAG_DEBUG) return;
+  // eslint-disable-next-line no-console
+  console.debug(`[dashboard-drag] ${event}`, detail);
+}
+function describeNode(id: string | undefined) {
+  if (!id) return undefined;
+  const node = provider.getNode(id);
+  return { id, type: node?.type };
+}
+
+/**
+ * Finds the deepest dashboard container actually under a screen point,
+ * ignoring `excludeEl`'s own subtree โ€” the block being dragged might itself
+ * be, or contain, a container, and a drop "onto itself" isn't a valid
+ * reparent target. Every container's outer element carries
+ * `data-container-id` (this component's own does; others set it on whatever
+ * DOM they render a drop target from), so this is the one piece of
+ * cross-container awareness a drag needs: which container the pointer is
+ * over right now, at any nesting depth, without any container needing to
+ * know about any other container's existence.
+ *
+ * `excludeEl`'s `pointer-events` is toggled off for the single synchronous
+ * `elementFromPoint` call so the hit-test sees through the dragged element
+ * to whatever is actually underneath it on screen (otherwise the dragged
+ * element โ€” positioned directly under the cursor by definition โ€” would
+ * always be its own top hit).
+ */
+function findContainerIdAt(
+  clientX: number,
+  clientY: number,
+  excludeEl: HTMLElement,
+): string | null {
+  const previousPointerEvents = excludeEl.style.pointerEvents;
+  excludeEl.style.pointerEvents = 'none';
+  const hit = document.elementFromPoint(clientX, clientY);
+  excludeEl.style.pointerEvents = previousPointerEvents;
+  return (
+    hit?.closest<HTMLElement>('[data-container-id]')?.dataset.containerId ??
+    null
+  );
+}
+
+/**
+ * The dashboard's own grid โ€” not a Building Block (see the composition/
+ * layout design doc), which is why it lives here rather than in `blocks/`
+ * alongside the things that get placed on it. There is exactly one of these
+ * per dashboard, rendered for the root and only the root: `BuildingBlockView`
+ * resolves the root's renderer to this component directly, rather than
+ * through the `dashboard.buildingBlocks` registry every real building block
+ * goes through โ€” nothing places a `RootGrid`, and nothing ever will, the same
+ * way nothing places the dashboard itself.
+ *
+ * Backed by `react-grid-layout`. All position/size math โ€” including
+ * collision handling โ€” is `react-grid-layout`'s: resizing a block never
+ * shrinks a sibling, only displaces it to the next open slot (clamped to
+ * `minW`/`minH: 1`), which leaves every block's own authored (hand- or
+ * AI-set) span untouched. This component's job is translating between the
+ * stored `col`/`row`/`colSpan`/`rowSpan` schema (which allows a child to
+ * omit its position entirely, to be auto-placed) and `react-grid-layout`'s
+ * own `{x, y, w, h}` โ€” see `packChildLayout` for the auto-placement piece RGL
+ * has no concept of โ€” and committing back to the store only once a gesture
+ * ends (`onDragStop`/`onResizeStop`), never on every intermediate frame.
+ *
+ * Dragging a block into a *different* container (reparenting, as opposed to
+ * repositioning within this one) is handled by hit-testing which
+ * `data-container-id` is under the pointer when the drag ends โ€” deliberately
+ * not something `react-grid-layout` (scoped to one grid instance) handles on
+ * its own.
+ */
+export default function RootGrid({ nodeId }: { nodeId: string }) {
+  useDashboardRevision();
+  const theme = useTheme();
+  const node = provider.getNode(nodeId);
+
+  const commitLayout = useCallback(
+    (rglLayout: Layout) => {
+      const updates: Record<string, Partial<LayoutProps>> = {};
+      rglLayout.forEach(item => {
+        updates[item.i] = {
+          col: item.x + 1,
+          row: item.y + 1,
+          colSpan: item.w,
+          rowSpan: item.h,
+        };
+      });
+      debugLog('commitLayout', { containerId: nodeId, updates });
+      provider.updateLayouts(updates);
+    },
+    [nodeId],
+  );
+
+  const handleDragStart = useCallback(
+    (_layout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('dragStart', {
+        containerId: nodeId,
+        dragged: describeNode(newItem?.i),
+      });
+    },
+    [nodeId],
+  );
+
+  const handleResizeStart = useCallback(
+    (_layout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('resizeStart', {
+        containerId: nodeId,
+        resized: describeNode(newItem?.i),
+      });
+    },
+    [nodeId],
+  );
+
+  const handleResizeStop = useCallback(
+    (rglLayout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('resizeStop', {
+        containerId: nodeId,
+        resized: describeNode(newItem?.i),
+      });
+      commitLayout(rglLayout);
+    },
+    [nodeId, commitLayout],
+  );
+
+  const handleDragStop = useCallback(
+    (
+      rglLayout: Layout,
+      _oldItem: unknown,
+      newItem: { i: string } | null,
+      _placeholder: unknown,
+      event: Event,
+      element: HTMLElement | null,
+    ) => {
+      const { clientX, clientY } = event as MouseEvent;
+      const targetContainerId =
+        newItem && element && clientX != null && clientY != null
+          ? findContainerIdAt(clientX, clientY, element)
+          : null;
+
+      debugLog('dragStop', {
+        containerId: nodeId,
+        dragged: describeNode(newItem?.i),
+        targetContainerId,
+        reparenting: !!targetContainerId && targetContainerId !== nodeId,
+      });
+
+      if (targetContainerId && targetContainerId !== nodeId && newItem) {
+        try {
+          // moveBuildingBlock itself clears col/row and clamps colSpan to
+          // the destination's own column count โ€” old coordinates were only
+          // ever meaningful in *this* container's grid.
+          const destIndex =
+            provider.getNode(targetContainerId)?.children?.length ?? 0;
+          provider.moveBuildingBlock(newItem.i, targetContainerId, destIndex);
+          return;

Review Comment:
   **Suggestion:** Reparenting bypasses the destination container's `accepts` constraint. A collapsible flow area stops accepting palette drops once it has a child, but an existing root block dragged onto that same area is moved unconditionally here, allowing multiple children in a container intended to hold one. Check the destination capacity before calling `moveBuildingBlock`. [incomplete implementation]
   
   <details>
   <summary><b>Severity Level:</b> Major โš ๏ธ</summary>
   
   ```mdx
   - โŒ Collapsible containers can contain multiple children.
   - โš ๏ธ The UI's `accepts={false}` constraint is bypassed.
   - โš ๏ธ Rendering and future reparenting become inconsistent.
   ```
   </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=3e920651e8304b5cb11055322bb39b5e&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=3e920651e8304b5cb11055322bb39b5e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/RootGrid.tsx
   **Line:** 242:245
   **Comment:**
   	*Incomplete Implementation: Reparenting bypasses the destination container's `accepts` constraint. A collapsible flow area stops accepting palette drops once it has a child, but an existing root block dragged onto that same area is moved unconditionally here, allowing multiple children in a container intended to hold one. Check the destination capacity before calling `moveBuildingBlock`.
   
   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%2F43065&comment_hash=2291c91d593f014aaf23dae7b426afadbf2d768276635795b54175adaa31bd3d&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=2291c91d593f014aaf23dae7b426afadbf2d768276635795b54175adaa31bd3d&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset-frontend/src/core/dashboard/RootGrid.tsx:
##########
@@ -0,0 +1,544 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { useCallback } from 'react';
+import type { DragEvent as ReactDragEvent } from 'react';
+// The v1-compatible flat-props API (this component's own model: a plain
+// `cols`/`rowHeight`/`margin` grid, no responsive breakpoints โ€” see the
+// design doc's "Explicitly deferred" section) lives at this subpath in v2;
+// the package's main entry exports only the newer composable API.
+import GridLayoutLegacy, { WidthProvider } from 'react-grid-layout/legacy';
+import type { Layout, LayoutItem } from 'react-grid-layout/legacy';
+import 'react-grid-layout/css/styles.css';
+import type { dashboard as dashboardApi } from '@apache-superset/core';
+import { css, styled, useTheme } from '@apache-superset/core/theme';
+import { provider, useDashboardRevision } from './store';
+import { resolveGridMetrics } from './layoutStyle';
+import { availableDropSpan, packChildLayout } from './gridPacking';
+import { FALLBACK_ROW_SPAN, PALETTE_MIME, placeBlock, placeBlockAt } from './placement';
+import BuildingBlockView from './BuildingBlockView';
+
+type LayoutProps = dashboardApi.LayoutProps;
+
+const ResizableGridLayout = WidthProvider(GridLayoutLegacy);
+
+/** `react-grid-layout`'s own item id for the live drop preview โ€” see `handleDropDragOver`. Distinct from `DashboardProvider`'s own `node_<n>` ids by construction, so it can never collide with a real node while a drag is in progress. */
+const DROPPING_ITEM_ID = '__dropping-block__';
+
+/**
+ * Where a dragged or (via `isDroppable`, below) freshly dropped block is
+ * about to land โ€” the one on-screen answer to "where, exactly" for a
+ * gesture that otherwise only shows the cursor.
+ *
+ * `react-grid-layout/css/styles.css` (imported above) styles its
+ * `.react-grid-placeholder` red at 0.2 opacity by default โ€” a rectangle this
+ * restyles in the app's own primary colour instead, rather than editing the
+ * package's own stylesheet (not this codebase's to change, and gone on the
+ * next install). A descendant selector under this element's own generated
+ * class outweighs the plain two-class rule it is overriding, so this wins
+ * without needing `!important`.
+ *
+ * `react-grid-layout` renders the identical placeholder for a *resize* too,
+ * carrying its own extra `placeholder-resizing` class โ€” resizing an
+ * existing block already shows that block's own edges moving live under the
+ * pointer, so a second box drawn on top of it would only repeat what is
+ * already on screen. The extra class is what tells the two apart; the base
+ * rule is left for the drag/drop case this was actually added for.
+ */
+const GridSurface = styled.div`
+  ${({ theme }) => css`
+    width: 100%;
+    height: 100%;
+    overflow-x: hidden;
+    overflow-y: auto;
+
+    .react-grid-item.react-grid-placeholder {
+      background-color: ${theme.colorPrimaryBg};
+      border: 2px dashed ${theme.colorPrimary};
+      border-radius: ${theme.borderRadiusLG}px;
+      opacity: 1;
+
+      &.placeholder-resizing {
+        background: transparent;
+        border: none;
+        opacity: 0;
+      }
+    }
+  `}
+`;
+
+// DEBUG INSTRUMENTATION โ€” kept in place on purpose while the drag/resize
+// interaction is still being worked out; remove only when explicitly asked
+// to. Logs which node id/type a gesture actually started on (so it's
+// obvious, e.g., when a click lands on a nested container instead of the
+// chart the user meant to grab) and what RootGrid ends up committing at the end
+// of it.
+const DASHBOARD_DRAG_DEBUG = true;
+function debugLog(event: string, detail: Record<string, unknown>) {
+  if (!DASHBOARD_DRAG_DEBUG) return;
+  // eslint-disable-next-line no-console
+  console.debug(`[dashboard-drag] ${event}`, detail);
+}
+function describeNode(id: string | undefined) {
+  if (!id) return undefined;
+  const node = provider.getNode(id);
+  return { id, type: node?.type };
+}
+
+/**
+ * Finds the deepest dashboard container actually under a screen point,
+ * ignoring `excludeEl`'s own subtree โ€” the block being dragged might itself
+ * be, or contain, a container, and a drop "onto itself" isn't a valid
+ * reparent target. Every container's outer element carries
+ * `data-container-id` (this component's own does; others set it on whatever
+ * DOM they render a drop target from), so this is the one piece of
+ * cross-container awareness a drag needs: which container the pointer is
+ * over right now, at any nesting depth, without any container needing to
+ * know about any other container's existence.
+ *
+ * `excludeEl`'s `pointer-events` is toggled off for the single synchronous
+ * `elementFromPoint` call so the hit-test sees through the dragged element
+ * to whatever is actually underneath it on screen (otherwise the dragged
+ * element โ€” positioned directly under the cursor by definition โ€” would
+ * always be its own top hit).
+ */
+function findContainerIdAt(
+  clientX: number,
+  clientY: number,
+  excludeEl: HTMLElement,
+): string | null {
+  const previousPointerEvents = excludeEl.style.pointerEvents;
+  excludeEl.style.pointerEvents = 'none';
+  const hit = document.elementFromPoint(clientX, clientY);
+  excludeEl.style.pointerEvents = previousPointerEvents;
+  return (
+    hit?.closest<HTMLElement>('[data-container-id]')?.dataset.containerId ??
+    null
+  );
+}
+
+/**
+ * The dashboard's own grid โ€” not a Building Block (see the composition/
+ * layout design doc), which is why it lives here rather than in `blocks/`
+ * alongside the things that get placed on it. There is exactly one of these
+ * per dashboard, rendered for the root and only the root: `BuildingBlockView`
+ * resolves the root's renderer to this component directly, rather than
+ * through the `dashboard.buildingBlocks` registry every real building block
+ * goes through โ€” nothing places a `RootGrid`, and nothing ever will, the same
+ * way nothing places the dashboard itself.
+ *
+ * Backed by `react-grid-layout`. All position/size math โ€” including
+ * collision handling โ€” is `react-grid-layout`'s: resizing a block never
+ * shrinks a sibling, only displaces it to the next open slot (clamped to
+ * `minW`/`minH: 1`), which leaves every block's own authored (hand- or
+ * AI-set) span untouched. This component's job is translating between the
+ * stored `col`/`row`/`colSpan`/`rowSpan` schema (which allows a child to
+ * omit its position entirely, to be auto-placed) and `react-grid-layout`'s
+ * own `{x, y, w, h}` โ€” see `packChildLayout` for the auto-placement piece RGL
+ * has no concept of โ€” and committing back to the store only once a gesture
+ * ends (`onDragStop`/`onResizeStop`), never on every intermediate frame.
+ *
+ * Dragging a block into a *different* container (reparenting, as opposed to
+ * repositioning within this one) is handled by hit-testing which
+ * `data-container-id` is under the pointer when the drag ends โ€” deliberately
+ * not something `react-grid-layout` (scoped to one grid instance) handles on
+ * its own.
+ */
+export default function RootGrid({ nodeId }: { nodeId: string }) {
+  useDashboardRevision();
+  const theme = useTheme();
+  const node = provider.getNode(nodeId);
+
+  const commitLayout = useCallback(
+    (rglLayout: Layout) => {
+      const updates: Record<string, Partial<LayoutProps>> = {};
+      rglLayout.forEach(item => {
+        updates[item.i] = {
+          col: item.x + 1,
+          row: item.y + 1,
+          colSpan: item.w,
+          rowSpan: item.h,
+        };
+      });
+      debugLog('commitLayout', { containerId: nodeId, updates });
+      provider.updateLayouts(updates);
+    },
+    [nodeId],
+  );
+
+  const handleDragStart = useCallback(
+    (_layout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('dragStart', {
+        containerId: nodeId,
+        dragged: describeNode(newItem?.i),
+      });
+    },
+    [nodeId],
+  );
+
+  const handleResizeStart = useCallback(
+    (_layout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('resizeStart', {
+        containerId: nodeId,
+        resized: describeNode(newItem?.i),
+      });
+    },
+    [nodeId],
+  );
+
+  const handleResizeStop = useCallback(
+    (rglLayout: Layout, _oldItem: unknown, newItem: { i: string } | null) => {
+      debugLog('resizeStop', {
+        containerId: nodeId,
+        resized: describeNode(newItem?.i),
+      });
+      commitLayout(rglLayout);
+    },
+    [nodeId, commitLayout],
+  );
+
+  const handleDragStop = useCallback(
+    (
+      rglLayout: Layout,
+      _oldItem: unknown,
+      newItem: { i: string } | null,
+      _placeholder: unknown,
+      event: Event,
+      element: HTMLElement | null,
+    ) => {
+      const { clientX, clientY } = event as MouseEvent;
+      const targetContainerId =
+        newItem && element && clientX != null && clientY != null
+          ? findContainerIdAt(clientX, clientY, element)
+          : null;
+
+      debugLog('dragStop', {
+        containerId: nodeId,
+        dragged: describeNode(newItem?.i),
+        targetContainerId,
+        reparenting: !!targetContainerId && targetContainerId !== nodeId,
+      });
+
+      if (targetContainerId && targetContainerId !== nodeId && newItem) {
+        try {
+          // moveBuildingBlock itself clears col/row and clamps colSpan to
+          // the destination's own column count โ€” old coordinates were only
+          // ever meaningful in *this* container's grid.
+          const destIndex =
+            provider.getNode(targetContainerId)?.children?.length ?? 0;
+          provider.moveBuildingBlock(newItem.i, targetContainerId, destIndex);
+          return;
+        } catch {
+          // Dropped onto itself or one of its own descendants โ€” not a valid
+          // reparent target. Fall through and keep it in this container.
+        }
+      }
+
+      commitLayout(rglLayout);
+    },
+    [nodeId, commitLayout],
+  );
+
+  if (!node) return null;
+
+  const { columns, gap, rowUnitPx } = resolveGridMetrics(node.layout, theme);
+  const children = node.children ?? [];
+
+  const packed = packChildLayout(children, columns, provider.getNode);
+  const layout: Layout = children.map(id => ({
+    i: id,
+    minW: 1,
+    minH: 1,
+    ...packed[id],
+  }));
+
+  /**
+   * How wide a block being dragged in from the palette should preview at,
+   * for wherever the pointer currently is โ€” react-grid-layout's own
+   * `isDroppable` calls this on every dragover and merges the `w`/`h` it
+   * returns into the live placeholder, so this is the one place that decides
+   * "how much room is actually here" rather than the block always claiming
+   * a fixed span regardless of what it is being dropped next to.
+   *
+   * Not a palette drag at all (a file from the desktop, dragged text, โ€ฆ) is
+   * `false`: nothing else on the grid should react to it, and returning
+   * anything else would show a preview for a drop this grid never accepts
+   * in the first place.
+   *
+   * Hovering over a *nested* container (a `tabs`/`collapsible`/`carousel`
+   * block sitting on this grid, or anything a third party contributes) is
+   * `false` for the identical reason: that container has its own drop
+   * target (`FlowContent`/`EmptyArea`, tagged `data-container-id`, the same
+   * way this component's own `GridSurface` is) and is where the block
+   * actually belongs, not beside or on top of the container's own card on
+   * *this* grid. Without this, both react to the same hover โ€” this preview
+   * showing a push-down where the container sits, the container's own
+   * unaware that anything is above it โ€” and only one of them ever runs its
+   * cleanup on drop (`FlowContent`'s own `onDrop` stops the event there),
+   * leaving this one's placeholder on screen with nothing left to clear it.
+   *
+   * The width and height themselves are `availableDropSpan`'s own call (see
+   * `gridPacking.ts`) โ€” this only has to translate the cursor's pixel
+   * position into the grid cell underneath it, the same conversion
+   * `react-grid-layout` itself does internally to place every other item. A
+   * gap between two existing blocks that is already tall enough on its own
+   * is exactly where that matters: without shrinking to fit it, the preview
+   * would keep asking for its own full, unshrunk height regardless of how
+   * little of it the gap actually has room for, and collide its way into
+   * shoving the block below down to clear space that was never short to
+   * begin with.
+   *
+   * `dragOffsetX`/`dragOffsetY` correct for something react-grid-layout does
+   * on its own that reads wrong for this gesture: left uncorrected, it
+   * centers the preview *on* the cursor, so a block six rows tall starts
+   * three rows above wherever the pointer actually is. Dropped "just below"
+   * a row of blocks, that is enough to land back on top of them instead โ€”
+   * exactly what this offsets away, by feeding back half of whatever pixel
+   * size the preview is about to be (`react-grid-layout`'s own
+   * `calcGridItemWHPx` math, reproduced here since nothing shorter reaches
+   * it) so the centering it does and the anchoring this undoes cancel out,
+   * and the preview's top-left corner ends up *at* the cursor instead.
+   */
+  const handleDropDragOver = (
+    event: ReactDragEvent<HTMLDivElement>,
+  ): {
+    w?: number;
+    h?: number;
+    dragOffsetX?: number;
+    dragOffsetY?: number;
+  } | false => {
+    if (!event.dataTransfer.types.includes(PALETTE_MIME)) {
+      return false;
+    }
+
+    const hoveredContainerId = (
+      event.target as HTMLElement
+    ).closest<HTMLElement>('[data-container-id]')?.dataset.containerId;
+    if (hoveredContainerId && hoveredContainerId !== nodeId) {
+      return false;
+    }
+
+    const gridRect = event.currentTarget.getBoundingClientRect();
+    const colWidth = (gridRect.width - gap * (columns - 1)) / columns;
+    const colStride = colWidth + gap;
+    const rowStride = rowUnitPx + gap;
+    const cursorCol = Math.min(
+      columns - 1,
+      Math.max(0, Math.floor((event.clientX - gridRect.left) / colStride)),
+    );
+    const cursorRow = Math.max(
+      0,
+      Math.floor((event.clientY - gridRect.top) / rowStride),
+    );
+
+    const { w, h } = availableDropSpan(
+      packed,
+      columns,
+      cursorCol,
+      cursorRow,
+      FALLBACK_ROW_SPAN,
+    );
+    const pixelWidth = Math.round(colWidth * w + Math.max(0, w - 1) * gap);
+    const pixelHeight = Math.round(
+      rowUnitPx * h + Math.max(0, h - 1) * gap,
+    );
+
+    return {
+      w,
+      h,
+      dragOffsetX: pixelWidth / 2,
+      dragOffsetY: pixelHeight / 2,
+    };
+  };
+
+  /**
+   * Where a palette drag actually lands, once released โ€” the counterpart to
+   * `GridSurface`'s own plain `onDrop` (below, for a drop that missed the
+   * grid entirely, into the leftover space past its last row): this one
+   * fires when react-grid-layout's own `isDroppable` resolved a real x/y/w/h
+   * for the drop, live, during the drag itself (see `handleDropDragOver`),
+   * so there is no position left to compute here โ€” only a type to read off
+   * the browser's own drag data, and where among the existing children this
+   * new one's own row/col actually falls (see `placeBlockAt`'s own doc
+   * comment for why that has to be figured out here rather than left to
+   * default to "at the end").
+   */
+  const handleExternalDrop = (
+    _rglLayout: Layout,
+    item: LayoutItem | undefined,
+    event: Event,
+  ) => {
+    const type = (event as DragEvent).dataTransfer?.getData(PALETTE_MIME);
+    if (!type || !item) return;
+
+    const readingOrderIndex = children.findIndex(id => {
+      const rect = packed[id];
+      return rect.y > item.y || (rect.y === item.y && rect.x >= item.x);
+    });
+    const index =
+      readingOrderIndex === -1 ? children.length : readingOrderIndex;
+
+    debugLog('dropOnGrid', { containerId: nodeId, type, item, index });
+    placeBlockAt(nodeId, type, index, {
+      col: item.x + 1,
+      row: item.y + 1,
+      colSpan: item.w,
+      rowSpan: item.h,
+    });

Review Comment:
   **Suggestion:** The RGL external-drop handler does not stop propagation after calling `placeBlockAt`. The same browser drop then bubbles to `GridSurface`'s fallback `onDrop`, which calls `placeBlock` as well, causing every palette drop handled by RGL to create two blocks. Stop propagation in this handler or ensure the fallback ignores drops already handled by RGL. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major โš ๏ธ</summary>
   
   ```mdx
   - โŒ Palette drops on grid rows create duplicate blocks.
   - โš ๏ธ Dashboard layout gains unintended extra nodes.
   - โš ๏ธ Selection points only to the second created block.
   ```
   </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=c1c417171d424b1ca59fe5c0a071702d&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=c1c417171d424b1ca59fe5c0a071702d&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/RootGrid.tsx
   **Line:** 397:402
   **Comment:**
   	*Logic Error: The RGL external-drop handler does not stop propagation after calling `placeBlockAt`. The same browser drop then bubbles to `GridSurface`'s fallback `onDrop`, which calls `placeBlock` as well, causing every palette drop handled by RGL to create two blocks. Stop propagation in this handler or ensure the fallback ignores drops already handled by RGL.
   
   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%2F43065&comment_hash=6660de1236e5e13278e2bbc30ae1b2c00f9b57a99d302609e742cb61a5d2d46a&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=6660de1236e5e13278e2bbc30ae1b2c00f9b57a99d302609e742cb61a5d2d46a&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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] Initial container design [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43065:
URL: https://github.com/apache/superset/pull/43065#issuecomment-5255822546

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat: Initial design of containers [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #43065:
URL: https://github.com/apache/superset/pull/43065


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat: Initial design of containers [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #43065:
URL: https://github.com/apache/superset/pull/43065#discussion_r3759788045


##########
superset-frontend/src/core/dashboard/BuildingBlockView.tsx:
##########
@@ -66,16 +68,53 @@ const BlockHeader = styled.div`
     align-items: center;
     gap: ${theme.sizeUnit}px;
     height: ${theme.controlHeightSM}px;
-    /* Aligned with the inset every block's own content sits at, so a block's
-       name reads as the head of the box beneath it rather than as something
-       floating loose to its left. The right side stays tight: the remove
-       button is a square target of its own and centres its icon, which is the
-       inset it needs. */
-    padding-left: ${theme.padding}px;
-    padding-right: ${theme.sizeUnit}px;
+    flex: 0 0 auto;
   `}
 `;
 
+/**
+ * What the remove control (and a type's own extra header control, if it has
+ * one โ€” see `blockHeaderControl`) sit inside together, pushed to the end of
+ * the header as one group.
+ *
+ * Grouped rather than each carrying its own `margin-left: auto`: the two
+ * controls have to land beside each other with nothing but the header's own
+ * gap between them, which a shared wrapper gives for free and two
+ * independently-pushed elements would not (each would land flush against
+ * the header's own right edge, stacking on top of one another instead of
+ * sitting side by side). Pushed to the end whether or not a name is there
+ * to share the row with โ€” an unnamed type (see blockLabel's UNNAMED set)
+ * leaves nothing on the other side to grow and do this instead.
+ */
+const HeaderTrailingControls = styled.span`

Review Comment:
   Would make it sense to use Flex here instead of a span?



##########
superset-frontend/src/core/dashboard/BuildingBlockView.tsx:
##########
@@ -66,16 +68,53 @@ const BlockHeader = styled.div`
     align-items: center;
     gap: ${theme.sizeUnit}px;
     height: ${theme.controlHeightSM}px;
-    /* Aligned with the inset every block's own content sits at, so a block's
-       name reads as the head of the box beneath it rather than as something
-       floating loose to its left. The right side stays tight: the remove
-       button is a square target of its own and centres its icon, which is the
-       inset it needs. */
-    padding-left: ${theme.padding}px;
-    padding-right: ${theme.sizeUnit}px;
+    flex: 0 0 auto;
   `}
 `;
 
+/**
+ * What the remove control (and a type's own extra header control, if it has
+ * one โ€” see `blockHeaderControl`) sit inside together, pushed to the end of
+ * the header as one group.
+ *
+ * Grouped rather than each carrying its own `margin-left: auto`: the two
+ * controls have to land beside each other with nothing but the header's own
+ * gap between them, which a shared wrapper gives for free and two
+ * independently-pushed elements would not (each would land flush against
+ * the header's own right edge, stacking on top of one another instead of
+ * sitting side by side). Pushed to the end whether or not a name is there
+ * to share the row with โ€” an unnamed type (see blockLabel's UNNAMED set)
+ * leaves nothing on the other side to grow and do this instead.
+ */
+const HeaderTrailingControls = styled.span`
+  ${({ theme }) => css`
+    display: flex;
+    align-items: center;
+    gap: ${theme.sizeUnit}px;
+    flex: 0 0 auto;
+    margin-left: auto;
+  `}
+`;
+
+/**
+ * What a type's own extra header control (see `blockHeaderControl`) is
+ * wrapped in, and why โ€” the identical reasoning `RemoveSlot`, below, is
+ * wrapped for: the control itself is an `ActionButton` (or built from one)
+ * whose `onClick` carries no event, so the two gestures this sits inside are
+ * stopped here instead โ€” a press on it must act rather than select the
+ * block it is drawn on, and a pointer down on it must not start a
+ * react-grid-layout drag.
+ *
+ * `data-block-header-control` is the other half of that second one โ€”
+ * `RootGrid` names it in `draggableCancel`, and react-grid-layout matches
+ * the selector up the ancestors, so carrying it here covers the control
+ * inside.
+ */
+const HeaderControlSlot = styled.span`

Review Comment:
   Here as well:
   
   <Flex
     align="center"
     flex="0 0 auto"
   >
     ...
   </Flex>



##########
superset-frontend/src/core/dashboard/blocks/TabsBlock.tsx:
##########
@@ -0,0 +1,241 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { useLayoutEffect, useState } from 'react';
+import type { ReactElement } from 'react';
+import { t } from '@apache-superset/core/translation';
+import { css, styled } from '@apache-superset/core/theme';
+import { ActionButton } from '@superset-ui/core/components';
+import { Icons } from '@superset-ui/core/components/Icons';
+import { provider, useDashboardRevision } from '../store';
+import { FlowContent } from './flowContent';
+
+/**
+ * A pane's own child type โ€” not registered as a building block in its own
+ * right (see `registerBuiltInBuildingBlocks`), since nothing ever resolves
+ * one through `resolveBuildingBlockView`: this component renders a pane's
+ * `children` directly rather than rendering the pane node itself through
+ * `BuildingBlockView`. It only needs to be a *container* type (so
+ * `addBuildingBlock` gives it a `children` array) โ€” see
+ * `registerContainerType` in `DashboardProvider`.
+ */
+export const TAB_TYPE = 'tab';
+
+/**
+ * The negative margin is what keeps the tab bar full-width.
+ *
+ * `BuildingBlockView` now insets every block's content by the card's own
+ * padding (see its own comment) โ€” right for a chart or a table, which is a
+ * single thing filling the card, but wrong for a strip of tabs, which reads
+ * as cut short the moment it does not reach the card's edges the way a
+ * header would. `FlowContent` keeps its own inset (see its own comment) for
+ * the content flowed into a pane, which is the single-thing case the
+ * padding was written for; this cancels that same padding for the chrome
+ * around it โ€” on three sides only. The top is not the card's own padding to
+ * begin with:
+ * this box starts right where the header already ends, not at the card's
+ * true top edge, so cancelling it as well pulled the tab bar up past the
+ * header instead of just to the card's left/right/bottom edges, overlapping
+ * the two.
+ */
+const Root = styled.div`
+  ${({ theme }) => css`
+    display: flex;
+    flex-direction: column;
+    width: 100%;
+    height: 100%;
+    margin: 0 -${theme.padding}px -${theme.padding}px;
+  `}
+`;
+
+const TabBar = styled.div`
+  ${({ theme }) => css`
+    display: flex;
+    align-items: center;
+    gap: ${theme.sizeUnit}px;
+    flex: 0 0 auto;
+    padding: 0 ${theme.sizeUnit * 2}px;
+    border-bottom: 1px solid ${theme.colorBorderSecondary};
+    overflow-x: auto;
+  `}
+`;
+
+const TabButton = styled.button<{ $active: boolean }>`
+  ${({ theme, $active }) => css`
+    appearance: none;
+    border: none;
+    background: none;
+    flex: 0 0 auto;
+    padding: ${theme.sizeUnit * 2}px ${theme.sizeUnit * 3}px;
+    font-size: ${theme.fontSizeSM}px;
+    font-weight: ${$active ? theme.fontWeightStrong : theme.fontWeightNormal};
+    color: ${$active ? theme.colorPrimaryText : theme.colorTextSecondary};
+    border-bottom: 2px solid ${$active ? theme.colorPrimary : 'transparent'};
+    white-space: nowrap;
+    cursor: pointer;
+    transition:
+      color ${theme.motionDurationMid},
+      border-color ${theme.motionDurationMid};
+
+    &:hover {
+      color: ${theme.colorPrimaryText};
+    }
+
+    &:focus-visible {
+      outline: 2px solid ${theme.colorPrimaryBorder};
+      outline-offset: -2px;
+    }
+  `}
+`;
+
+/**
+ * A tab and its own remove control, as siblings rather than one nested
+ * inside the other.
+ *
+ * `TabButton` is a real `<button>` โ€” switching tabs is what most presses on
+ * it mean, and a button is what answers Enter/Space and reads as one to a
+ * screen reader. The remove control is `ActionButton`, itself a `<button>`,
+ * and a button inside a button is invalid HTML that nothing downstream can
+ * reliably navigate into. Wrapped here as two controls sharing a row
+ * instead, the same shape `BuildingBlockView`'s own header takes for a name
+ * and its own remove control.
+ */
+const TabItem = styled.span`

Review Comment:
   Here as well



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat: Initial design of containers [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43065:
URL: https://github.com/apache/superset/pull/43065#issuecomment-5256683633

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43065?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `47.59494%` with `207 lines` in your changes missing coverage. Please review.
   :warning: Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`dashboard-v2@116142e`). [Learn more](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit) about missing BASE report.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/43065?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset-frontend/src/core/dashboard/RootGrid.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2FRootGrid.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL1Jvb3RHcmlkLnRzeA==) | 29.29% | [70 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ontend/src/core/dashboard/blocks/CarouselBlock.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2Fblocks%2FCarouselBlock.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL2Jsb2Nrcy9DYXJvdXNlbEJsb2NrLnRzeA==) | 13.33% | [39 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...frontend/src/core/dashboard/blockHeaderControl.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2FblockHeaderControl.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL2Jsb2NrSGVhZGVyQ29udHJvbC50c3g=) | 15.62% | [27 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...uperset-frontend/src/core/dashboard/gridPacking.ts](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2FgridPacking.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL2dyaWRQYWNraW5nLnRz) | 0.00% | [24 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...frontend/src/core/dashboard/blocks/flowContent.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2Fblocks%2FflowContent.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL2Jsb2Nrcy9mbG93Q29udGVudC50c3g=) | 77.96% | [13 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...et-frontend/src/pages/DashboardBuilderV2/index.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fpages%2FDashboardBuilderV2%2Findex.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3BhZ2VzL0Rhc2hib2FyZEJ1aWxkZXJWMi9pbmRleC50c3g=) | 45.45% | [12 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...end/src/core/dashboard/blocks/CollapsibleBlock.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2Fblocks%2FCollapsibleBlock.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL2Jsb2Nrcy9Db2xsYXBzaWJsZUJsb2NrLnRzeA==) | 10.00% | [9 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...-frontend/src/core/dashboard/BuildingBlockView.tsx](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2FBuildingBlockView.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL0J1aWxkaW5nQmxvY2tWaWV3LnRzeA==) | 76.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset-frontend/src/core/dashboard/placement.ts](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2Fplacement.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL3BsYWNlbWVudC50cw==) | 71.42% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset-frontend/src/core/dashboard/blockLabel.ts](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fcore%2Fdashboard%2FblockLabel.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvcmUvZGFzaGJvYXJkL2Jsb2NrTGFiZWwudHM=) | 60.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | ... and [1 more](https://app.codecov.io/gh/apache/superset/pull/43065?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@               Coverage Diff               @@
   ##             dashboard-v2   #43065   +/-   ##
   ===============================================
     Coverage                ?   65.28%           
   ===============================================
     Files                   ?     2827           
     Lines                   ?   159018           
     Branches                ?    36437           
   ===============================================
     Hits                    ?   103822           
     Misses                  ?    53219           
     Partials                ?     1977           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/43065/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage ฮ” | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/43065/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.30% <47.59%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/43065?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] Initial container design [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #43065:
URL: https://github.com/apache/superset/pull/43065#discussion_r3759787096


##########
superset-frontend/src/core/dashboard/placement.ts:
##########
@@ -50,21 +94,68 @@ export const PALETTE_MIME = 'application/x-dashboard-building-block';
  * set before anything can go inside it. Selecting what was just placed is
  * what brings its properties forward: placing something is the moment you
  * want to configure it.
+ *
+ * `rowSpan` is only ever set here when `parentId` is the root's own grid โ€”
+ * everywhere else (a `tabs` pane, a `collapsible`, a `carousel` slide) it's
+ * left unset entirely, on purpose, so `FlowItem` (see `flowContent.tsx`)
+ * reads that as "no height chosen yet" and flexes the block to fill
+ * whatever room the container actually has, rather than a grid-row number
+ * misread as a pixel count.
  */
 export function placeBlock(parentId: string, type: string): string {
   const index = provider.getNode(parentId)?.children?.length ?? 0;
+  const onRootGrid = provider.getNode(parentId)?.type === GRID_TYPE;
+  const rowSpan = onRootGrid
+    ? DEFAULT_ROW_SPAN[type] ?? FALLBACK_ROW_SPAN
+    : undefined;
+  const id = provider.addBuildingBlock(parentId, index, {
+    type,
+    layout: isContainerType(type)
+      ? { columns: DEFAULT_COLUMNS, gap: 16, colSpan: DEFAULT_COLUMNS, rowSpan }
+      : { rowSpan },
+  });
+  provider.setSelection(id);
+  return id;
+}
+
+/**
+ * Places a new block of `type` at an explicit grid cell and an explicit
+ * spot in `parentId`'s own reading order, rather than appending it
+ * full-width at the end the way `placeBlock` does โ€” `RootGrid`'s own
+ * counterpart for a palette block dropped onto the root's grid, where
+ * *where* (and how wide, next to whatever it landed beside) was the entire
+ * point of the gesture.
+ *
+ * `position` arrives already resolved: react-grid-layout ran its own
+ * collision avoidance live, during the drag itself, the same as it does for
+ * repositioning an existing block (see `RootGrid`'s own `isDroppable`
+ * wiring) โ€” nothing here recomputes a position, only writes the one already
+ * shown as the drop's own preview.
+ *
+ * `index`, unlike `placeBlock`'s own implicit "at the end," is the caller's
+ * to get right: `DashboardProvider`'s own collision resolution (see
+ * `resolveExplicitCollisions`) settles a tie between two explicitly placed
+ * siblings by pushing down whichever comes *later* in `children` โ€” so a
+ * block dropped, say, between two existing rows has to land earlier in that
+ * order than the row it is displacing, or collision resolution reads it
+ * backwards and pushes the new block itself down past everything instead of
+ * making room for it where it was actually dropped. `RootGrid` is what
+ * already knows every sibling's own current position (it just packed them,
+ * to draw this render's preview in the first place), so it is the one that
+ * resolves reading order too, rather than this module re-deriving it from
+ * scratch here.
+ */
+export function placeBlockAt(
+  parentId: string,
+  type: string,
+  index: number,
+  position: { col: number; row: number; colSpan: number; rowSpan: number },
+): string {
   const id = provider.addBuildingBlock(parentId, index, {
     type,
-    ...(isContainerType(type)
-      ? {
-          layout: {
-            columns: DEFAULT_COLUMNS,
-            gap: 16,
-            colSpan: DEFAULT_COLUMNS,
-            rowSpan: 4,
-          },
-        }
-      : {}),
+    layout: isContainerType(type)
+      ? { columns: DEFAULT_COLUMNS, gap: 16, ...position }
+      : { ...position },

Review Comment:
   **Suggestion:** Palette drops use the preview's dynamically reduced `position.rowSpan` instead of the per-type default height. When a drop occurs in a gap that is only one row tall, `availableDropSpan` returns `h: 1`, so a newly dropped markdown, chart, or table is persisted at a one-row height and opens clipped, unlike the same block placed from the palette click path. Apply the appropriate default or minimum row span when committing the dropped block rather than blindly copying the preview height. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major โš ๏ธ</summary>
   
   ```mdx
   - โŒ Palette-dropped blocks can open at one-row height.
   - โš ๏ธ Markdown, chart, and table content may be clipped.
   - โš ๏ธ Drag placement differs from palette-click placement.
   ```
   </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=d328770695b2490ba9e29861690435c2&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=d328770695b2490ba9e29861690435c2&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/dashboard/placement.ts
   **Line:** 156:158
   **Comment:**
   	*Logic Error: Palette drops use the preview's dynamically reduced `position.rowSpan` instead of the per-type default height. When a drop occurs in a gap that is only one row tall, `availableDropSpan` returns `h: 1`, so a newly dropped markdown, chart, or table is persisted at a one-row height and opens clipped, unlike the same block placed from the palette click path. Apply the appropriate default or minimum row span when committing the dropped block rather than blindly copying the preview height.
   
   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%2F43065&comment_hash=9e973ea4c3fa30cd1c0a13a3ef603d2760006cb4f8b8f59a684258cac49a4f38&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43065&comment_hash=9e973ea4c3fa30cd1c0a13a3ef603d2760006cb4f8b8f59a684258cac49a4f38&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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] Initial container design [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43065:
URL: https://github.com/apache/superset/pull/43065#issuecomment-5255884812

   <!-- Bito Reply -->
   The flagged issue is correct. When a block is dropped into a gap, the system currently uses the preview's dynamically calculated `rowSpan`, which can be as small as 1, causing content clipping. To resolve this, you should enforce a minimum row span (e.g., a constant `MIN_BLOCK_HEIGHT`) when committing the dropped block, ensuring it always opens with sufficient height regardless of the available gap size.
   
   Regarding other comments on this PR, the provided context does not contain any additional review comments in `pr_comments.csv`. If you have more comments to address, please provide them, and I will be happy to validate and help implement fixes for 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org