Skip to content

fix(mfe): bind toolbar refresh to its dashboard owner - #269

Closed
harjotgill wants to merge 1 commit into
coderabbit_micro_frontendfrom
codex/mfe-toolbar-refresh
Closed

harjotgill wants to merge 1 commit into
coderabbit_micro_frontendfrom
codex/mfe-toolbar-refresh

Conversation

@harjotgill

@harjotgill harjotgill commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

Bind embedded dashboard toolbar refresh to the toolbar's own model and MFE store. Keep standalone Grafana refresh unchanged. Restore the previous store owner immediately after synchronous thunk dispatch, including failures, rather than holding global ownership across asynchronous work.

Evidence and scope

Internal Knowledge Base acceptance observed a refresh click without a loading transition or Handler query requests in the subsequent bounded window. Source inspection found the toolbar delegates to the global TimeSrv model, unlike the already owner-bound host refresh path. A regression test fails on the previous implementation because the toolbar owner is never called. This fixes that ownership defect; production causality and successful warm refresh still require post-deploy verification. No SQL, authorization, tenant scope, credentials, timeouts, or reader flags change.

Validation

  • 29 tests passed across DashNavTimeControls, create-mfe, and fn-dashboard suites.
  • Covers embedded owner selection, immediate restoration before async completion, synchronous failure, rejected completion propagation, and unchanged standalone behavior.
  • Scoped ESLint and Prettier checks passed; git diff --check passed.
  • Unrelated generated microfrontend HTML excluded.

Rollout / handoff

Normal review and CI required; no admin merge. Grafana deployment is authorized by the user. After deployment verify exact US/EU revisions, refresh each mounted dashboard, confirm new requests and updated panels, then record separate warm-refresh and full-page timings. Keep existing writers and tenant isolation unchanged. This PR does not claim overall migration acceptance.

Agent continuation: existing Grafana checkout, branch codex/mfe-toolbar-refresh; primary mono worktree e548 is preserved. Existing acceptance evidence is in /tmp/metrics-production-acceptance-20260926-2041.md on the task host.

Summary by CodeRabbit

  • Bug Fixes
    • Refreshing an embedded dashboard now updates that dashboard’s time range without affecting other dashboards’ rendering state.
    • Refresh state is restored whether the update succeeds or fails, and standalone dashboard refresh behavior remains unchanged.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7f12afda-d367-4e36-8cba-845a099ab10a

📥 Commits

Reviewing files that changed from the base of the PR and between 96a06f3 and 3cbca06.

📒 Files selected for processing (2)
  • public/app/features/dashboard/components/DashNav/DashNavTimeControls.test.tsx
  • public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx
 __________________________________________________________________
< Ah yes, the classic pattern: 'parse first, ask questions never'. >
 ------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@harjotgill

Copy link
Copy Markdown
Author

Acceptance update: follow-up browser testing showed click-target displacement (Username activated Repository Name; screenshot refresh coordinates activated Zoom out). The earlier absence of refresh requests is therefore not valid production reproduction evidence. The unit-tested ownership edge case remains, but do not treat this PR as a confirmed production no-op fix. No auto-merge requested; verifying keyboard-triggered refresh on the existing deployment before deciding whether to proceed.

@harjotgill

Copy link
Copy Markdown
Author

Closing this PR from the migration critical path: keyboard activation of the exact Refresh dashboard control succeeds on the existing deployment. At 22:51:39.893 UTC it refreshed the username variable and then the visible panels; six Handler query requests returned 200 in the bounded window. Earlier click-based no-op observations were caused by displaced browser automation targets, not a reproduced production refresh defect. The proposed owner-binding edge-case tests pass, but there is no demonstrated need to ship this extra patch for migration acceptance. Keeping the branch recoverable; no merge or deployment.

@harjotgill harjotgill closed this Sep 26, 2026
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.

1 participant