refactor(trial): split TryDiscovery.tsx into focused modules#771
Merged
simple-agent-manager[bot] merged 5 commits intomainfrom Apr 21, 2026
Merged
refactor(trial): split TryDiscovery.tsx into focused modules#771simple-agent-manager[bot] merged 5 commits intomainfrom
simple-agent-manager[bot] merged 5 commits intomainfrom
Conversation
Extract 910-line monolith into 6 focused files: - hooks/useTrialEvents.ts — SSE lifecycle hook - lib/trial-view-model.ts — deriveView, buildFeed, types - lib/trial-utils.ts — cleanActivityText, extractRepoName, eventDedupKey - components/trial/DiscoveryCards.tsx — all card components - components/trial/DiscoveryHeader.tsx — header + connection badge - pages/TryDiscovery.tsx — page shell (188 lines) Re-exports buildFeed and eventDedupKey from TryDiscovery.tsx for backward compatibility with existing tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
TryDiscovery.tsxmonolith into 6 focused moduleshooks/useTrialEvents.ts— SSE lifecycle hook (161 lines)lib/trial-view-model.ts— deriveView, buildFeed, types (168 lines)lib/trial-utils.ts— cleanActivityText, extractRepoName, eventDedupKey (47 lines)components/trial/DiscoveryCards.tsx— all card components (338 lines)components/trial/DiscoveryHeader.tsx— header + connection badge (111 lines)pages/TryDiscovery.tsx— page shell (188 lines, down from 910)Test plan
pnpm lint && pnpm typecheck && pnpm test && pnpm buildall greenAgent Preflight (Required)
Classification
External References
N/A: Pure refactor of existing code, no external APIs or libraries involved.
Codebase Impact Analysis
Affected:
apps/web/src/pages/TryDiscovery.tsx— split into 5 new modules underapps/web/src/hooks/,apps/web/src/lib/,apps/web/src/components/trial/. No other packages affected. Backward-compat re-exports preserve existing test imports.Documentation & Specs
N/A: No behavioral changes, no new features, no API changes.
Constitution & Risk Check
Principle XI (No Hardcoded Values): N/A — no new values introduced, existing configurable constants preserved in
trial-ui-config.ts.Rule 18 (File Size Limits): This PR directly addresses the rule — reduces TryDiscovery.tsx from 910 to 188 lines.
Specialist Review Evidence
Staging Verification
Skipped — pure refactor with zero behavioral changes. No new UI surfaces, no API changes, no backend changes. The 1906 passing tests confirm functional equivalence.
🤖 Generated with Claude Code