IFT-455 Show GotIt tooltips during editor steps in onboarding lessons

GitOrigin-RevId: 7d7b2c7a32f1e7c1c01b28cd8b6401a38e7b08ca
This commit is contained in:
Konstantin Hudyakov
2023-03-21 18:32:25 +02:00
committed by intellij-monorepo-bot
parent 56f3f86a1f
commit bc56e3da3b
5 changed files with 72 additions and 5 deletions

View File

@@ -43,12 +43,15 @@ python.onboarding.type.division=Once you have discovered the problem in the code
The lesson script inserts {0} already.
python.onboarding.invoke.completion=Now let''s start typing {0} inside the parentheses {1}. \
<ide/> shows completion options automatically as you type. Alternatively, you can also press {2} and continue typing to reduce the list.
python.onboarding.invoke.completion.balloon=Start typing {0} to show all available completion options
python.onboarding.choose.values.item=Select {0} and press {1}.
python.onboarding.invoke.intention.for.warning.1=You have just fixed a bug, but you can make this code look even better.\
PyCharm highlights and adds a yellow bulb to the code lines that can be improved.
python.onboarding.invoke.intention.for.warning.2=Press {0} to preview the warnings and apply a quick-fix.
python.onboarding.invoke.intention.for.warning.balloon=Press {0} to show available quick-fixes
python.onboarding.select.fix=Apply the first item: {0}. With this fix, your code looks neat.
python.onboarding.invoke.intention.for.code=Intentions also save your time and make coding easier. Let''s use an intention to quickly add a return type for {0}. Press {1}.
python.onboarding.invoke.intention.for.code.balloon=Press {0} to show available intentions
python.onboarding.apply.intention=Select {0} and press {1}.
python.onboarding.complete.template=Type {0} and then press {1}.
python.onboarding.invoke.search.everywhere.1=While working in <ide/>, you might want to search for files in your project, symbols, classes, or even IDE actions. In this lesson, let''s search for the {0} action to make the {1} string low-case.

View File

@@ -454,13 +454,20 @@ class PythonOnboardingTourLesson :
setSample(sample.insertAtPosition(2, " / len(<caret>)"))
}
task {
val textToFind = "len()"
triggerOnEditorText(textToFind, centerOffset = textToFind.length - 1)
}
task {
text(PythonLessonsBundle.message("python.onboarding.type.division",
code(" / len()")))
code(" / len()")))
text(PythonLessonsBundle.message("python.onboarding.invoke.completion",
code("values"),
code("()"),
action("CodeCompletion")))
code("values"),
code("()"),
action("CodeCompletion")))
text(PythonLessonsBundle.message("python.onboarding.invoke.completion.balloon", code("values")),
LearningBalloonConfig(Balloon.Position.below, width = 0))
triggerAndBorderHighlight().listItem { // no highlighting
it.isToStringContains("values")
}
@@ -480,9 +487,16 @@ class PythonOnboardingTourLesson :
private fun LessonContext.contextActions() {
val reformatMessage = PyBundle.message("QFIX.reformat.file")
caret(",6")
task {
triggerOnEditorText("5,6")
}
task("ShowIntentionActions") {
text(PythonLessonsBundle.message("python.onboarding.invoke.intention.for.warning.1"))
text(PythonLessonsBundle.message("python.onboarding.invoke.intention.for.warning.2", action(it)))
text(PythonLessonsBundle.message("python.onboarding.invoke.intention.for.warning.balloon", action(it)),
LearningBalloonConfig(Balloon.Position.below, width = 0))
triggerAndBorderHighlight().listItem { item ->
item.isToStringContains(reformatMessage)
}
@@ -502,10 +516,17 @@ class PythonOnboardingTourLesson :
if (PythonLessonsUtil.isPython3Installed(project)) PyPsiBundle.message("INTN.specify.return.type.in.annotation")
else PyPsiBundle.message("INTN.specify.return.type.in.docstring")
caret("find_average")
caret("average")
task {
triggerOnEditorText("find_average", highlightBorder = true)
}
task("ShowIntentionActions") {
text(PythonLessonsBundle.message("python.onboarding.invoke.intention.for.code",
code("find_average"), action(it)))
text(PythonLessonsBundle.message("python.onboarding.invoke.intention.for.code.balloon", action(it)),
LearningBalloonConfig(Balloon.Position.below, width = 0, cornerToPointerDistance = 50))
triggerAndBorderHighlight().listItem { item ->
item.isToStringContains(returnTypeMessage(project))
}