Repository navigation
fix(mfe): preserve pagination across unchanged host props - #259
harjotgill merged 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: Your plan provides up to 100 included reviews per hour; 86 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (2)
🔇 Additional comments (2)
📝 WalkthroughWalkthroughThe change makes Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The dashboard now retains child pagination across equivalent host rerenders while host filter and organization changes still take precedence. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
A rabbit hops where page numbers stay, Comment |
Summary
Preserve child pagination across unchanged host rerenders.
After #258 was deployed and verified with uncached shared chunks, the internal Major drilldown emitted page1 A/B requests (page size10, index1, offset10), immediately followed by page0 A/B requests (index0, offset0). The UI returned to page1 with the same10 rows/11,557 total. A separate stale HTML cache initially masked #258; this PR does not change asset caching.
Cause and fix
RenderFNDashboardassociated local history updates with the host query object by reference. Loading/result callbacks can recreate an unchanged stale host query object; the reference mismatch discarded local navigation and reset the real DashboardPage variable-refresh path.Compare host query values semantically at the two local-state selection sites, and synchronize shared history with effective query values. Real host filter/scope changes still supersede local navigation and clear the superseded snapshot so returning to an earlier scope cannot resurrect it. Existing ownership filtering, changed-variable-only merging, authoritative uid, immutable location snapshots, and unsubscribe behavior remain unchanged. No new state framework, global refresh, SQL/authentication changes, or external I/O.
Validation
createBrowserHistory, real portal/store/updateFnApp/DashboardPage behavior; covers stale host rerender, consecutive page1/page2, parent isolation, immutable inputs, no duplicate refresh on host echo, real filter/organization reset, and unsubscribe.Rollout / rollback
Based on merged #258 (
37934b809dc663c72a1f02e8baec27110bd268de). Normal review/CI first; no merge/deployment is authorized by this PR. After explicit release authorization, publish the Grafana base, verify derived regional digests/traffic and newly loaded changed shared chunks, then exercise child Next/Previous/page size, close/reopen and parent refresh overlap. Already-open/cached clients may retain older assets. Revert this commit to restore #258 behavior; no data migration.Agent handoff
public/app/fn-app/fn-dashboard-page/render-fn-dashboard.tsx,public/app/features/dashboard/containers/DashboardPageLoading.test.tsx./tmp/grafana-mfe-pagination-history,codex/grafana-pagination-browser-history.git status --short && git diff origin/coderabbit_micro_frontend...HEAD --stat.node node_modules/jest/bin/jest.js public/app/features/dashboard/containers/DashboardPageLoading.test.tsx public/app/fn-app/fn-dashboard-page/fn-dashboard.test.tsx public/app/fn-app/create-mfe.test.tsx --runInBand --watch=false --silent.Summary by CodeRabbit