fix(#105): corrige le contexte plugin pour hello-plugin
Ajoute logger, subscriptions et commandes scindées au contexte plugin activé. Les plugins full-trust s'attendent à ce shape public.
This commit is contained in:
@ -13,6 +13,7 @@ import { useState } from "react";
|
||||
import type { PluginAdmin, PluginLifecycleState, PluginReview } from "@/domain";
|
||||
import { Button, Panel } from "@/shared";
|
||||
import { PluginConfirmDialog as ConfirmDialog } from "./PluginConfirmDialog";
|
||||
import { usePluginRuntime } from "./PluginRuntimeProvider";
|
||||
import { usePlugins } from "./usePlugins";
|
||||
|
||||
const STATE_LABEL: Record<PluginLifecycleState, string> = {
|
||||
@ -36,6 +37,7 @@ interface InstallFlow {
|
||||
|
||||
export function PluginsPanel() {
|
||||
const vm = usePlugins();
|
||||
const pluginRuntime = usePluginRuntime();
|
||||
const [pendingAction, setPendingAction] = useState<PendingAction | null>(null);
|
||||
const [installFlow, setInstallFlow] = useState<InstallFlow | null>(null);
|
||||
const [installFlowError, setInstallFlowError] = useState<string | null>(null);
|
||||
@ -108,6 +110,24 @@ export function PluginsPanel() {
|
||||
</p>
|
||||
)}
|
||||
|
||||
{pluginRuntime.failures.length > 0 && (
|
||||
<Panel className="border-warning/40">
|
||||
<div className="flex flex-col gap-1">
|
||||
<p role="alert" className="text-sm font-medium text-warning">
|
||||
Certains plugins installés n'ont pas pu être chargés.
|
||||
</p>
|
||||
<ul className="flex flex-col gap-0.5">
|
||||
{pluginRuntime.failures.map((failure) => (
|
||||
<li key={`${failure.pluginId}:${failure.reason}`} className="text-xs text-muted">
|
||||
<span className="font-medium text-content">{failure.pluginId}</span> :{" "}
|
||||
{failure.reason}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</Panel>
|
||||
)}
|
||||
|
||||
{vm.plugins.length === 0 ? (
|
||||
<Panel>
|
||||
<p className="text-sm text-muted">Aucun plugin installé.</p>
|
||||
|
||||
Reference in New Issue
Block a user