Skip to content

Extract routing hook and feedback subcomponents from agents-view#686

Merged
selfcontained merged 2 commits into
mainfrom
agt_8bb7fc68b087/job-componentizer-6449bd94
Jun 25, 2026
Merged

Extract routing hook and feedback subcomponents from agents-view#686
selfcontained merged 2 commits into
mainfrom
agt_8bb7fc68b087/job-componentizer-6449bd94

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Extracted use-agents-view-routing.ts hook from agents-view.tsx — encapsulates route matching, feedback detail state derivation, route validation effects, and navigation callbacks (closeFeedbackDetail, openFeedbackDetail, navigateFeedbackItem, onTabChange)
  • Extracted agents-view-feedback-detail.tsx with DesktopFeedbackDetail and MobileFeedbackDetail subcomponents, replacing inline IIFEs that handled review summary vs feedback item rendering
  • Net result: agents-view.tsx reduced from 904 → 774 lines (-130 lines, -14%)

New file structure

apps/web/src/
├── hooks/
│   └── use-agents-view-routing.ts    (118 lines) — NEW
├── components/app/
│   ├── agents-view.tsx               (774 lines) — was 904
│   └── agents-view-feedback-detail.tsx (85 lines) — NEW

What's next

Top backlog items for future runs:

  1. create-agent-dialog.tsx (761 lines) — extract form sections and validation hook
  2. feedback-panel.tsx (660 lines) — extract feedback item renderers
  3. media-sidebar.tsx (632 lines) — extract media item renderers and pin display

Test plan

  • pnpm run finalize:web — type check + production build passes
  • pnpm run test:e2e — 126/127 passed; 1 pre-existing flake (terminal-drag-drop unrelated to this change)

🤖 Generated with Claude Code

selfcontained and others added 2 commits June 25, 2026 02:09
Split agents-view.tsx (904 → 774 lines) by extracting:
- use-agents-view-routing.ts: route matching, feedback detail state
  derivation, route validation effects, and navigation callbacks
- agents-view-feedback-detail.tsx: DesktopFeedbackDetail and
  MobileFeedbackDetail subcomponents replacing inline IIFEs

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace the leaked mutable ref with handleFeedbackTransitionEnd
callback, keeping the stale-detail lifecycle fully encapsulated
inside useAgentsViewRouting.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit 254fb78 into main Jun 25, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_8bb7fc68b087/job-componentizer-6449bd94 branch June 25, 2026 08:19
selfcontained added a commit that referenced this pull request Jun 26, 2026
* Add GitHub Primer syntax highlighting to Changes tab diff viewer

- Map Refractor/Prism token classes to exact GitHub Dark and Light colors
- Fix horizontal scroll losing diff line backgrounds (table-layout: auto)
- Update gutter line numbers to use foreground color on add/delete lines
- Add file tree collapse toggle with show/hide buttons
- Add data-theme-mode attribute for simplified light/dark CSS targeting
- Set data-theme-mode in pre-paint script to prevent FOUC
- Fix sticky show-file-tree button overlapping file headers
- Increase touch target size on file tree toggle buttons
- Update design lab with real sample diff from PR #686

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Move show-file-tree button to non-scrolling toolbar strip

Render the "Show file tree" button in a fixed toolbar above the
scrollable diff area instead of inside it, so it remains visible
when the user scrolls through long diffs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Show full diff by default, don't hide whitespace changes

Remove hardcoded ignoreWhitespace: true from the diff route handlers.
The Changes tab now shows all changes including whitespace-only edits,
so users can trust it as a complete audit surface. The ignoreWhitespace
capability remains in agent-diff.ts for a future user-controlled toggle.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Restore ignoreWhitespace: true for Changes tab diffs

User wants whitespace changes hidden by default in the diff viewer.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
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