Repository navigation
Split CDP bridge responsibilities - #17215
Conversation
Greptile SummaryThe PR decomposes the CDP bridge into focused modules while retaining
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/browser/cdp-bridge.ts | Reduces the original implementation to a facade delegating browser operations to the new command modules. |
| src/main/browser/cdp-bridge-state.ts | Owns shared active-tab access, tab state, reference invalidation, and per-tab command queue processing. |
| src/main/browser/cdp-bridge-command-set.ts | Constructs the shared lifecycle and resolution dependencies and exposes the focused command modules. |
| src/main/browser/cdp-debugger-lifecycle.ts | Extracts debugger attachment, sender creation, listener registration, and teardown responsibilities. |
| src/main/browser/cdp-ref-resolution.ts | Extracts snapshot-reference resolution, iframe routing, scrolling, and coordinate translation. |
| src/main/browser/cdp-page-commands.ts | Contains page-level navigation, capture, scrolling, waiting, and evaluation commands. |
| src/main/browser/cdp-tab-commands.ts | Contains active-tab selection, metadata lookup, listing, switching, and tab lifecycle handling. |
| config/max-lines-baseline.txt | Removes the CDP bridge exemption after the facade falls below the configured line limit. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class CdpBridge
class CdpBridgeState
class CdpBridgeCommandSet
class CdpDebuggerLifecycle
class CdpNavigationOperations
class CdpRefResolution
class CdpPageCommands
class CdpPointerCommands
class CdpElementStateCommands
class CdpTextInputCommands
class CdpTabCommands
CdpBridge --> CdpBridgeState
CdpBridge --> CdpBridgeCommandSet
CdpBridgeCommandSet --> CdpDebuggerLifecycle
CdpBridgeCommandSet --> CdpNavigationOperations
CdpBridgeCommandSet --> CdpRefResolution
CdpBridgeCommandSet --> CdpPageCommands
CdpBridgeCommandSet --> CdpPointerCommands
CdpBridgeCommandSet --> CdpElementStateCommands
CdpBridgeCommandSet --> CdpTextInputCommands
CdpBridgeCommandSet --> CdpTabCommands
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
…om-3-mobile-browser
…-bottom-4-prune-resolved
…-bottom-5-pane-tree-ops
…bottom-6-mobile-troubleshoot
…lines-bottom-7-external-manager
…es-bottom-8-attach-services
…s-bottom-9-hosted-review-creation
…ax-lines-bottom-10-automation-dispatch-events
… ra/max-lines-bottom-11-settings-navigation
…-lines-bottom-12-daemon-init
…ottom-13-gitlab-item-dialog
…lines-bottom-14-relay-dispatcher
…nes-bottom-15-mobile-host-screen
…lines-bottom-16-runtime-file-client
…-lines-bottom-17-ports-panel
…ottom-18-runtime-environments-pane
…ra/max-lines-bottom-19-local-pty-provider
…lines-bottom-20-cdp-bridge # Conflicts: # src/main/browser/cdp-bridge.ts
…0-cdp-bridge # Conflicts: # src/renderer/src/hooks/automation-dispatch-completion.ts
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThe CDP bridge now delegates browser automation to dedicated state, lifecycle, navigation, reference, page, tab, pointer, element, and text command modules. Shared state manages active tabs, per-tab records, reference invalidation, and FIFO command queues. Debugger lifecycle and event handling were extracted into separate modules. Page and interaction commands retain CDP operations through shared services. ✨ Finishing Touches📝 Generate docstrings
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 |
* Split speech session lifecycle * Split terminal output scheduler pipeline * Split mobile browser pane modules * Prune resolved max-lines suppressions * Split pane tree equalization logic * Extract mobile troubleshoot screen styles * Split external automation manager * Split main window service attachments * Split hosted review creation checks * Split automation dispatch event handling * Split settings navigation metadata * Split daemon initialization lifecycle * Split GitLab item dialog * Split relay dispatcher layers * Split mobile host screen * Retarget mobile view settings source test * Split runtime file client layers * Split ports panel layers * Split runtime environments pane layers * Split local PTY provider responsibilities * Split CDP bridge responsibilities * Fix F3-speech for stablyai#17123 * Fix F1-cycle for stablyai#17131 * Fix F4-navtest for stablyai#17157 * Fix F2-allowlist for stablyai#17161
Summary
cdp-bridge.tsfrom 1,611 lines to a 277-line facadegetRegisteredTabs()hookValidation
pnpm tcpnpm tc:nodepnpm run check:code-quality:changed— zero new findingspnpm check:max-lines-ratchet— 66 entriespnpm run check:runtime-electron-ratchetgit diff --checkStacked on #17206.