fix(vscode): add hasParameters and installationMethodName to install telemetry

This commit is contained in:
Mark IJbema
2026-03-17 15:17:55 +01:00
parent 5822e82a30
commit eb6d36ce82
2 changed files with 12 additions and 3 deletions
@@ -18,7 +18,11 @@ interface ScopeOption {
interface Props {
item: MarketplaceItem
onClose: () => void
onInstallResult: (success: boolean, scope: "project" | "global") => void
onInstallResult: (
success: boolean,
scope: "project" | "global",
extra?: { hasParameters?: boolean; installationMethodName?: string },
) => void
}
export const InstallModal = (props: Props) => {
@@ -77,7 +81,10 @@ export const InstallModal = (props: Props) => {
if (msg.type === "marketplaceInstallResult" && msg.slug === props.item.id) {
setInstalling(false)
setResult({ success: msg.success, error: msg.error })
props.onInstallResult(msg.success, scope().value)
props.onInstallResult(msg.success, scope().value, {
hasParameters: Object.keys(params()).length > 0,
installationMethodName: method()?.name,
})
}
})
onCleanup(unsub)
@@ -92,13 +92,15 @@ export const MarketplaceView = () => {
<InstallModal
item={item}
onClose={() => dialog.close()}
onInstallResult={(success, scope) => {
onInstallResult={(success, scope, extra) => {
if (success) {
telemetry("Marketplace Item Installed", {
itemId: item.id,
itemType: item.type,
itemName: item.name,
target: scope,
...(extra?.hasParameters && { hasParameters: true }),
...(extra?.installationMethodName && { installationMethodName: extra.installationMethodName }),
})
dialog.close()
fetchData()