refactor: remove unused onDispatch properties

This commit removes the onDispatch callback passed to PluginRunner, as it declares its own. It also removes the function in the page. Lastly, it removes the prop passed to Grid but adds the one passed to List.
This commit is contained in:
ByteAtATime 2025-07-09 09:58:38 -07:00
parent 66f40dc607
commit b8f05b2c84
No known key found for this signature in database
2 changed files with 3 additions and 11 deletions

View file

@ -29,9 +29,9 @@
<div class="h-full overflow-y-auto">
{#if rootNode}
{#if rootNode.type === 'List'}
<List nodeId={rootNode.id} {uiTree} {onDispatch} {onSelect} {searchText} />
<List nodeId={rootNode.id} {uiTree} {onSelect} {searchText} />
{:else if rootNode.type === 'Grid'}
<Grid nodeId={rootNode.id} {uiTree} {onSelect} {searchText} />
<Grid nodeId={rootNode.id} {uiTree} {onDispatch} {onSelect} {searchText} />
{:else if rootNode.type === 'Detail'}
<Detail nodeId={rootNode.id} {uiTree} {onDispatch} />
{:else}

View file

@ -198,10 +198,6 @@
sidecarService.getPreferences(pluginName);
}
function handleDispatch(instanceId: number, handlerName: string, args: unknown[]) {
sidecarService.dispatchEvent('dispatch-event', { instanceId, handlerName, args });
}
function handlePopView() {
sidecarService.dispatchEvent('pop-view');
}
@ -257,11 +253,7 @@
<Extensions onBack={viewManager.showCommandPalette} onInstall={onExtensionInstalled} />
{:else if currentView === 'plugin-running'}
{#key uiStore.currentRunningPlugin?.pluginPath}
<PluginRunner
onDispatch={handleDispatch}
onPopView={handlePopView}
onToastAction={handleToastAction}
/>
<PluginRunner onPopView={handlePopView} onToastAction={handleToastAction} />
{/key}
{:else if currentView === 'clipboard-history'}
<ClipboardHistoryView onBack={viewManager.showCommandPalette} />