Skip to content

Onboarding service#4858

Open
eamodio wants to merge 1 commit intomainfrom
feature/onboarding-service
Open

Onboarding service#4858
eamodio wants to merge 1 commit intomainfrom
feature/onboarding-service

Conversation

@eamodio
Copy link
Copy Markdown
Member

@eamodio eamodio commented Jan 8, 2026

No description provided.

 - Centralizes dismissible UI and onboarding logic into a new, versioned service
 - Replaces disjointed storage keys with a type-safe registry that supports automatic schema migrations and item re-showing
 - Simplifies onboarding state management across core logic and webview components
 - Removes legacy per-item storage flags in favor of a unified `onboarding:state` storage structure
@eamodio eamodio force-pushed the feature/onboarding-service branch from d0428b3 to 1fb369a Compare April 8, 2026 00:03
@eamodio eamodio marked this pull request as ready for review April 8, 2026 00:03
@eamodio eamodio requested a review from d13 April 8, 2026 00:03
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 8, 2026

🤖 Augment PR Summary

Summary: This PR introduces a centralized onboarding/dismissible-state service to replace scattered “dismissed” storage keys and command-based storage writes.

Changes:

  • Adds OnboardingService with versioned dismissal, typed item state, schema migrations, and reset APIs
  • Creates a central registry of onboarding/dismissible keys in src/constants.onboarding.ts
  • Adds per-item migration definitions in src/onboarding/onboardingMigrations.ts and migrates legacy storage keys
  • Moves UsageTracker and WalkthroughStateProvider into src/onboarding/ and updates imports
  • Updates MCP banner and SCM grouped welcome flows to use onboarding state instead of direct storage flags
  • Wires Home and Graph webviews to a new shared OnboardingRpcService and onboarding change events
  • Removes the gitlens.storage.store command and the associated allowlist-based storage write path
  • Extends global/workspace storage schemas with a unified onboarding:state entry

Technical Notes: Adds a small fromVersion() helper in utils to normalize version strings and uses semver-based reshowAfter logic to re-display onboarding when appropriate.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

if (args.id in onboardingDefinitions) {
void this.dismiss(args.id);
} else {
debugger;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugger; is left in the gitlens.onboarding.dismiss command handler; if a webview (or a bad link) sends an unknown id, this will pause execution for end users and can break automated environments.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

}),
);

void this.migrateLegacyState().then(() => this._ready.fulfill(undefined));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migrateLegacyState() is launched without any rejection handling; if it throws, the rejection can be unhandled and ready will never resolve, leaving onboarding state potentially stuck for the session.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

/** Get item state, running migrations if needed */
getItemState<T extends OnboardingKeys>(key: T): OnboardingItemState<T> | undefined {
const item = this.getItem(key);
if (!item?.state) return undefined;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!item?.state) return undefined; treats valid falsy states (e.g. 0, false, '') as “missing”, which could break onboarding items whose state isn’t an object.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

}

// Persist migrated data so we don't re-migrate next time
void this.setItemStateCore(key, state, scope, currentSchema);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void this.setItemStateCore(...) can reject and become an unhandled promise rejection (no await/.catch()), which is especially risky since it runs during reads (getItemState) and could surface as noisy runtime errors if storage fails.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

}

export function fromVersion(v: Version, includePre: false): `${number}.${number}.${number}`;
export function fromVersion(v: Version, includePre?: boolean): `${number}.${number}.${number}${string | undefined}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fromVersion overload return type includes ${string | undefined}, but the implementation always appends either '' or -${v.pre}—never undefined. This can make downstream typing misleading (e.g. suggesting an undefined suffix needs handling when it can’t occur).

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant