Skip to content

Plugins: one loader for panel and editor frames; suspended panels stay marked failed - #35680

Merged
nwparker merged 1 commit into
mainfrom
nwparker/plugin-frame-entry
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/plugin-frame-entry

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​113 $\color{#cf222e}{\Huge{\mathbf{−}}}$​142 $\color{#cf222e}{\Huge{\mathbf{−}}}$​29

ELI5

Plugin side panels and plugin file editors both load their page the same way, but the code was written twice. The panel's copy had a bug: when a frozen panel was suspended, the red "failed" dot in the sidebar disappeared again on the next unrelated plugin update, even though the panel still said it was suspended.

What Changed

  • Before: PluginPanel and PluginCustomEditorFrame each had a ~50-line effect that reads the frame's HTML, ignores stale reads, rereads on every plugin change, and bumps a revision only when the HTML changes. On any plugin-list change the panel reported itself healthy without leaving the suspended state; the editor instead silently remounted a frame the watchdog had suspended.
  • After: one usePluginFrameEntry hook does this for both. A suspended frame stays suspended until its HTML actually changes (a new plugin version or a dev reload), so the sidebar's failure dot and the message agree. Panel health is now derived from the entry state in one effect instead of being set in five places.

Why

Found in a post-merge pass over the plugin code. Fixing the bug in the shared loader fixes it once for both surfaces and removes the duplicate. Keeping a suspended frame suspended matches what the message tells the user; reviving it on an unrelated event just lets a frozen plugin freeze again.

Linked Issue

Follow-up from #35470.

Visual Proof

N/A — the visible change is that the sidebar failure dot stays on while the panel shows "stopped responding and was suspended"; covered by a unit test.

Testing

  • New panel test: after suspension, a plugin-list change keeps the panel suspended and reported failed (fails on main).
  • Existing panel, custom editor frame and bytes editor tests pass; web typecheck passes.

Notes

Renderer only; no IPC or wire change.

…stom editors

Panels and custom editors each had their own copy of the read-entry,
newest-read-wins, reload-on-change loop. The panel copy also cleared its
failure dot on the next plugin-list change while it still showed the
suspended message. One hook now loads both; a suspended frame stays suspended
(and reported failed) until its HTML actually changes, and panel health is
derived from the entry state.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f6de3e6-c480-4d91-8d0a-384a5ee430be
Commits

Reviewing files that changed from the base of the PR and between 074fc36 and 2561361.

Files selected for processing: 4
  • src/renderer/src/components/editor/PluginCustomEditorFrame.tsx
  • src/renderer/src/components/right-sidebar/PluginPanel.test.tsx
  • src/renderer/src/components/right-sidebar/PluginPanel.tsx
  • src/renderer/src/components/right-sidebar/use-plugin-frame-entry.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Both plugin surfaces now use usePluginFrameEntry to load their HTML and refresh their sessions.

  • Plugin panels and custom editors keep suspended frames down until their HTML changes.

No actionable issues were found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "refactor(plugins): share one frame-entry..." · Reviewed by Greptile

@nwparker
nwparker merged commit 12bb6ae into main Oct 29, 2026
40 checks passed
@nwparker
nwparker deleted the nwparker/plugin-frame-entry branch October 29, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant