refactor: group right sidebar plugin panel owners (#38095)

This commit is contained in:
Neil
2026-11-04 01:25:01 -08:00
committed by GitHub
parent fa39c62263
commit bb6e5d47da
49 changed files with 119 additions and 122 deletions
+10 -10
View File
@@ -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,
@@ -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'],
@@ -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'
),
@@ -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,
@@ -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
@@ -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'
@@ -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: '' })
}))
@@ -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<PluginFrameEntryState, { status: 'ready' }>
@@ -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 `<iframe>` (browser clients) or an isolated `<webview>` guest. */
export type PluginFrameElement = HTMLElement
@@ -1,10 +1,7 @@
import { describe, expect, it, vi } from 'vitest'
import { parsePluginDeclarativeTree } from '../../../../shared/plugins/declarative/plugin-declarative-tree'
import {
createPluginFrameEnvelopeHandler,
pluginWebviewFrameWindow,
type PluginFrameHostOptions
} from './plugin-frame-host'
import { parsePluginDeclarativeTree } from '../../../../../shared/plugins/declarative/plugin-declarative-tree'
import { createPluginFrameEnvelopeHandler, type PluginFrameHostOptions } from './plugin-frame-host'
import { pluginWebviewFrameWindow } from './plugin-frame-host-lanes'
vi.mock('./plugin-panel-design-token-css', () => ({
currentPluginFrameTheme: () => ({ colorScheme: 'dark', tokens: '' })
@@ -1,21 +1,21 @@
import { PLUGIN_DECLARATIVE_RENDER_LANE } from '../../../../shared/plugins/declarative/plugin-declarative-limits'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../shared/plugins/declarative/plugin-declarative-message-names'
import type { PluginFrameHello } from '../../../../shared/plugins/frames/plugin-frame-bridge'
import { PLUGIN_FRAME_IPC_CHANNEL } from '../../../../shared/plugins/frames/plugin-frame-guest'
import { PLUGIN_DECLARATIVE_RENDER_LANE } from '../../../../../shared/plugins/declarative/plugin-declarative-limits'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../../shared/plugins/declarative/plugin-declarative-message-names'
import type { PluginFrameHello } from '../../../../../shared/plugins/frames/plugin-frame-bridge'
import { PLUGIN_FRAME_IPC_CHANNEL } from '../../../../../shared/plugins/frames/plugin-frame-guest'
import {
createPanelMessageBudget,
type PanelMessageBudget
} from '../../../../shared/plugins/frames/plugin-panel-message-budget'
import { PLUGIN_PROTOCOL_VERSION } from '../../../../shared/plugins/frames/plugin-protocol'
import { isPluginJsonObject } from '../../../../shared/plugins/manifest/plugin-json-object'
} from '../../../../../shared/plugins/frames/plugin-panel-message-budget'
import { PLUGIN_PROTOCOL_VERSION } from '../../../../../shared/plugins/frames/plugin-protocol'
import { isPluginJsonObject } from '../../../../../shared/plugins/manifest/plugin-json-object'
import {
getPluginHostMethodSpec,
PLUGIN_FRAME_USER_METHODS,
PLUGIN_SAVE_AS_MAX_BYTES,
pluginFrameMethodsFor,
pluginHostApiMinorFor
} from '../../../../shared/plugins/workers/plugin-host-api'
import { PLUGIN_HOST_API_MAJOR } from '../../../../shared/plugins/workers/plugin-host-api-major'
} from '../../../../../shared/plugins/workers/plugin-host-api'
import { PLUGIN_HOST_API_MAJOR } from '../../../../../shared/plugins/workers/plugin-host-api-major'
import { getIntlLocale } from '@/i18n/i18n'
import { currentPluginFrameTheme } from './plugin-panel-design-token-css'
@@ -1,16 +1,16 @@
import { describe, expect, it, vi } from 'vitest'
import { isPluginJsonObject } from '../../../../shared/plugins/manifest/plugin-json-object'
import type { PluginHostCallOutcome } from '../../../../shared/plugins/frames/plugin-protocol'
import { isPluginJsonObject } from '../../../../../shared/plugins/manifest/plugin-json-object'
import type { PluginHostCallOutcome } from '../../../../../shared/plugins/frames/plugin-protocol'
import {
createPanelMessageBudget,
type PanelMessageBudget
} from '../../../../shared/plugins/frames/plugin-panel-message-budget'
} from '../../../../../shared/plugins/frames/plugin-panel-message-budget'
import {
createPluginFrameEnvelopeHandler,
createPluginFrameMessageHandler,
pluginWebviewFrameWindow,
type PluginFrameHostOptions
} from './plugin-frame-host'
import { pluginWebviewFrameWindow } from './plugin-frame-host-lanes'
vi.mock('./plugin-panel-design-token-css', () => ({
currentPluginFrameTheme: () => ({ colorScheme: 'dark', tokens: '--orca-background:#000' })
@@ -2,7 +2,7 @@ import {
FRAME_EVENTS,
PANEL_CONTROL_MESSAGE_MAX_BYTES,
readPanelPongId
} from '../../../../shared/plugins/frames/plugin-frame-bridge'
} from '../../../../../shared/plugins/frames/plugin-frame-bridge'
import {
pluginError,
pluginEvent,
@@ -15,14 +15,14 @@ import {
type PluginHostCallOutcome,
type PluginRequest,
type PluginResponse
} from '../../../../shared/plugins/frames/plugin-protocol'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../shared/plugins/declarative/plugin-declarative-message-names'
} from '../../../../../shared/plugins/frames/plugin-protocol'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../../shared/plugins/declarative/plugin-declarative-message-names'
import {
createPanelControlMessageBudget,
createPanelMessageBudget,
structuredCloneMessageBytes,
type PanelMessageBudget
} from '../../../../shared/plugins/frames/plugin-panel-message-budget'
} from '../../../../../shared/plugins/frames/plugin-panel-message-budget'
import { translate } from '@/i18n/i18n'
import {
createPluginFrameGestureGate,
@@ -34,13 +34,6 @@ import {
type PluginFrameWindow
} from './plugin-frame-host-lanes'
export {
pluginFrameHello,
pluginWebviewFrameWindow,
type PluginFrameMessageContext,
type PluginFrameWindow
} from './plugin-frame-host-lanes'
/** Main binds opaque frame sessions; frames never supply plugin identity. */
export type PanelActionCall = {
@@ -1,14 +1,14 @@
import {
FRAME_EVENTS,
type PluginFrameTheme
} from '../../../../shared/plugins/frames/plugin-frame-bridge'
import { pluginEvent } from '../../../../shared/plugins/frames/plugin-protocol'
} from '../../../../../shared/plugins/frames/plugin-frame-bridge'
import { pluginEvent } from '../../../../../shared/plugins/frames/plugin-protocol'
import {
PANEL_SHELL_COLOR_SCHEME_PLACEHOLDER,
PANEL_SHELL_TOKENS_PLACEHOLDER
} from '../../../../shared/plugins/frames/plugin-panel-shell'
import { PANEL_DESIGN_TOKEN_ALLOWLIST } from '../../../../shared/plugins/frames/plugin-panel-design-tokens'
import type { PluginFrameWindow } from './plugin-frame-host'
} from '../../../../../shared/plugins/frames/plugin-panel-shell'
import { PANEL_DESIGN_TOKEN_ALLOWLIST } from '../../../../../shared/plugins/frames/plugin-panel-design-tokens'
import type { PluginFrameWindow } from './plugin-frame-host-lanes'
/** Snapshot trusted computed tokens for isolated panels; strip structural CSS characters before inserting into the shell style block. */
export function buildPanelDesignTokenCss(): string {
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import type { PluginFrameGuest } from '../../../../shared/plugins/frames/plugin-frame-bridge'
import type { PluginFrameGuest } from '../../../../../shared/plugins/frames/plugin-frame-bridge'
import { currentPluginFrameTheme } from './plugin-panel-design-token-css'
import { notePluginFrameIsolation } from '@/store/plugin-frame-isolation'
@@ -1,11 +1,11 @@
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type RefObject } from 'react'
import { FRAME_EVENTS } from '../../../../shared/plugins/frames/plugin-frame-bridge'
import { FRAME_EVENTS } from '../../../../../shared/plugins/frames/plugin-frame-bridge'
import {
PLUGIN_FRAME_IPC_CHANNEL,
PLUGIN_FRAME_KEY_CHANNEL
} from '../../../../shared/plugins/frames/plugin-frame-guest'
import { pluginEvent } from '../../../../shared/plugins/frames/plugin-protocol'
import { pluginPanelPushSchema } from '../../../../shared/plugins/workers/plugin-panel-bridge-protocol'
} from '../../../../../shared/plugins/frames/plugin-frame-guest'
import { pluginEvent } from '../../../../../shared/plugins/frames/plugin-protocol'
import { pluginPanelPushSchema } from '../../../../../shared/plugins/workers/plugin-panel-bridge-protocol'
import {
createPluginFrameEnvelopeHandler,
createPluginFrameMessageHandler,
@@ -17,7 +17,7 @@ import {
readPluginGuestMessage,
type PluginFrameElement
} from './plugin-frame-element'
import { createPanelWatchdog } from './plugin-panel-watchdog'
import { createPanelWatchdog } from '../../right-sidebar/plugin-panels/health/plugin-panel-watchdog'
import { usePluginFrameThemeSync } from './use-plugin-panel-theme-revision'
/** Wires one plugin frame (panel or editor, iframe or guest): message host, watchdog and live theme. */
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react'
import type { PluginFrameWindow } from './plugin-frame-host'
import type { PluginFrameWindow } from './plugin-frame-host-lanes'
import {
buildPanelDesignTokenCss,
currentPanelColorScheme,
@@ -9,7 +9,7 @@ import {
pluginDeclarativeActExpansion,
pluginDeclarativeActTarget
} from '../declarative/plugin-declarative-act-targets'
import type { PluginPanelActDriver } from '../../right-sidebar/plugin-panel-act-driver'
import type { PluginPanelActDriver } from '../../right-sidebar/plugin-panels/health/plugin-panel-act-driver'
import { runPluginPanelActs } from './plugin-view-acts'
export const cb = (id: string) => ({ $callback: id })
@@ -9,7 +9,7 @@ import {
import {
pluginPanelActDriver,
type PluginPanelActDriver
} from '../../right-sidebar/plugin-panel-act-driver'
} from '../../right-sidebar/plugin-panels/health/plugin-panel-act-driver'
import { runPluginPanelActs } from './plugin-view-acts'
import {
PLUGIN_PANEL_ACT_FIRST_DRAW_MS,
@@ -16,7 +16,7 @@ import type {
PluginDeclarativeActTarget,
PluginDeclarativeDrawnProps
} from '../declarative/plugin-declarative-act-targets'
import type { PluginPanelActDriver } from '../../right-sidebar/plugin-panel-act-driver'
import type { PluginPanelActDriver } from '../../right-sidebar/plugin-panels/health/plugin-panel-act-driver'
export type PluginPanelActDeps = {
driver: Pick<PluginPanelActDriver, 'tree' | 'send'>
@@ -3,8 +3,8 @@ import {
pluginPanelDrawStatus,
subscribePluginPanelDraw,
type PluginPanelDrawStatus
} from '../../right-sidebar/plugin-panel-draw-status'
import type { PluginPanelActDriver } from '../../right-sidebar/plugin-panel-act-driver'
} from '../../right-sidebar/plugin-panels/health/plugin-panel-draw-status'
import type { PluginPanelActDriver } from '../../right-sidebar/plugin-panels/health/plugin-panel-act-driver'
// Why a fallback: a hidden window may not tick animation frames, and a capture must not hang.
const FRAME_FALLBACK_MS = 100
@@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type { PluginHostListEntry } from '../../../../../shared/plugins/plugin-list-entry'
import { useAppStore } from '@/store'
import { usePluginViewCaptureStore } from '@/store/plugin-view-capture'
import { reportPluginPanelDraw } from '../../right-sidebar/plugin-panel-draw-status'
import { reportPluginPanelDraw } from '../../right-sidebar/plugin-panels/health/plugin-panel-draw-status'
import { handlePluginViewRequest } from './plugin-view-request-handler'
const KEY = 'acme.todos'
@@ -1,6 +1,6 @@
import { defineFixture } from '../../component-fixtures/component-fixture'
import { defineFixture } from '../../../component-fixtures/component-fixture'
import { usePluginPanelsStore } from '@/store/plugin-panels'
import { buildPluginPanelShellHtml } from '../../../../shared/plugins/frames/plugin-panel-shell'
import { buildPluginPanelShellHtml } from '../../../../../shared/plugins/frames/plugin-panel-shell'
import PluginPanel from './PluginPanel'
export const compact = defineFixture({
@@ -28,7 +28,7 @@ vi.mock('@/store/plugin-panels', () => ({
) => selector({ setPanelHealth: setPanelHealthMock })
}))
vi.mock('./plugin-panel-watchdog', () => ({
vi.mock('./health/plugin-panel-watchdog', () => ({
createPanelWatchdog: (options: { onUnresponsive: () => void }) => {
watchdogCallbacks.onUnresponsive = options.onUnresponsive
return {
@@ -238,7 +238,7 @@ describe('PluginPanel', () => {
it('validates only the newest of a burst of declarative renders', async () => {
const { pluginDeclarativeRenderPayloadSchema } =
await import('../../../../shared/plugins/declarative/plugin-declarative-messages')
await import('../../../../../shared/plugins/declarative/plugin-declarative-messages')
const parse = vi.spyOn(pluginDeclarativeRenderPayloadSchema, 'safeParse')
readPanelEntryMock.mockResolvedValue({
html: '',
@@ -1,16 +1,19 @@
import React, { useEffect, useMemo, useRef } from 'react'
import { isPluginPanelTabKey } from '../../../../shared/plugins/manifest/plugin-manifest'
import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../../../shared/plugins/frames/plugin-frame-bridge'
import { fillPluginPanelShell } from './plugin-panel-design-token-css'
import { isPluginPanelTabKey } from '../../../../../shared/plugins/manifest/plugin-manifest'
import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../../../../shared/plugins/frames/plugin-frame-bridge'
import { fillPluginPanelShell } from '../../plugins/frames/plugin-panel-design-token-css'
import {
PluginFrameView,
usablePluginFrameGuest,
type PluginFrameElement
} from './plugin-frame-element'
import { PluginDeclarativePanel } from './PluginDeclarativePanel'
import { usePluginFrameHost } from './use-plugin-frame-host'
import { usePluginFrameEntry } from './use-plugin-frame-entry'
import { reportPluginPanelFailure, useReportFramePanelDraw } from './use-plugin-panel-draw-report'
} from '../../plugins/frames/plugin-frame-element'
import { PluginDeclarativePanel } from './declarative/PluginDeclarativePanel'
import { usePluginFrameHost } from '../../plugins/frames/use-plugin-frame-host'
import { usePluginFrameEntry } from '../../plugins/frames/use-plugin-frame-entry'
import {
reportPluginPanelFailure,
useReportFramePanelDraw
} from './health/use-plugin-panel-draw-report'
import { usePluginPanels, usePluginPanelsStore } from '@/store/plugin-panels'
import { translate } from '@/i18n/i18n'
import { isWebClientLocation } from '@/lib/web-client-location'
@@ -1,23 +1,23 @@
import React, { useCallback, useLayoutEffect, useRef, useSyncExternalStore } from 'react'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../shared/plugins/declarative/plugin-declarative-message-names'
import type { PluginFrameGuest } from '../../../../shared/plugins/frames/plugin-frame-bridge'
import { pluginEvent } from '../../../../shared/plugins/frames/plugin-protocol'
import { PLUGIN_FRAME_USER_METHODS } from '../../../../shared/plugins/workers/plugin-host-api'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../../../shared/plugins/declarative/plugin-declarative-message-names'
import type { PluginFrameGuest } from '../../../../../../shared/plugins/frames/plugin-frame-bridge'
import { pluginEvent } from '../../../../../../shared/plugins/frames/plugin-protocol'
import { PLUGIN_FRAME_USER_METHODS } from '../../../../../../shared/plugins/workers/plugin-host-api'
import { PluginDeclarativeView } from '@/components/plugins/declarative/PluginDeclarativeView'
import type { PluginDeclarativeEmit } from '@/components/plugins/declarative/PluginDeclarativeControls'
import { callPanelActionViaPreload } from './plugin-frame-host'
import { callPanelActionViaPreload } from '../../../plugins/frames/plugin-frame-host'
import {
PluginFrameView,
pluginFrameWindowOf,
type PluginFrameElement
} from './plugin-frame-element'
import { usePluginFrameHost } from './use-plugin-frame-host'
} from '../../../plugins/frames/plugin-frame-element'
import { usePluginFrameHost } from '../../../plugins/frames/use-plugin-frame-host'
import { usePluginDeclarativeTree } from './use-plugin-declarative-tree'
import { usePluginDeclarativeState } from './use-plugin-declarative-state'
import { useReportDeclarativePanelDraw } from './use-plugin-panel-draw-report'
import { useReportDeclarativePanelDraw } from '../health/use-plugin-panel-draw-report'
import { usePluginDeclarativeImages } from './use-plugin-declarative-images'
import { usePluginPanelActDriver } from './plugin-panel-act-driver'
import { useAppStore } from '@/store'
import { usePluginPanelActDriver } from '../health/plugin-panel-act-driver'
import { useAppStore } from '@/store/index'
import {
PluginDeclarativeIssueNotice,
PluginDeclarativeReloadedNotice
@@ -1,7 +1,7 @@
import type {
PluginDeclarativeChild,
PluginDeclarativeNode
} from '../../../../shared/plugins/declarative/plugin-declarative-catalog'
} from '../../../../../../shared/plugins/declarative/plugin-declarative-catalog'
import { pluginDeclarativeGestureId } from '@/components/plugins/declarative/plugin-declarative-gesture-geometry'
/**
@@ -1,7 +1,7 @@
import {
pluginDeclarativeRetainPayloadSchema,
type PluginDeclarativeStoredValue
} from '../../../../shared/plugins/declarative/plugin-declarative-messages'
} from '../../../../../../shared/plugins/declarative/plugin-declarative-messages'
// Why a cap: retained values live in the renderer for as long as the panel stays open.
const MAX_RETAINED_KEYS = 512
@@ -1,13 +1,13 @@
import { useEffect, useRef, useState } from 'react'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../shared/plugins/declarative/plugin-declarative-message-names'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../../../shared/plugins/declarative/plugin-declarative-message-names'
import {
pluginDeclarativePersistPayloadSchema,
pluginDeclarativeReadyPayloadSchema,
type PluginDeclarativeHydratePayload,
type PluginDeclarativeStoredValue
} from '../../../../shared/plugins/declarative/plugin-declarative-messages'
import type { PluginPanelStateSnapshot } from '../../../../shared/plugins/declarative/plugin-declarative-panel-state'
import { useAppStore } from '@/store'
} from '../../../../../../shared/plugins/declarative/plugin-declarative-messages'
import type { PluginPanelStateSnapshot } from '../../../../../../shared/plugins/declarative/plugin-declarative-panel-state'
import { useAppStore } from '@/store/index'
import { createPluginDeclarativeRetainedMemory } from './plugin-declarative-retained-memory'
type SendToGuest = (event: string, payload: unknown) => void
@@ -1,14 +1,14 @@
import { useEffect, useMemo, useRef, useState } from 'react'
import type { PluginDeclarativeNode } from '../../../../shared/plugins/declarative/plugin-declarative-catalog'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../shared/plugins/declarative/plugin-declarative-message-names'
import type { PluginDeclarativeNode } from '../../../../../../shared/plugins/declarative/plugin-declarative-catalog'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../../../shared/plugins/declarative/plugin-declarative-message-names'
import {
parsePluginDeclarativeRender,
pluginDeclarativeErrorPayloadSchema,
pluginDeclarativeRenderIdentity,
type PluginDeclarativeAckPayload
} from '../../../../shared/plugins/declarative/plugin-declarative-messages'
} from '../../../../../../shared/plugins/declarative/plugin-declarative-messages'
import { translate } from '@/i18n/i18n'
import type { PluginFrameDeclarativeChannel } from './plugin-frame-host'
import type { PluginFrameDeclarativeChannel } from '../../../plugins/frames/plugin-frame-host'
import {
createPluginDeclarativeGestureStability,
PLUGIN_DECLARATIVE_SETTLE_MS
@@ -1,7 +1,7 @@
import { useLayoutEffect, useMemo, useRef, useState } from 'react'
import type { PluginDeclarativeNode } from '../../../../shared/plugins/declarative/plugin-declarative-catalog'
import type { PluginDeclarativeEventArg } from '../../../../shared/plugins/declarative/plugin-declarative-messages'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../shared/plugins/declarative/plugin-declarative-message-names'
import type { PluginDeclarativeNode } from '../../../../../../shared/plugins/declarative/plugin-declarative-catalog'
import type { PluginDeclarativeEventArg } from '../../../../../../shared/plugins/declarative/plugin-declarative-messages'
import { PLUGIN_DECLARATIVE_MESSAGES } from '../../../../../../shared/plugins/declarative/plugin-declarative-message-names'
/**
* What `orca plugin shot` drives and waits on in a mounted components panel: the tree on screen,
@@ -1,7 +1,7 @@
// @vitest-environment happy-dom
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createPanelWatchdog } from './plugin-panel-watchdog'
import { resetStaleDocumentVisibilityForTesting } from '../terminal-pane/stale-document-visibility'
import { resetStaleDocumentVisibilityForTesting } from '../../../terminal-pane/stale-document-visibility'
function setVisibility(state: 'visible' | 'hidden'): void {
Object.defineProperty(document, 'visibilityState', { value: state, configurable: true })
@@ -1,7 +1,7 @@
import {
PANEL_WATCHDOG_PING_INTERVAL_MS,
PANEL_WATCHDOG_PONG_TIMEOUT_MS
} from '../../../../shared/plugins/frames/plugin-frame-bridge'
} from '../../../../../../shared/plugins/frames/plugin-frame-bridge'
import { getWindowParkVisible, subscribeWindowParkVisibility } from '@/lib/window-park-visibility'
/** Ping/pong deadlines mark unresponsive panels; busy-loop containment requires a separate Chromium renderer, gated by Electron tests. */
@@ -1,6 +1,6 @@
import { useEffect, useLayoutEffect, useRef } from 'react'
import { reportPluginPanelDraw } from './plugin-panel-draw-status'
import type { PluginFrameElement } from './plugin-frame-element'
import type { PluginFrameElement } from '../../../plugins/frames/plugin-frame-element'
/** A components panel: drawn once a tree from the current guest is on screen. */
export function useReportDeclarativePanelDraw(
@@ -1,7 +1,7 @@
import { Plug } from 'lucide-react'
import type { ActivePluginPanel } from '@/store/plugin-panels'
import type { ActivityBarItem } from './activity-bar-buttons'
import { resolvePluginIconGlyph } from '../plugins/plugin-icon-glyphs'
import type { ActivityBarItem } from '../activity-bar-buttons'
import { resolvePluginIconGlyph } from '../../plugins/plugin-icon-glyphs'
type PluginPanelIcon = ActivityBarItem['icon']
@@ -1,5 +1,5 @@
import { useEffect } from 'react'
import { isPluginPanelTabKey } from '../../../../shared/plugins/manifest/plugin-manifest'
import { isPluginPanelTabKey } from '../../../../../shared/plugins/manifest/plugin-manifest'
import type { PluginPanelsFetchStatus } from '@/store/plugin-panels'
import type { ActiveRightSidebarTab } from '@/store/slices/editor'
@@ -10,7 +10,7 @@ const PortsPanel = lazy(() => import('./PortsPanel'))
const AiVaultSidebarPanel = lazy(() => import('./AiVaultSidebarPanel'))
const FolderWorkspaceWorktreesPanel = lazy(() => import('./FolderWorkspaceWorktreesPanel'))
const FolderWorkspacePrChecksPanel = lazy(() => import('./FolderWorkspacePrChecksPanel'))
const PluginPanel = lazy(() => import('./PluginPanel'))
const PluginPanel = lazy(() => import('./plugin-panels/PluginPanel'))
type RightSidebarPanelContentProps = {
effectiveTab: ActiveRightSidebarTab
@@ -5,7 +5,7 @@ import { useRepoById } from '@/store/selectors'
import { isFolderRepo } from '../../../../shared/repo-kind'
import { parseWorkspaceKey } from '../../../../shared/workspace-scope'
import { getVisibleRightSidebarActivityItems } from './right-sidebar-activity-visibility'
import { getPluginPanelActivityItems } from './plugin-panel-activity-items'
import { getPluginPanelActivityItems } from './plugin-panels/plugin-panel-activity-items'
import {
getPortsPanelOwnerKey,
portsPanelHostForOwnerKey,
@@ -16,7 +16,7 @@ const store = vi.hoisted(() => ({
vi.mock('@/store', () => ({
useAppStore: (selector: (state: unknown) => unknown) => selector(store.state)
}))
vi.mock('./use-installed-plugin-route-reconciliation', () => ({
vi.mock('./plugin-panels/use-installed-plugin-route-reconciliation', () => ({
useInstalledPluginRouteReconciliation: () => {}
}))
@@ -4,7 +4,7 @@ import type { ActiveRightSidebarTab } from '@/store/slices/editor'
import type { PluginPanelsFetchStatus } from '@/store/plugin-panels'
import { normalizeRightSidebarRoute } from '@/store/right-sidebar-route'
import { resolveRightSidebarEffectiveTab } from './right-sidebar-effective-tab'
import { useInstalledPluginRouteReconciliation } from './use-installed-plugin-route-reconciliation'
import { useInstalledPluginRouteReconciliation } from './plugin-panels/use-installed-plugin-route-reconciliation'
import type { ActivityBarItem } from './activity-bar-buttons'
export type RightSidebarTabRouting = {