Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement walkthrough state provider #3659

Merged
merged 12 commits into from
Nov 1, 2024

Conversation

nzaytsev
Copy link
Contributor

@nzaytsev nzaytsev commented Oct 9, 2024

Description

  • Map usage tracker data to context to automatically set walkthrough checkboxes
  • Adds progress line and badge to home view

Screenshot 2024-10-17 at 11 02 14

The feature is disabled. To enable use setting flag gitlens.test.newWalkthrough

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@nzaytsev nzaytsev linked an issue Oct 9, 2024 that may be closed by this pull request
4 tasks
@nzaytsev nzaytsev requested review from d13 and eamodio October 9, 2024 08:23
@nzaytsev nzaytsev force-pushed the features/3656-walkthrough-onboarding-checklist-revamp branch from 6cec0fd to 64c2313 Compare October 14, 2024 05:45
Copy link
Member

@d13 d13 left a comment

Choose a reason for hiding this comment

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

I think the approach context-key overall looks ok, but I think we can probably simplify WalkthroughStateProvider some. I've left some overall comments to take a look at.

NOTE: I spent a bit of time to re-enable a lot of feature changes to review this locally. Let's not do that in the future.

Comment on lines +113 to +116
export function entries<TKey extends PropertyKey, TVal>(o: Partial<Record<TKey, TVal>>): [TKey, TVal][] {
return Object.entries(o) as [TKey, TVal][];
}

Copy link
Member

Choose a reason for hiding this comment

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

Objects already have strong typing based on the object's shape, so this shouldn't be needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Native Object.entries typing doen't work correctly with constant/enum keys, it always considers that keys are strings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is an example
Screenshot 2024-10-17 at 10 30 41
Screenshot 2024-10-17 at 10 31 07

In this place it's important to me to know the correct key type. As an alternative I can add a simple assertion like

Object.entries(this.walkthroughByTracking).forEach(
			(entry) => {
				const [usageKey, walkthroughKey] = entry as [TrackedUsageKeys, WalkthroughContextKeys]
			},
		);

Copy link
Member

Choose a reason for hiding this comment

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

This worked fine for me:

(Object.entries(this.walkthroughByTracking) as [TrackedUsageKeys, WalkthroughContextKeys][])

src/webviews/apps/home/home.css.ts Outdated Show resolved Hide resolved
src/webviews/apps/home/home.css.ts Outdated Show resolved Hide resolved
src/telemetry/walkthroughStateProvider.ts Outdated Show resolved Hide resolved
"provider-jira": 61747
"provider-jira": 61747,
"play-button": 61748,
"rocket-filled": 61749
Copy link
Member

@d13 d13 Oct 17, 2024

Choose a reason for hiding this comment

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

I don't see rocket-filled used anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll use it instead of $(rocket)

Screenshot 2024-10-18 at 10 38 27

src/telemetry/walkthroughStateProvider.ts Outdated Show resolved Hide resolved
src/webviews/apps/home/components/onboarding.ts Outdated Show resolved Hide resolved
@nzaytsev nzaytsev force-pushed the features/3656-walkthrough-onboarding-checklist-revamp branch from 56e5711 to d9feb2b Compare October 18, 2024 03:46
@nzaytsev nzaytsev force-pushed the features/3656-walkthrough-onboarding-checklist-revamp branch from eb450ed to 5b4fbd3 Compare October 28, 2024 03:16
@nzaytsev nzaytsev force-pushed the features/3656-walkthrough-onboarding-checklist-revamp branch from a83c128 to 17d3152 Compare October 31, 2024 03:40
@nzaytsev nzaytsev force-pushed the features/3656-walkthrough-onboarding-checklist-revamp branch from 37b9dfa to 663ebbd Compare October 31, 2024 06:31
@d13 d13 merged commit de6e835 into main Nov 1, 2024
3 checks passed
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.

Walkthrough (onboarding checklist) revamp
2 participants