Skip to content

refactor(app): extract server dialog owners#680

Merged
Astro-Han merged 4 commits into
devfrom
codex/dialog-select-server-owners
May 16, 2026
Merged

refactor(app): extract server dialog owners#680
Astro-Han merged 4 commits into
devfrom
codex/dialog-select-server-owners

Conversation

@Astro-Han
Copy link
Copy Markdown
Owner

@Astro-Han Astro-Han commented May 16, 2026

Summary

Extracts owner files from the oversized server selection dialog:

  • dialog-select-server-default.ts owns default-server and preview-status hooks
  • dialog-select-server-form.tsx owns the add/edit server form
  • dialog-select-server-list.tsx owns the server list row/menu rendering
  • dialog-select-server-source.test.ts locks the new source boundary

dialog-select-server.tsx drops from 649 LOC on dev to 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

  • Confirm this is a structure-only extraction with no server selection behavior changes.
  • Confirm DialogSelectServer still owns mutation/state flow while form/list/default helpers own their local UI/helper responsibilities.
  • Confirm the source-contract test protects the new owner boundary without replacing typecheck.

Topology

Touched Files

  • packages/app/src/components/dialog-select-server.tsx
  • 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

Risk 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

Install: completed with frozen lockfile
Command: bun install --frozen-lockfile

Focused app test: 2 passed
Command: bun test --preload ./happydom.ts src/components/dialog-select-server-source.test.ts

Typecheck: 8 successful, 8 total
Command: bun run typecheck

Diff check: no whitespace errors
Command: git diff --check && git diff --cached --check

File-size check: dialog-select-server.tsx 649 LOC on dev -> 412 LOC in this PR
Command: wc -l packages/app/src/components/dialog-select-server.tsx 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

Behavior e2e smoke: 1 passed
Command: bun --cwd packages/app script/e2e-local.ts -- e2e/app/home.spec.ts --grep "server picker dialog"

CI: required checks passed after rerunning perf-probe-baseline; the first perf run failed on tool-default-open-heavy-bash frame_gap_p95_ms and the rerun passed, so this was treated as perf noise.

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

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, primary area, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 47 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 01c3378f-c734-44b8-a751-47544a0311b0

📥 Commits

Reviewing files that changed from the base of the PR and between a696ede and 814847b.

📒 Files selected for processing (5)
  • 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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/dialog-select-server-owners

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 and usage tips.

@github-actions github-actions Bot added app Application behavior and product flows ui Design system and user interface labels May 16, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 16, 2026

Perf delta summary

Comparator: pass

Profile / Scenario interaction median interaction worst long task max tbt frame gap p95 frame gap max jank count cls status
default / homepage-cold 24 -> 24 (0) 48 -> 32 (-16) 75 -> 68 (-7) 25 -> 18 (-7) 16.8 -> 33.2 (+16.4) 133.4 -> 166.7 (+33.3) 3 -> 3 (0) 0 -> 0 (0) pass
default / long-session-input-lag 40 -> 48 (+8) 48 -> 56 (+8) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-streaming-long 40 -> 40 (0) 72 -> 56 (-16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 33.4 -> 33.4 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-call-expand 16 -> 16 (0) 16 -> 16 (0) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.8 (+0.1) 16.7 -> 16.8 (+0.1) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-default-open-heavy-bash 24 -> 32 (+8) 32 -> 32 (0) 64 -> 63 (-1) 14 -> 13 (-1) 50 -> 33.4 (-16.6) 116.7 -> 166.6 (+49.9) 2 -> 2 (0) 0 -> 0 (0) pass
default / terminal-side-panel-open 48 -> 48 (0) 56 -> 56 (0) 0 -> 0 (0) 0 -> 0 (0) 33.4 -> 33.4 (0) 33.4 -> 33.4 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-scroll-reading 32 -> 24 (-8) 40 -> 24 (-16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 16.8 -> 16.7 (-0.1) 0 -> 0 (0) 0.505 -> 0.505 (0) warn: cls

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/app/src/components/dialog-select-server-list.tsx Outdated
Comment thread packages/app/src/components/dialog-select-server-list.tsx Outdated
@Astro-Han Astro-Han merged commit deb8e29 into dev May 16, 2026
28 of 29 checks passed
@Astro-Han Astro-Han deleted the codex/dialog-select-server-owners branch May 16, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant