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

Add a Tour Component #1632

Merged
merged 55 commits into from Sep 19, 2023
Merged

Add a Tour Component #1632

merged 55 commits into from Sep 19, 2023

Conversation

trymebytes
Copy link
Contributor

@trymebytes trymebytes commented May 31, 2023

What?

Add a site tour to GlotPress to show new users around and also draw attention to new features or improvements.

Why?

It may be difficult for new translators/contributors to get around the different and important features of translation.

How?

To add a tour and tour steps a filter like this can be used:

add_filter( 'gp_tour', function( ) {
	return array(
		'ui-intro' => [
			[
				'title' => 'UI Introduction Tour',
				'color' => '#3939c7',
			],
			[
				'selector' => '.revealing.filter',
				'html' => 'Click here to reveal the search field'
			],
			[
				'reveal' => '.revealing.filter',
				'selector' => '.filters-expanded input.is-primary',
				'html' => 'Click here to search',
			]
		],
		'translation-guide' => [
			[
				'title' => 'How to translate',
				'color' => '#f939c7',
			],
			[
				'selector' => '.source-string',
				'html' => 'This is the English text',
                                 // To add custom css to the tour item selector
                                 'css' => [
					'background' => 'blue',
				],
			],
			[
				'selector' => '.translation-actions .is-primary',
				'html' => 'Submit your translation',
			]
		],
	);
} );

Testing Instructions

Screenshots or screencast

gp-tour-3

@trymebytes trymebytes marked this pull request as draft May 31, 2023 23:40
@akirk akirk changed the base branch from local to develop June 5, 2023 14:16
@akirk akirk changed the title Site tour on translate.wordpress.org Add a Tour Component Jul 19, 2023
@trymebytes trymebytes force-pushed the site-tour branch 2 times, most recently from f0c3850 to 2daedfb Compare July 26, 2023 14:31
@trymebytes trymebytes changed the base branch from develop to local July 31, 2023 10:26
@trymebytes
Copy link
Contributor Author

Update: The steps as specified in the tour draft have been added.

tour-3

@pedro-mendonca
Copy link
Member

I would like to suggest using a single color for the popover element, e.g. assinging the GlotPress primary color to a new color var: gp-color-tour.

It also needs a few tweaks so that the dashed border doesn't change the UI rendering. I'm not sure if it's a good practice, but I've achieved some good results using a negative margin for the pulse-wrapper.
To test this, set a Tour with popovers in both Projects links (Create new and Projects per Locale) to see how the UI is currently shifting.

Also, instead of having CSS for Previous and Next, might be useful to use a generic CSS for the popover buttons and a primary-button class to highlight the Next.

imagem
imagem
imagem

I'll add a PR for the site-tour branch for you to test.

@trymebytes
Copy link
Contributor Author

Awesome! Thank you so much for the feedback @pedro-mendonca, looking forward to your PR!

@pedro-mendonca pedro-mendonca mentioned this pull request Aug 8, 2023
6 tasks
Base automatically changed from local to develop August 18, 2023 11:43
@trymebytes trymebytes changed the base branch from develop to local August 24, 2023 11:50
@trymebytes trymebytes changed the base branch from local to develop August 30, 2023 02:53
@trymebytes trymebytes changed the base branch from develop to local August 30, 2023 02:59
@trymebytes trymebytes changed the base branch from local to tour-prep August 30, 2023 16:14
@trymebytes trymebytes force-pushed the site-tour branch 3 times, most recently from 268f89f to 982666e Compare September 4, 2023 11:43
@trymebytes trymebytes marked this pull request as ready for review September 4, 2023 11:46
@trymebytes
Copy link
Contributor Author

@pedro-mendonca I cherry picked and applied some of your commits from your PR here since that branch has diverged significantly, thank you!

Copy link
Member

@akirk akirk left a comment

Choose a reason for hiding this comment

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

You can get stuck on the first step of the tour if the references are missing. While this is technically for WordPress/wordpress.org#172, the tour should be capable of skipping a step if it cannot find the pulse element.

assets/js/tour.js Outdated Show resolved Hide resolved
Copy link
Member

@akirk akirk left a comment

Choose a reason for hiding this comment

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

Works now for me!

@trymebytes trymebytes enabled auto-merge (squash) September 19, 2023 13:07
@amieiro amieiro enabled auto-merge (squash) September 19, 2023 13:16
@amieiro amieiro merged commit 30fd504 into develop Sep 19, 2023
6 checks passed
@amieiro amieiro deleted the site-tour branch September 19, 2023 13:26
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.

None yet

4 participants