From 83778ceb66b472eaaee2c9950338fabaa307a4b0 Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Wed, 21 Jan 2026 01:02:17 -0800 Subject: [PATCH 1/3] Fix showing ordering id --- src/tree/accounts/AccountItem.ts | 3 ++- src/tree/holdings/HoldingItem.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tree/accounts/AccountItem.ts b/src/tree/accounts/AccountItem.ts index 6925569..c651c8b 100644 --- a/src/tree/accounts/AccountItem.ts +++ b/src/tree/accounts/AccountItem.ts @@ -36,7 +36,8 @@ export class AccountItem extends TreeItem implements PiExtTreeItem, Reorderable } async viewProperties(): Promise { - return JSON.stringify(this.account, undefined, 4); + const { id, ...accountWithoutId } = this.account as any; + return JSON.stringify(accountWithoutId, undefined, 4); } getResourceId(): string { diff --git a/src/tree/holdings/HoldingItem.ts b/src/tree/holdings/HoldingItem.ts index a8d6c93..fea9c9a 100644 --- a/src/tree/holdings/HoldingItem.ts +++ b/src/tree/holdings/HoldingItem.ts @@ -35,7 +35,8 @@ export class HoldingItem extends TreeItem implements PiExtTreeItem, Reorderable } viewProperties(): string { - return JSON.stringify(this.holding, undefined, 4); + const { id, ...holdingWithoutId } = this.holding as any; + return JSON.stringify(holdingWithoutId, undefined, 4); } getResourceId(): string { From 0af9e8e3c98180368296e350a5bbf6e71529fef8 Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Wed, 21 Jan 2026 01:06:56 -0800 Subject: [PATCH 2/3] Also filter for the parent items --- src/tree/accounts/AccountsItem.ts | 3 ++- src/tree/holdings/HoldingsItem.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tree/accounts/AccountsItem.ts b/src/tree/accounts/AccountsItem.ts index 58e05c0..7a722fc 100644 --- a/src/tree/accounts/AccountsItem.ts +++ b/src/tree/accounts/AccountsItem.ts @@ -73,7 +73,8 @@ export class AccountsItem extends TreeItem implements PiExtTreeItem, Reorderer { async viewProperties(): Promise { const accounts: Account[] = await AccountsItem.getAccountsWithCache(this.email); - return JSON.stringify(accounts, undefined, 4); + const accountsWithoutId = accounts.map(({ id, ...account }: any) => account); + return JSON.stringify(accountsWithoutId, undefined, 4); } static async getAccounts(email: string): Promise { diff --git a/src/tree/holdings/HoldingsItem.ts b/src/tree/holdings/HoldingsItem.ts index fd2f6c1..3e80ec7 100644 --- a/src/tree/holdings/HoldingsItem.ts +++ b/src/tree/holdings/HoldingsItem.ts @@ -73,7 +73,8 @@ export class HoldingsItem extends TreeItem implements PiExtTreeItem, Reorderer { async viewProperties(): Promise { const holdings: Holding[] = await HoldingsItem.getHoldingsWithCache(this.email); - return JSON.stringify(holdings, undefined, 4); + const holdingsWithoutId = holdings.map(({ id, ...holding }: any) => holding); + return JSON.stringify(holdingsWithoutId, undefined, 4); } static async getHoldings(email: string): Promise { From ed464035e85b325af6eb3fba6aab7ee2e4f0d0be Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:52:40 -0800 Subject: [PATCH 3/3] Formatting --- src/tree/accounts/AccountsItem.ts | 13 ++++++------- src/tree/holdings/HoldingsItem.ts | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/tree/accounts/AccountsItem.ts b/src/tree/accounts/AccountsItem.ts index 23c0fba..56b8fda 100644 --- a/src/tree/accounts/AccountsItem.ts +++ b/src/tree/accounts/AccountsItem.ts @@ -48,19 +48,19 @@ export class AccountsItem extends TreeItem implements PiExtTreeItem, Reorderer { } const showDeprecated = settingUtils.getShowDeprecatedResources(); - + // Separate deprecated and non-deprecated accounts const nonDeprecatedAccounts = accounts.filter(a => !a.is_deprecated); const deprecatedAccounts = showDeprecated ? accounts.filter(a => a.is_deprecated) : []; const orderedAccounts: Account[] = await this.getOrderedResourceModels(nonDeprecatedAccounts); - + // Cache all accounts (both deprecated and non-deprecated) to preserve deprecated items after reordering const allAccounts = [...orderedAccounts, ...accounts.filter(a => a.is_deprecated)]; ext.resourceCache.set(AccountsItem.generatePiExtAccountsId(this.email), allAccounts); const items: PiExtTreeItem[] = orderedAccounts.map(a => new AccountItem(this, this.email, a)); - + // Add deprecated accounts at the end if (deprecatedAccounts.length > 0) { items.push(...deprecatedAccounts.map(a => new AccountDeprecatedItem(this, this.email, a))); @@ -91,18 +91,17 @@ export class AccountsItem extends TreeItem implements PiExtTreeItem, Reorderer { async viewProperties(): Promise { const accounts: Account[] = await AccountsItem.getAccountsWithCache(this.email); const showDeprecated = settingUtils.getShowDeprecatedResources(); - + // Separate deprecated and non-deprecated accounts const nonDeprecatedAccounts = accounts.filter(a => !a.is_deprecated); const deprecatedAccounts = showDeprecated ? accounts.filter(a => a.is_deprecated) : []; - + // Order non-deprecated accounts and append deprecated ones at the end const orderedAccounts = await this.getOrderedResourceModels(nonDeprecatedAccounts); const result = [...orderedAccounts, ...deprecatedAccounts]; - + // Remove id field from all accounts const resultWithoutId = result.map(({ id, ...account }: any) => account); - return JSON.stringify(resultWithoutId, undefined, 4); } diff --git a/src/tree/holdings/HoldingsItem.ts b/src/tree/holdings/HoldingsItem.ts index cfbb187..880c4fc 100644 --- a/src/tree/holdings/HoldingsItem.ts +++ b/src/tree/holdings/HoldingsItem.ts @@ -48,19 +48,19 @@ export class HoldingsItem extends TreeItem implements PiExtTreeItem, Reorderer { } const showDeprecated = settingUtils.getShowDeprecatedResources(); - + // Separate deprecated and non-deprecated holdings const nonDeprecatedHoldings = holdings.filter(h => !h.is_deprecated); const deprecatedHoldings = showDeprecated ? holdings.filter(h => h.is_deprecated) : []; const orderedHoldings: Holding[] = await this.getOrderedResourceModels(nonDeprecatedHoldings); - + // Cache all holdings (both deprecated and non-deprecated) to preserve deprecated items after reordering const allHoldings = [...orderedHoldings, ...holdings.filter(h => h.is_deprecated)]; ext.resourceCache.set(HoldingsItem.generatePiExtHoldingsId(this.email), allHoldings); const items: PiExtTreeItem[] = orderedHoldings.map(h => new HoldingItem(this, this.email, h)); - + // Add deprecated holdings at the end if (deprecatedHoldings.length > 0) { items.push(...deprecatedHoldings.map(h => new HoldingDeprecatedItem(this, this.email, h))); @@ -91,18 +91,17 @@ export class HoldingsItem extends TreeItem implements PiExtTreeItem, Reorderer { async viewProperties(): Promise { const holdings: Holding[] = await HoldingsItem.getHoldingsWithCache(this.email); const showDeprecated = settingUtils.getShowDeprecatedResources(); - + // Separate deprecated and non-deprecated holdings const nonDeprecatedHoldings = holdings.filter(h => !h.is_deprecated); const deprecatedHoldings = showDeprecated ? holdings.filter(h => h.is_deprecated) : []; - + // Order non-deprecated holdings and append deprecated ones at the end const orderedHoldings = await this.getOrderedResourceModels(nonDeprecatedHoldings); const result = [...orderedHoldings, ...deprecatedHoldings]; - + // Remove id field from all holdings const resultWithoutId = result.map(({ id, ...holding }: any) => holding); - return JSON.stringify(resultWithoutId, undefined, 4); }