Skip to content

[DO NOT MERGE] fix: prevent widget drawer from auto-opening, fix dashboard rename updating UI#346

Open
OlhaTmlk wants to merge 5 commits into
RedHatInsights:masterfrom
OlhaTmlk:hide-widgets
Open

[DO NOT MERGE] fix: prevent widget drawer from auto-opening, fix dashboard rename updating UI#346
OlhaTmlk wants to merge 5 commits into
RedHatInsights:masterfrom
OlhaTmlk:hide-widgets

Conversation

@OlhaTmlk

@OlhaTmlk OlhaTmlk commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix widget drawer auto-opening during initial dashboard load — the empty state was triggering the drawer before data finished loading, causing a flash of the drawer on dashboards that have widgets
  • Fix dashboard rename not reflecting in the UI — GenericDashboardPage now uses its own Jotai Provider with the shared store and initializes the backend feature flag, and the rename API return value parsing is corrected
  • Improve e2e test stability — use exact: true for link name matching and add explicit waits to avoid flaky assertions

RHCLOUD47876

Changes

Widget drawer auto-open fix (GridLayout.tsx)

  • LayoutEmptyState now accepts an isLoaded prop and only opens the drawer after the template has finished loading
  • Prevents the drawer from briefly appearing while the dashboard is still fetching data

Dashboard rename fix

  • GenericDashboardPage wrapped with a Jotai Provider using the shared store so atoms resolve correctly
  • Backend feature flag (platform.widget-layout.new-backend) is now initialized on the generic dashboard page
  • Fixed renameDashboardTemplate to return json instead of json.data to match the actual API response shape

E2e tests

  • Added tests verifying the drawer does not auto-open on page load and does auto-open for empty dashboards
  • Used exact: true in link selectors to prevent partial name matches causing wrong navigation
  • Added explicit waitFor before assertions that depend on navigation completing

@OlhaTmlk

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@OlhaTmlk OlhaTmlk changed the title Fix: prevent widget drawer from auto-opening, fix dashboard rename updating UI fix: prevent widget drawer from auto-opening, fix dashboard rename updating UI Jun 15, 2026
@OlhaTmlk OlhaTmlk marked this pull request as ready for review June 15, 2026 10:08
@OlhaTmlk OlhaTmlk requested a review from a team as a code owner June 15, 2026 10:08
@OlhaTmlk

Copy link
Copy Markdown
Contributor Author

/retest

@justinorringer justinorringer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just one question.

Comment thread src/Components/DnDLayout/GridLayout.tsx Outdated
useEffect(() => {
setDrawerExpanded(true);
}, []);
if (isLoaded) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this condition needed? Is there a better place to maintain this state than a deep child component?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, moved the auto-open logic up to GridLayout. Now it's handled in the useEffect for initial load and in handleTemplateChange when the last widget is removed

@OlhaTmlk OlhaTmlk requested a review from justinorringer June 22, 2026 07:12

@justinorringer justinorringer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🥳 Sign the commits and we are good to go

@OlhaTmlk

Copy link
Copy Markdown
Contributor Author

/retest

@OlhaTmlk

Copy link
Copy Markdown
Contributor Author

/retest

@OlhaTmlk OlhaTmlk force-pushed the hide-widgets branch 3 times, most recently from 05d2267 to be1b15f Compare June 29, 2026 12:11
@OlhaTmlk OlhaTmlk force-pushed the hide-widgets branch 3 times, most recently from 09d84f9 to 6378061 Compare June 30, 2026 11:24
@OlhaTmlk

Copy link
Copy Markdown
Contributor Author

/retest

@OlhaTmlk OlhaTmlk force-pushed the hide-widgets branch 2 times, most recently from 80a2952 to c578d74 Compare July 1, 2026 11:11
@OlhaTmlk

OlhaTmlk commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@OlhaTmlk

OlhaTmlk commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@red-hat-konflux

Copy link
Copy Markdown
Contributor

All PipelineRuns for this commit have already succeeded. Use /retest <pipeline-name> to re-run a specific pipeline or /test to re-run all pipelines.

@OlhaTmlk

OlhaTmlk commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/test

@OlhaTmlk OlhaTmlk force-pushed the hide-widgets branch 3 times, most recently from 51b533d to 4dd4238 Compare July 1, 2026 12:46
@OlhaTmlk OlhaTmlk changed the title fix: prevent widget drawer from auto-opening, fix dashboard rename updating UI [DO NOT MERGE] fix: prevent widget drawer from auto-opening, fix dashboard rename updating UI Jul 1, 2026
@OlhaTmlk

OlhaTmlk commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

PR is currently being debugged. DO NOT MERGE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants