refactor(app): split ServicesDashboardPage into smaller sibling files#2626
refactor(app): split ServicesDashboardPage into smaller sibling files#2626brandon-pereira wants to merge 2 commits into
Conversation
Pure file-move refactor with no behavior change. Breaks the 1,759-line ServicesDashboardPage.tsx monolith into a ServicesDashboardPage/ directory of smaller cohesive files (largest resulting file: 699 lines). An index.ts barrel re-exports the original public API (default page, EndpointLatencyChart, buildInFilterCondition) so all external consumers resolve unchanged.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
Greptile SummaryThis PR splits the services dashboard page into smaller sibling files. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "test(app): fix flaky dynamic mock in Ser..." | Re-trigger Greptile |
The mocked next/dynamic wrapper assigned the resolved component to a closure variable inside loader().then(), which never scheduled a React re-render — the tree could stay empty and the synchronous getByTestId assertion could flake. Hold the resolved component in state so its async arrival triggers a re-render, and await the shell via waitFor. Test-only change; no src behavior touched.
E2E Test Results✅ All tests passed • 235 passed • 3 skipped • 1515s
Tests ran across 4 shards in parallel. |
Deep ReviewScope: ✅ No critical issues found. The "pure file-move refactor" claim holds up under scrutiny. Correctness verified the move byte-for-byte block-by-block; the public export surface, 🔵 P3 nitpicks (3)
Reviewers (8): correctness, testing, maintainability, project-standards, kieran-typescript, api-contract, agent-native, learnings-researcher. (adversarial was dispatched but did not return before synthesis; its attack surface was independently covered.) Testing gaps:
|
Summary
ServicesDashboardPage.tsxhad grown to 1,759 lines in a single file — the page shell, three tab views, an endpoint latency chart, a service selector, and shared filter/query helpers all interleaved. This splits it into aServicesDashboardPage/directory of smaller, cohesive files so the tabs and helpers can be read and edited in isolation.This is a pure file-move refactor: no behavior, logic, JSX, or effects changed. Code was relocated verbatim and relative imports rewired.
Line count
ServicesDashboardPage.tsx(monolith)HttpTab.tsx)New structure
Drop-in barrel
index.tsre-exports exactly the original public API — the default page (withgetLayout),EndpointLatencyChart, andbuildInFilterCondition— so every external consumer keeps importing@/ServicesDashboardPageunchanged:pages/services.tsx(default export)components/ServiceDashboardEndpointSidePanel.tsx(EndpointLatencyChart)src/__tests__/ServicesDashboardPage.test.ts(buildInFilterCondition)Decisions
EndpointLatencyChartcolocated withHttpTabrather than its own file —HttpTabrenders it directly, so splitting them would introduce a cross-file cycle. The barrel still re-exports it for the side panel.@/absolute in the moved files (they now sit one level deeper); sibling imports within the directory use./.buildInFilterConditionunit test does not render the component, so a minimal "it mounts" test was added (heavy children/hooks stubbed). No per-sub-component tests.Verification
npx tsc --noEmit— cleanmake ci-lint— clean across all 5 projectsbuildInFilterCondition+ new smoke test)services-dashboard.spec.ts— 3 passed (page load, HTTP tab charts, Lucene filtering)Follow-ups (intentionally not done here)
useSource+useServiceDashboardExpressionswith identical args; could be lifted to a shared hook later (behavior-adjacent, out of scope for a pure move).as [Date, Date]assertion; a setter-naming warning) were carried over verbatim.