Repository navigation
Plugins: one loader for panel and editor frames; suspended panels stay marked failed - #35680
Conversation
…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.
|
Warning Review limit reachedYou'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. View limit details
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 |
[Medium impact] The PR appears safe to merge. SummaryBoth plugin surfaces now use
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 |
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
PluginPanelandPluginCustomEditorFrameeach 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.usePluginFrameEntryhook 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
Notes
Renderer only; no IPC or wire change.