refactor(app): extract server dialog owners#680
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/components/dialog-select-server-default.ts, packages/app/src/components/dialog-select-server-form.tsx, packages/app/src/components/dialog-select-server-list.tsx, packages/app/src/components/dialog-select-server-source.test.ts, packages/app/src/components/dialog-select-server.tsx)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
Perf delta summaryComparator: pass
|
There was a problem hiding this comment.
Code Review
This pull request refactors the DialogSelectServer component by extracting its internal logic and UI elements into separate files: dialog-select-server-default.ts (hooks), dialog-select-server-form.tsx (form component), and dialog-select-server-list.tsx (list component). It also adds a unit test to verify the integrity of these extracted parts. Feedback was provided regarding the use of a canonical key function for the server list to ensure compatibility with non-HTTP connections, and a correction was suggested for a syntax error in a Tailwind class string along with a recommendation to use explicit theme token variables for design-system consistency.
Summary
Extracts owner files from the oversized server selection dialog:
dialog-select-server-default.tsowns default-server and preview-status hooksdialog-select-server-form.tsxowns the add/edit server formdialog-select-server-list.tsxowns the server list row/menu renderingdialog-select-server-source.test.tslocks the new source boundarydialog-select-server.tsxdrops from 649 LOC ondevto 412 LOC in this PR.Why
This is a #604 settings-lane frontend governance slice. The server dialog was a single mixed file with state flow, health preview, form UI, list UI, and default-server mutation logic. This PR keeps the state flow in the parent while moving form/list/helper owners into reviewable files.
Related Issue
Part of #604.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
DialogSelectServerstill owns mutation/state flow while form/list/default helpers own their local UI/helper responsibilities.Topology
devcodex/dialog-select-server-ownersTouched Files
packages/app/src/components/dialog-select-server.tsxpackages/app/src/components/dialog-select-server-default.tspackages/app/src/components/dialog-select-server-form.tsxpackages/app/src/components/dialog-select-server-list.tsxpackages/app/src/components/dialog-select-server-source.test.tsRisk Notes
Behavior should be unchanged. Risk is prop wiring between the parent dialog and the extracted form/list owners. No dependency, migration, credential, persistence format, or platform behavior changes are intended.
How To Verify
Screenshots or Recordings
Not captured. This PR is a structure-only extraction with no intended visual change; the server dialog row/form contracts are covered by source-contract test plus typecheck.
Checklist
dev, and my PR title and commit messages use Conventional Commits in English