From 6a6f167bfd56ebf4265e99f547a56f6b4c9d6539 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Tue, 30 Jun 2026 15:50:53 +0800 Subject: [PATCH] fix: keep widget-dashboard story settings drawer on-screen in Storybook --- ...fix-widget-dashboard-story-settings-drawer | 4 ++ .../stories/widget-dashboard-with-widget.tsx | 42 ++++++++++++------- 2 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 projects/packages/premium-analytics/changelog/fix-widget-dashboard-story-settings-drawer diff --git a/projects/packages/premium-analytics/changelog/fix-widget-dashboard-story-settings-drawer b/projects/packages/premium-analytics/changelog/fix-widget-dashboard-story-settings-drawer new file mode 100644 index 000000000000..2f4ce4886c14 --- /dev/null +++ b/projects/packages/premium-analytics/changelog/fix-widget-dashboard-story-settings-drawer @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Keep the widget-dashboard Storybook story's settings drawer on-screen when the dashboard is wider than the preview canvas. diff --git a/projects/packages/premium-analytics/widgets/stories/widget-dashboard-with-widget.tsx b/projects/packages/premium-analytics/widgets/stories/widget-dashboard-with-widget.tsx index 45e7a117f00e..307d5c6d5f04 100644 --- a/projects/packages/premium-analytics/widgets/stories/widget-dashboard-with-widget.tsx +++ b/projects/packages/premium-analytics/widgets/stories/widget-dashboard-with-widget.tsx @@ -171,21 +171,33 @@ export function WidgetDashboardWithWidget( { return ( -
- - } hasPadding> - - - - + { /* + * Outer box fills the canvas and owns horizontal overflow; the inner + * box holds the simulated `dashboardWidth`. The host widget-settings + * drawer is portaled to and positioned `fixed; right: 0`, so a + * body wider than the visible canvas (which a fixed `dashboardWidth` + * wider than the Storybook preview would cause) pushes the drawer + * off-screen. Containing the overflow here keeps the document at canvas + * width so the drawer stays anchored to the visible viewport edge; the + * wide layout remains inspectable by scrolling the box. + */ } +
+
+ + } hasPadding> + + + + +