Skip to content

refactor!: centralize fluent factories, shared UI helpers, payload hydration, formatting, and the reduced panel URL contract. - #44

Merged
terabytesoftw merged 3 commits into
mainfrom
feat/centralize-fluent-factories
Sep 8, 2026
Merged

refactor!: centralize fluent factories, shared UI helpers, payload hydration, formatting, and the reduced panel URL contract.#44
terabytesoftw merged 3 commits into
mainfrom
feat/centralize-fluent-factories

Conversation

@terabytesoftw

Copy link
Copy Markdown
Contributor

Pull Request

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bugfix (non-breaking change that fixes an issue)
  • CI/build configuration
  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional changes)

…dration, formatting, and the reduced panel URL contract.
@terabytesoftw terabytesoftw added the bug Something isn't working label Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 121 files, which is 21 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f8823b01-59db-4829-b66a-5dfa9d905139

📥 Commits

Reviewing files that changed from the base of the PR and between bb1f7c3 and 805504f.

📒 Files selected for processing (121)
  • .gitignore
  • CHANGELOG.md
  • README.md
  • docs/browser-quality.md
  • docs/ui-parity-baseline.md
  • package.json
  • resources/views/snapshot.php
  • src/Capture/CapturePolicy.php
  • src/Comparison/PanelComparison.php
  • src/Comparison/SnapshotComparison.php
  • src/Comparison/SummaryMetricComparison.php
  • src/Data/FilterPrefix.php
  • src/Data/PageSize.php
  • src/Data/QueryInput.php
  • src/Helper/Avatar.php
  • src/Helper/Badge.php
  • src/Helper/ExtensionPill.php
  • src/Helper/Format.php
  • src/Helper/SensitiveDataRedactor.php
  • src/Helper/Table.php
  • src/Panel/Asset/AssetCardRenderer.php
  • src/Panel/Asset/AssetSectionRenderer.php
  • src/Panel/Config/ConfigCardRenderer.php
  • src/Panel/Db/DbExplainRenderer.php
  • src/Panel/Db/DbQueryRenderer.php
  • src/Panel/Db/DbSnapshot.php
  • src/Panel/Db/NPlusOneFinding.php
  • src/Panel/Dump/DumpCardRenderer.php
  • src/Panel/Dump/DumpSnapshot.php
  • src/Panel/Event/EventCellRenderer.php
  • src/Panel/Event/EventSnapshot.php
  • src/Panel/Log/LogCellRenderer.php
  • src/Panel/Log/LogSnapshot.php
  • src/Panel/Mail/MailCardRenderer.php
  • src/Panel/Mail/MailSnapshot.php
  • src/Panel/PanelRenderContext.php
  • src/Panel/Profile/ProfileCellRenderer.php
  • src/Panel/Queue/QueueCardRenderer.php
  • src/Panel/Queue/QueueGridRenderer.php
  • src/Panel/Queue/QueuePill.php
  • src/Panel/Queue/QueueSnapshot.php
  • src/Panel/Request/RequestDiagnosticLedger.php
  • src/Panel/Request/RequestHeadersRenderer.php
  • src/Panel/Request/RequestRenderer.php
  • src/Panel/Request/RequestRoutesRenderer.php
  • src/Panel/Request/RequestSectionRenderer.php
  • src/Panel/Request/RequestServerRenderer.php
  • src/Panel/Request/RequestToolbarItemFactory.php
  • src/Panel/Request/Routing/RouteInventoryView.php
  • src/Panel/Router/CurrentRouteLogRow.php
  • src/Panel/Router/RouterSectionRenderer.php
  • src/Panel/Timeline/TimelineMemoryRenderer.php
  • src/Panel/User/UserDataNormalizer.php
  • src/Panel/User/UserRbacRow.php
  • src/Panel/Vite/ViteComponent.php
  • src/Panel/Vite/ViteSectionRenderer.php
  • src/PhpInfo/PhpInfoRenderer.php
  • src/Routing/DebugUrlGeneratorInterface.php
  • src/Storage/DebugArray.php
  • src/Storage/DebugValue.php
  • src/Storage/ExceptionSnapshot.php
  • src/Storage/Payload.php
  • src/Storage/RequestSummary.php
  • src/Storage/SnapshotStore.php
  • src/Toolbar/ToolbarData.php
  • src/Toolbar/ToolbarInjector.php
  • src/Toolbar/ToolbarItem.php
  • src/Toolbar/ToolbarPanel.php
  • src/View/History/HistoryCellRenderer.php
  • src/View/Sidebar/SidebarSnapshot.php
  • tests/Collector/CollectorCoordinatorTest.php
  • tests/Comparison/PanelComparisonTest.php
  • tests/Comparison/PayloadDifferenceTest.php
  • tests/Comparison/SnapshotComparisonTest.php
  • tests/Comparison/SummaryMetricComparisonTest.php
  • tests/Data/PageSizeTest.php
  • tests/Data/QueryInputTest.php
  • tests/Helper/AvatarTest.php
  • tests/Helper/BadgeTest.php
  • tests/Helper/ExtensionPillTest.php
  • tests/Helper/FormatTest.php
  • tests/Helper/TableTest.php
  • tests/Panel/Asset/AssetCardRendererTest.php
  • tests/Panel/Db/DbExplainRendererTest.php
  • tests/Panel/Db/DbQueryRendererTest.php
  • tests/Panel/Db/NPlusOneDetectorTest.php
  • tests/Panel/Event/EventMessageTest.php
  • tests/Panel/Inertia/InertiaMessageTest.php
  • tests/Panel/Log/LogMessageTest.php
  • tests/Panel/PanelMessageTest.php
  • tests/Panel/PanelRenderContextTest.php
  • tests/Panel/Profile/ProfileMessageTest.php
  • tests/Panel/Queue/QueueCardRendererTest.php
  • tests/Panel/Queue/QueueGridRendererTest.php
  • tests/Panel/Request/RequestDataNormalizerTest.php
  • tests/Panel/Request/RequestDiagnosticLedgerTest.php
  • tests/Panel/Request/RequestHeadersRendererTest.php
  • tests/Panel/Request/RequestRendererTest.php
  • tests/Panel/Request/RequestRoutingViewModelsTest.php
  • tests/Panel/Request/RouteDefinitionTest.php
  • tests/Panel/Vite/ViteSectionRendererTest.php
  • tests/Provider/PayloadDifferenceProvider.php
  • tests/Provider/ToolbarPanelProvider.php
  • tests/Storage/DebugSnapshotTest.php
  • tests/Storage/ManifestTest.php
  • tests/Storage/PayloadTest.php
  • tests/Storage/RequestSummaryTest.php
  • tests/Storage/SnapshotStoreTest.php
  • tests/Support/JobRecordFixture.php
  • tests/Support/MessageCatalogTestCase.php
  • tests/Support/RequestSummaryFixture.php
  • tests/Toolbar/ToolbarDataTest.php
  • tests/Toolbar/ToolbarInjectorTest.php
  • tests/Toolbar/ToolbarItemTest.php
  • tests/Toolbar/ToolbarPanelTest.php
  • tests/View/History/HistoryCellRendererTest.php
  • tests/View/History/HistoryRowTest.php
  • tests/View/History/HistoryScaleTest.php
  • tests/View/History/HistorySummaryTest.php
  • tests/View/Sidebar/SidebarSnapshotTest.php
  • tools/seed-debug-fixtures.php

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bb1f7c3) to head (805504f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff              @@
##               main       #44      +/-   ##
=============================================
+ Coverage     99.95%   100.00%   +0.04%     
+ Complexity     2191      2156      -35     
=============================================
  Files           164       171       +7     
  Lines          8694      8505     -189     
=============================================
- Hits           8690      8505     -185     
+ Misses            4         0       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical seeder failure and unresolved API, timestamp, provenance, and documentation issues must be addressed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Centralizes fluent factories, payload hydration, formatting, comparison models, and reusable UI helpers while narrowing URL and provenance contracts.

Changes:

  • Introduces shared rendering, formatting, hydration, comparison, and fixture utilities.
  • Migrates models and tests to fluent factories.
  • Reduces several routing, construction, and view-model APIs.

Review findings:

  • Critical (2 votes): RequestSummary’s private constructor breaks the fixture seeder and E2E setup; migrate the remaining direct construction.
  • Moderate (2 votes): Preserve route-inventory provenance so captured configuration is not labeled as live.
  • Moderate (1 vote): Correct negative fractional epoch formatting.
  • Moderate (1 vote): Mark private constructors as breaking and document factory migration.
  • Nit (2 votes): Update SnapshotComparison documentation to disclose retention of complete snapshots.
File summaries
File Description
tests/View/Sidebar/SidebarSnapshotTest.php Tests snapshot factory defaults.
tests/View/History/HistorySummaryTest.php Uses summary factories.
tests/View/History/HistoryScaleTest.php Uses shared summary fixtures.
tests/View/History/HistoryRowTest.php Uses shared summary fixtures.
tests/View/History/HistoryCellRendererTest.php Consolidates row fixtures.
tests/Toolbar/ToolbarPanelTest.php Tests fluent panel construction.
tests/Toolbar/ToolbarItemTest.php Tests fluent item construction.
tests/Toolbar/ToolbarInjectorTest.php Tests toolbar insertion.
tests/Toolbar/ToolbarDataTest.php Migrates toolbar fixtures.
tests/Support/RequestSummaryFixture.php Adds canonical summary fixtures.
tests/Support/MessageCatalogTestCase.php Shares message-catalog assertions.
tests/Support/JobRecordFixture.php Adds queue-record fixtures.
tests/Storage/SnapshotStoreTest.php Migrates summary setup.
tests/Storage/RequestSummaryTest.php Tests factory defaults and hydration.
tests/Storage/PayloadTest.php Tests list and nullable-boolean hydration.
tests/Storage/ManifestTest.php Migrates summary setup.
tests/Storage/DebugSnapshotTest.php Migrates summary setup.
tests/Provider/ToolbarPanelProvider.php Extracts toolbar test data.
tests/Provider/PayloadDifferenceProvider.php Extracts comparison cases.
tests/Panel/Vite/ViteSectionRendererTest.php Expands shared-table assertions.
tests/Panel/Request/RequestRoutingViewModelsTest.php Updates reduced provenance API tests.
tests/Panel/Request/RequestRendererTest.php Updates routing rendering expectations.
tests/Panel/Request/RequestHeadersRendererTest.php Verifies shared ledger classes.
tests/Panel/Request/RequestDiagnosticLedgerTest.php Tests the diagnostic ledger.
tests/Panel/Request/RequestDataNormalizerTest.php Uses shared summary fixtures.
tests/Panel/Profile/ProfileMessageTest.php Uses shared catalog assertions.
tests/Panel/PanelRenderContextTest.php Tests the reduced URL contract.
tests/Panel/PanelMessageTest.php Uses shared catalog assertions.
tests/Panel/Log/LogMessageTest.php Uses shared catalog assertions.
tests/Panel/Inertia/InertiaMessageTest.php Uses shared catalog assertions.
tests/Panel/Event/EventMessageTest.php Uses shared catalog assertions.
tests/Panel/Db/NPlusOneDetectorTest.php Removes an obsolete API assertion.
tests/Panel/Db/DbQueryRendererTest.php Tests EXPLAIN behavior through rendering.
tests/Panel/Db/DbExplainRendererTest.php Tests numeric table headings.
tests/Panel/Asset/AssetCardRendererTest.php Tests the simplified card API.
tests/Helper/TableTest.php Tests shared table rendering.
tests/Helper/FormatTest.php Tests centralized formatting; the negative epoch expectation must be corrected.
tests/Helper/ExtensionPillTest.php Tests extension pills.
tests/Helper/BadgeTest.php Tests shared badges.
tests/Helper/AvatarTest.php Tests monogram initials.
tests/Data/QueryInputTest.php Tests numeric lower bounds.
tests/Data/PageSizeTest.php Tests the selector facade.
tests/Comparison/SummaryMetricComparisonTest.php Tests metric difference detection.
tests/Comparison/SnapshotComparisonTest.php Tests aggregate comparisons and snapshot retention.
tests/Comparison/PayloadDifferenceTest.php Uses an external comparison provider.
tests/Comparison/PanelComparisonTest.php Tests difference totals.
tests/Collector/CollectorCoordinatorTest.php Migrates summary construction.
src/View/Sidebar/SidebarSnapshot.php Restricts construction to factories.
src/View/History/HistoryCellRenderer.php Uses shared duration formatting.
src/Toolbar/ToolbarPanel.php Makes construction factory-only.
src/Toolbar/ToolbarItem.php Makes construction factory-only.
src/Toolbar/ToolbarInjector.php Adds shared toolbar injection.
src/Toolbar/ToolbarData.php Trims redundant documentation.
src/Storage/SnapshotStore.php Extracts shared read and error handling.
src/Storage/RequestSummary.php Makes construction factory-only, but the fixture seeder still calls the private constructor.
src/Storage/Payload.php Adds list and nullable-boolean hydration.
src/Storage/ExceptionSnapshot.php Uses shared coercion and FQCN helpers.
src/Storage/DebugArray.php Trims redundant documentation.
src/Routing/DebugUrlGeneratorInterface.php Narrows URL generation to panels.
src/PhpInfo/PhpInfoRenderer.php Uses shared extension pills.
src/Panel/Vite/ViteSectionRenderer.php Uses shared badges and tables.
src/Panel/Vite/ViteComponent.php Uses shared payload hydration.
src/Panel/User/UserRbacRow.php Uses shared coercion.
src/Panel/User/UserDataNormalizer.php Uses avatar and time helpers.
src/Panel/Timeline/TimelineMemoryRenderer.php Extracts point tracing.
src/Panel/Router/RouterSectionRenderer.php Uses shared tables, badges, and rows.
src/Panel/Router/CurrentRouteLogRow.php Uses shared string coercion.
src/Panel/Request/Routing/RouteInventoryView.php Removes live-state tracking, losing required provenance.
src/Panel/Request/RequestToolbarItemFactory.php Uses fluent toolbar factories.
src/Panel/Request/RequestServerRenderer.php Uses the shared diagnostic ledger.
src/Panel/Request/RequestSectionRenderer.php Shares method and table rendering.
src/Panel/Request/RequestRoutesRenderer.php Uses shared UI helpers; its live-data warning must remain provenance-aware.
src/Panel/Request/RequestRenderer.php Reuses method-pill rendering.
src/Panel/Request/RequestHeadersRenderer.php Uses the shared diagnostic ledger.
src/Panel/Request/RequestDiagnosticLedger.php Adds a shared ledger builder.
src/Panel/Queue/QueueSnapshot.php Uses shared list hydration.
src/Panel/Queue/QueuePill.php Adds shared queue pills.
src/Panel/Queue/QueueGridRenderer.php Uses shared pills and formatting.
src/Panel/Queue/QueueCardRenderer.php Uses shared avatar and pill helpers.
src/Panel/Profile/ProfileCellRenderer.php Uses shared timestamp formatting.
src/Panel/PanelRenderContext.php Removes history and action URLs.
src/Panel/Mail/MailSnapshot.php Uses shared list hydration.
src/Panel/Mail/MailCardRenderer.php Uses shared avatar and time helpers.
src/Panel/Log/LogSnapshot.php Uses shared list hydration.
src/Panel/Log/LogCellRenderer.php Uses shared timestamp formatting.
src/Panel/Event/EventSnapshot.php Uses shared list hydration.
src/Panel/Event/EventCellRenderer.php Uses shared badge and time helpers.
src/Panel/Dump/DumpSnapshot.php Uses shared list hydration.
src/Panel/Dump/DumpCardRenderer.php Uses shared timestamp formatting.
src/Panel/Db/NPlusOneFinding.php Removes an unused membership API.
src/Panel/Db/DbSnapshot.php Uses shared list hydration.
src/Panel/Db/DbQueryRenderer.php Centralizes formatting and internalizes EXPLAIN detection.
src/Panel/Db/DbExplainRenderer.php Uses shared table rendering.
src/Panel/Config/ConfigCardRenderer.php Uses shared extension pills.
src/Panel/Asset/AssetSectionRenderer.php Uses the reduced card API.
src/Panel/Asset/AssetCardRenderer.php Derives dependency anchors locally.
src/Helper/Table.php Adds shared table construction.
src/Helper/SensitiveDataRedactor.php Exposes pattern resolution.
src/Helper/Format.php Adds shared formatting, but mishandles negative fractional epochs.
src/Helper/ExtensionPill.php Adds an extension-pill helper.
src/Helper/Badge.php Adds a shared badge helper.
src/Helper/Avatar.php Adds monogram generation.
src/Data/QueryInput.php Adds minimum-bound parsing.
src/Data/PageSize.php Makes the low-level selector renderer private.
src/Data/FilterPrefix.php Documents filter constants.
src/Comparison/SummaryMetricComparison.php Adds a difference predicate.
src/Comparison/SnapshotComparison.php Aggregates comparisons; documentation must disclose complete snapshot retention.
src/Comparison/PanelComparison.php Adds difference totals.
src/Capture/CapturePolicy.php Centralizes redaction-pattern resolution.
resources/views/snapshot.php Extracts danger-callout construction.
README.md Documents revised contracts, but must identify private constructors as breaking and explain factory migration.
package.json Removes Markdown formatting targets.
docs/browser-quality.md Removes browser workflow documentation.
CHANGELOG.md Records the refactor.
.gitignore Ignores internal documentation.
Review details
  • Files reviewed: 118/119 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Storage/RequestSummary.php
Comment thread README.md
Comment thread src/Helper/Format.php Outdated
Comment thread src/Panel/Request/RequestRoutesRenderer.php Outdated
Comment thread src/Comparison/SnapshotComparison.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Broad breaking API changes require human review, and the formatting tests remain timezone-dependent.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

tests/Helper/FormatTest.php:125

  • These expectations hard-code UTC even though Format::timeOfDay() intentionally delegates the date portion to PHP's current default timezone. On a non-UTC developer machine this method (and the custom-format/negative-timestamp tests below) fails—for example, this timestamp renders as 17:13:20.123 in America/New_York. Derive the date portion with date() as the existing renderer tests do, or temporarily set and restore UTC within these tests.

README.md:28

  • The architecture section now says both that Debug Core “does not … inject toolbar markup” (line 22) and that its new ToolbarInjector places markup before </body>. Clarify the boundary by saying Core does not decide when injection occurs; adapters retain that lifecycle decision while using the Core helper.
(summary metrics and panel payloads) for the history comparison pages, and `PHPForge\Debug\Toolbar\ToolbarInjector`
places the rendered toolbar before `</body>`. Adapters provide a
  • Files reviewed: 119/120 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@terabytesoftw
terabytesoftw requested a balanced review from Copilot September 8, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@terabytesoftw
terabytesoftw merged commit fc20395 into main Sep 8, 2026
43 checks passed
@terabytesoftw
terabytesoftw deleted the feat/centralize-fluent-factories branch September 8, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants