From bb6e5d47dacc05eb501e992a9805cd2a2a15e9c3 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 4 Nov 2026 01:25:01 -0800 Subject: [PATCH] refactor: group right sidebar plugin panel owners (#38095) --- config/scripts/ci-shard-timings.json | 20 +++++++++---------- config/scripts/pr-plugin-e2e-routing.test.mjs | 7 +++++-- .../scripts/pr-plugin-e2e-source-routes.mjs | 8 ++++---- .../editor/PluginCustomEditorFrame.tsx | 8 ++++---- .../plugin-custom-editor-frame-events.ts | 2 +- .../editor/plugin-custom-editor-host-types.ts | 4 ++-- .../editor/plugin-custom-editor-host.test.ts | 4 ++-- .../editor/use-custom-editor-reload-flush.ts | 2 +- .../frames}/plugin-frame-element.tsx | 7 ++++--- .../plugin-frame-host-declarative.test.ts | 9 +++------ .../frames}/plugin-frame-host-lanes.ts | 18 ++++++++--------- .../frames}/plugin-frame-host.test.ts | 8 ++++---- .../frames}/plugin-frame-host.ts | 15 ++++---------- .../frames}/plugin-panel-design-token-css.ts | 10 +++++----- .../frames}/use-plugin-frame-entry.ts | 2 +- .../frames}/use-plugin-frame-host.ts | 10 +++++----- .../use-plugin-panel-theme-revision.ts | 2 +- .../view/plugin-view-act-test-harness.tsx | 2 +- .../plugins/view/plugin-view-capture-acts.ts | 2 +- .../plugins/view/plugin-view-data-acts.ts | 2 +- .../plugins/view/plugin-view-panel-settle.ts | 4 ++-- .../view/plugin-view-request-handler.test.ts | 2 +- .../PluginPanel.fixture.tsx | 4 ++-- .../{ => plugin-panels}/PluginPanel.test.tsx | 4 ++-- .../{ => plugin-panels}/PluginPanel.tsx | 19 ++++++++++-------- .../declarative}/PluginDeclarativePanel.tsx | 20 +++++++++---------- .../PluginDeclarativePanelNotices.tsx | 0 .../plugin-declarative-gesture-stability.ts | 2 +- .../plugin-declarative-retained-memory.ts | 2 +- .../use-plugin-declarative-images.ts | 0 .../use-plugin-declarative-state.ts | 8 ++++---- .../use-plugin-declarative-tree.test.ts | 0 .../use-plugin-declarative-tree.ts | 8 ++++---- .../health}/plugin-panel-act-driver.test.ts | 0 .../health}/plugin-panel-act-driver.ts | 6 +++--- .../health}/plugin-panel-draw-status.test.ts | 0 .../health}/plugin-panel-draw-status.ts | 0 .../plugin-panel-watchdog-visibility.test.ts | 2 +- .../health}/plugin-panel-watchdog.test.ts | 0 .../health}/plugin-panel-watchdog.ts | 2 +- .../use-plugin-panel-draw-report.test.tsx | 0 .../health}/use-plugin-panel-draw-report.ts | 2 +- .../plugin-panel-activity-items.test.ts | 0 .../plugin-panel-activity-items.ts | 4 ++-- ...e-installed-plugin-route-reconciliation.ts | 2 +- .../right-sidebar-panel-content.tsx | 2 +- .../use-right-sidebar-activity-items.ts | 2 +- ...sidebar-tab-routing.effective-tab.test.tsx | 2 +- .../use-right-sidebar-tab-routing.ts | 2 +- 49 files changed, 119 insertions(+), 122 deletions(-) rename src/renderer/src/components/{right-sidebar => plugins/frames}/plugin-frame-element.tsx (95%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/plugin-frame-host-declarative.test.ts (93%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/plugin-frame-host-lanes.ts (85%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/plugin-frame-host.test.ts (98%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/plugin-frame-host.ts (96%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/plugin-panel-design-token-css.ts (81%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/use-plugin-frame-entry.ts (97%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/use-plugin-frame-host.ts (92%) rename src/renderer/src/components/{right-sidebar => plugins/frames}/use-plugin-panel-theme-revision.ts (95%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels}/PluginPanel.fixture.tsx (89%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels}/PluginPanel.test.tsx (99%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels}/PluginPanel.tsx (87%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/PluginDeclarativePanel.tsx (87%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/PluginDeclarativePanelNotices.tsx (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/plugin-declarative-gesture-stability.ts (98%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/plugin-declarative-retained-memory.ts (93%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/use-plugin-declarative-images.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/use-plugin-declarative-state.ts (91%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/use-plugin-declarative-tree.test.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/declarative}/use-plugin-declarative-tree.ts (95%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-act-driver.test.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-act-driver.ts (90%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-draw-status.test.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-draw-status.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-watchdog-visibility.test.ts (95%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-watchdog.test.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/plugin-panel-watchdog.ts (97%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/use-plugin-panel-draw-report.test.tsx (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels/health}/use-plugin-panel-draw-report.ts (96%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels}/plugin-panel-activity-items.test.ts (100%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels}/plugin-panel-activity-items.ts (84%) rename src/renderer/src/components/right-sidebar/{ => plugin-panels}/use-installed-plugin-route-reconciliation.ts (90%) diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index f932c276030..bc6537eee54 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -8270,7 +8270,7 @@ "src/renderer/src/components/right-sidebar/FolderWorkspacePrChecksRow.test.tsx": 293, "src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsx": 461, "src/renderer/src/components/right-sidebar/HostedReviewActions.draft.test.tsx": 1587, - "src/renderer/src/components/right-sidebar/PluginPanel.test.tsx": 2710, + "src/renderer/src/components/right-sidebar/plugin-panels/PluginPanel.test.tsx": 2710, "src/renderer/src/components/right-sidebar/PortsPanel.test.tsx": 1618, "src/renderer/src/components/right-sidebar/PullRequestComposer.generate-tooltip.test.tsx": 1382, "src/renderer/src/components/right-sidebar/SessionRowTrailingActions.menus.test.tsx": 698, @@ -8383,13 +8383,13 @@ "src/renderer/src/components/right-sidebar/github-pr-stack-merge.test.ts": 216, "src/renderer/src/components/right-sidebar/parent-pr-checks-refresh.test.ts": 383, "src/renderer/src/components/right-sidebar/parent-pr-checks-rows.test.ts": 374, - "src/renderer/src/components/right-sidebar/plugin-frame-host-declarative.test.ts": 439, - "src/renderer/src/components/right-sidebar/plugin-frame-host.test.ts": 389, - "src/renderer/src/components/right-sidebar/plugin-panel-act-driver.test.ts": 293, - "src/renderer/src/components/right-sidebar/plugin-panel-activity-items.test.ts": 128, - "src/renderer/src/components/right-sidebar/plugin-panel-draw-status.test.ts": 46, - "src/renderer/src/components/right-sidebar/plugin-panel-watchdog-visibility.test.ts": 302, - "src/renderer/src/components/right-sidebar/plugin-panel-watchdog.test.ts": 116, + "src/renderer/src/components/plugins/frames/plugin-frame-host-declarative.test.ts": 439, + "src/renderer/src/components/plugins/frames/plugin-frame-host.test.ts": 389, + "src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-act-driver.test.ts": 293, + "src/renderer/src/components/right-sidebar/plugin-panels/plugin-panel-activity-items.test.ts": 128, + "src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-draw-status.test.ts": 46, + "src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-watchdog-visibility.test.ts": 302, + "src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-watchdog.test.ts": 116, "src/renderer/src/components/right-sidebar/ports-panel-host.test.ts": 344, "src/renderer/src/components/right-sidebar/pr-comments-ai-launch-ack.test.ts": 118, "src/renderer/src/components/right-sidebar/pr-comments-list-selection.test.tsx": 3290, @@ -8446,8 +8446,8 @@ "src/renderer/src/components/right-sidebar/use-generate-before-create-pull-request-context.test.tsx": 2246, "src/renderer/src/components/right-sidebar/use-hosted-review-actions.test.tsx": 628, "src/renderer/src/components/right-sidebar/use-persisted-ai-vault-view-options.test.tsx": 304, - "src/renderer/src/components/right-sidebar/use-plugin-declarative-tree.test.ts": 464, - "src/renderer/src/components/right-sidebar/use-plugin-panel-draw-report.test.tsx": 204, + "src/renderer/src/components/right-sidebar/plugin-panels/declarative/use-plugin-declarative-tree.test.ts": 464, + "src/renderer/src/components/right-sidebar/plugin-panels/health/use-plugin-panel-draw-report.test.tsx": 204, "src/renderer/src/components/right-sidebar/use-right-sidebar-tab-routing.effective-tab.test.tsx": 271, "src/renderer/src/components/right-sidebar/use-source-control-branch-compare.test.tsx": 712, "src/renderer/src/components/right-sidebar/use-source-control-git-history.test.tsx": 1951, diff --git a/config/scripts/pr-plugin-e2e-routing.test.mjs b/config/scripts/pr-plugin-e2e-routing.test.mjs index 464e7f5a968..d4c8188892b 100644 --- a/config/scripts/pr-plugin-e2e-routing.test.mjs +++ b/config/scripts/pr-plugin-e2e-routing.test.mjs @@ -71,7 +71,7 @@ describe('plugin PR E2E routing', () => { 'plugin-components-hot-reload' ], [ - 'src/renderer/src/components/right-sidebar/PluginDeclarativePanelNotices.tsx', + 'src/renderer/src/components/right-sidebar/plugin-panels/declarative/PluginDeclarativePanelNotices.tsx', 'plugin-components-hot-reload' ], ['src/main/plugins/plugin-dev-watcher.ts', 'plugin-components-hot-reload'], @@ -82,7 +82,10 @@ describe('plugin PR E2E routing', () => { ['src/renderer/src/store/plugin-shot-replay.ts', 'plugin-shot'], ['src/main/plugins/testing/plugin-test-register.ts', 'plugin-shot'], ['src/renderer/src/components/plugins/view/plugin-view-request-handler.ts', 'plugin-shot'], - ['src/renderer/src/components/right-sidebar/plugin-panel-draw-status.ts', 'plugin-shot'], + [ + 'src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-draw-status.ts', + 'plugin-shot' + ], ['src/main/runtime/rpc/methods/plugin-view.ts', 'plugin-shot'], ['src/cli/handlers/plugin-view.ts', 'plugin-shot'], ['src/cli/handlers/plugin-shot-default-dir.ts', 'plugin-shot'], diff --git a/config/scripts/pr-plugin-e2e-source-routes.mjs b/config/scripts/pr-plugin-e2e-source-routes.mjs index 5ed942336df..f1fd56d0d32 100644 --- a/config/scripts/pr-plugin-e2e-source-routes.mjs +++ b/config/scripts/pr-plugin-e2e-source-routes.mjs @@ -128,7 +128,7 @@ const SPECIFIC_PLUGIN_ROUTES = [ 'src\\/main\\/startup\\/main-process-plugins', 'config\\/build-plugins\\/main-build-entry-points', 'src\\/main\\/browser\\/guest-lifecycle\\/input\\/browser-guest-shortcut-(?:forwarding|dispatch)', - 'src\\/renderer\\/src\\/components\\/right-sidebar\\/(?:plugin-frame-|use-plugin-frame-|PluginPanel\\.tsx$|plugin-panel-design-token-css|use-plugin-panel-theme-revision)', + 'src\\/renderer\\/src\\/components\\/(?:plugins\\/frames\\/|right-sidebar\\/plugin-panels\\/PluginPanel\\.tsx$)', 'src\\/renderer\\/src\\/components\\/editor\\/(?:PluginCustomEditorFrame\\.tsx$|plugin-custom-editor-host)' ].join('|'), 'plugin-frame-guest|plugin-smoke' @@ -139,7 +139,7 @@ const SPECIFIC_PLUGIN_ROUTES = [ [ `${UI}(?:declarative\\/|plugin-icon-glyphs\\.ts$)`, 'src\\/shared\\/plugins\\/(?:declarative\\/|frames\\/plugin-declarative-)', - 'src\\/renderer\\/src\\/components\\/right-sidebar\\/(?:PluginDeclarativePanel|use-plugin-declarative-|plugin-declarative-)', + 'src\\/renderer\\/src\\/components\\/right-sidebar\\/plugin-panels\\/declarative\\/(?:PluginDeclarativePanel|use-plugin-declarative-|plugin-declarative-)', 'resources\\/plugins\\/declarative\\/' ].join('|'), 'plugin-frame-guest|plugin-smoke' @@ -177,7 +177,7 @@ const SPECIFIC_PLUGIN_ROUTES = [ [ 'src\\/shared\\/plugins\\/declarative\\/(?:plugin-declarative-message|runtime\\/declarative-(?:atoms|memory-retention|error-location|panel-context|renderer))', 'src\\/shared\\/plugins\\/frames\\/plugin-(?:declarative-host-document|frame-bridge)', - 'src\\/renderer\\/src\\/components\\/right-sidebar\\/(?:PluginDeclarativePanel|PluginPanel\\.tsx$|use-plugin-declarative-(?:state|tree)|plugin-declarative-retained-memory)', + 'src\\/renderer\\/src\\/components\\/right-sidebar\\/plugin-panels\\/(?:PluginPanel\\.tsx$|declarative\\/(?:PluginDeclarativePanel|use-plugin-declarative-(?:state|tree)|plugin-declarative-retained-memory))', 'src\\/main\\/plugins\\/(?:plugin-dev-|panels\\/plugin-frame-guest-sessions)', 'resources\\/plugins\\/declarative\\/' ].join('|'), @@ -220,7 +220,7 @@ const SPECIFIC_PLUGIN_ROUTES = [ // Every `plugin shot` checks for a chrome region and resolves the default shots folder. 'src\\/cli\\/(?:handlers\\/plugin-(?:view|shot-chrome|shot-default-dir)|specs\\/plugin-view)', 'src\\/renderer\\/src\\/hooks\\/(?:ipc-events\\/plugin-view-ipc-bridge|use-document-dark-theme)', - 'src\\/renderer\\/src\\/components\\/right-sidebar\\/(?:plugin-panel-draw-status|use-plugin-panel-draw-report|right-sidebar-panel-content)' + 'src\\/renderer\\/src\\/components\\/right-sidebar\\/(?:plugin-panels\\/health\\/(?:plugin-panel-draw-status|use-plugin-panel-draw-report)|right-sidebar-panel-content)' ].join('|'), 'plugin-frame-guest|plugin-smoke|compiled-orca-cli' ), diff --git a/src/renderer/src/components/editor/PluginCustomEditorFrame.tsx b/src/renderer/src/components/editor/PluginCustomEditorFrame.tsx index 7264828fc34..f40a18317ee 100644 --- a/src/renderer/src/components/editor/PluginCustomEditorFrame.tsx +++ b/src/renderer/src/components/editor/PluginCustomEditorFrame.tsx @@ -7,15 +7,15 @@ import { } from '@/store/plugin-custom-editors' import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../../../shared/plugins/frames/plugin-frame-bridge' import { CUSTOM_EDITOR_LARGE_DOCUMENT_BYTES } from '../../../../shared/plugins/frames/plugin-custom-editor-bridge' -import { fillPluginPanelShell } from '../right-sidebar/plugin-panel-design-token-css' +import { fillPluginPanelShell } from '../plugins/frames/plugin-panel-design-token-css' import { PluginFrameView, pluginFrameWindowOf, usablePluginFrameGuest, type PluginFrameElement -} from '../right-sidebar/plugin-frame-element' -import { usePluginFrameHost } from '../right-sidebar/use-plugin-frame-host' -import { usePluginFrameEntry } from '../right-sidebar/use-plugin-frame-entry' +} from '../plugins/frames/plugin-frame-element' +import { usePluginFrameHost } from '../plugins/frames/use-plugin-frame-host' +import { usePluginFrameEntry } from '../plugins/frames/use-plugin-frame-entry' import { editorShortcutMatches } from './editor-shortcuts' import { countCustomEditorMergingView, diff --git a/src/renderer/src/components/editor/plugin-custom-editor-frame-events.ts b/src/renderer/src/components/editor/plugin-custom-editor-frame-events.ts index f2051d3942c..47cd7fd57e4 100644 --- a/src/renderer/src/components/editor/plugin-custom-editor-frame-events.ts +++ b/src/renderer/src/components/editor/plugin-custom-editor-frame-events.ts @@ -1,7 +1,7 @@ import { readCustomEditorKeyChord } from '../../../../shared/plugins/frames/plugin-custom-editor-bridge' import { FRAME_EVENTS } from '../../../../shared/plugins/frames/plugin-frame-bridge' import type { PluginEvent } from '../../../../shared/plugins/frames/plugin-protocol' -import type { PluginFrameMessageContext } from '../right-sidebar/plugin-frame-host' +import type { PluginFrameMessageContext } from '../plugins/frames/plugin-frame-host-lanes' import type { CustomEditorHostOptions } from './plugin-custom-editor-host-types' /** A custom editor frame's own events. True when it announced that its session merges outside diff --git a/src/renderer/src/components/editor/plugin-custom-editor-host-types.ts b/src/renderer/src/components/editor/plugin-custom-editor-host-types.ts index 28b29f915b2..71cadadaa50 100644 --- a/src/renderer/src/components/editor/plugin-custom-editor-host-types.ts +++ b/src/renderer/src/components/editor/plugin-custom-editor-host-types.ts @@ -1,9 +1,9 @@ import type { CustomEditorKeyChord } from '../../../../shared/plugins/frames/plugin-custom-editor-bridge' +import type { PluginFrameEditorChannel } from '../plugins/frames/plugin-frame-host' import type { - PluginFrameEditorChannel, PluginFrameMessageContext, PluginFrameWindow -} from '../right-sidebar/plugin-frame-host' +} from '../plugins/frames/plugin-frame-host-lanes' import type { PanelMessageBudget } from '../../../../shared/plugins/frames/plugin-panel-message-budget' export type CustomEditorEditRefusal = 'oversized' | 'rate_limited' diff --git a/src/renderer/src/components/editor/plugin-custom-editor-host.test.ts b/src/renderer/src/components/editor/plugin-custom-editor-host.test.ts index 8fc548cda07..d7b325978ca 100644 --- a/src/renderer/src/components/editor/plugin-custom-editor-host.test.ts +++ b/src/renderer/src/components/editor/plugin-custom-editor-host.test.ts @@ -2,11 +2,11 @@ import { describe, expect, it, vi } from 'vitest' import { CUSTOM_EDITOR_DOCUMENT_MAX_BYTES } from '../../../../shared/plugins/frames/plugin-custom-editor-bridge' import { isPluginJsonObject } from '../../../../shared/plugins/manifest/plugin-json-object' import { createPanelMessageBudget } from '../../../../shared/plugins/frames/plugin-panel-message-budget' -import { createPluginFrameMessageHandler } from '../right-sidebar/plugin-frame-host' +import { createPluginFrameMessageHandler } from '../plugins/frames/plugin-frame-host' import { createCustomEditorHost } from './plugin-custom-editor-host' import type { CustomEditorHostOptions } from './plugin-custom-editor-host-types' -vi.mock('../right-sidebar/plugin-panel-design-token-css', () => ({ +vi.mock('../plugins/frames/plugin-panel-design-token-css', () => ({ currentPluginFrameTheme: () => ({ colorScheme: 'light', tokens: '' }) })) diff --git a/src/renderer/src/components/editor/use-custom-editor-reload-flush.ts b/src/renderer/src/components/editor/use-custom-editor-reload-flush.ts index d1552168489..688ca1c0a61 100644 --- a/src/renderer/src/components/editor/use-custom-editor-reload-flush.ts +++ b/src/renderer/src/components/editor/use-custom-editor-reload-flush.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import type { PluginFrameEntryState } from '../right-sidebar/use-plugin-frame-entry' +import type { PluginFrameEntryState } from '../plugins/frames/use-plugin-frame-entry' type ReadyEntry = Extract diff --git a/src/renderer/src/components/right-sidebar/plugin-frame-element.tsx b/src/renderer/src/components/plugins/frames/plugin-frame-element.tsx similarity index 95% rename from src/renderer/src/components/right-sidebar/plugin-frame-element.tsx rename to src/renderer/src/components/plugins/frames/plugin-frame-element.tsx index 4595e50cba2..9eae6f2c617 100644 --- a/src/renderer/src/components/right-sidebar/plugin-frame-element.tsx +++ b/src/renderer/src/components/plugins/frames/plugin-frame-element.tsx @@ -1,8 +1,9 @@ import React from 'react' -import { ORCA_BROWSER_GUEST_WEB_PREFERENCES_ATTRIBUTE } from '../../../../shared/browser-guest-web-preferences' -import type { PluginFrameGuest } from '../../../../shared/plugins/frames/plugin-frame-bridge' +import { ORCA_BROWSER_GUEST_WEB_PREFERENCES_ATTRIBUTE } from '../../../../../shared/browser-guest-web-preferences' +import type { PluginFrameGuest } from '../../../../../shared/plugins/frames/plugin-frame-bridge' import { isWebClientLocation } from '@/lib/web-client-location' -import { pluginWebviewFrameWindow, type PluginFrameWindow } from './plugin-frame-host' +import './plugin-frame-host' +import { pluginWebviewFrameWindow, type PluginFrameWindow } from './plugin-frame-host-lanes' /** A mounted plugin frame: a srcdoc `