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

AiLab: Dynamic Instructions get overlay & Markdown #40469

Merged
merged 10 commits into from
May 18, 2021

Conversation

breville
Copy link
Member

@breville breville commented May 7, 2021

Dynamic Instructions now support optionally showing the overlay when the instructions are set or changed, drawing more attention to the new instructions. And they now use Markdown.

See code-dot-org/ml-playground#177 for AI Lab's usage.

Note that the Markdown usage is currently intended for text. It's unlikely that images will currently work properly, because they are loaded asynchronously by the browser, but the Dynamic Instructions system needs to measure the rendered Markdown immediately to determine the maximum size of the instructions. (Curriculum is okay with this limitation for AI Lab.)

AI Lab is also notified when the overlay is dismissed, allowing it to do things like start animations, as can be seen in the training scene in the below video.

dynamic-instructions-overlay-2.mov

@breville breville changed the title AiLab: Slow down Dynamic Instructions AiLab: Dynamic Instructions overlay May 12, 2021
Conflicts:
	apps/src/ailab/Ailab.js
@tess323
Copy link

tess323 commented May 12, 2021

My goodness this is cool! I am ooo until Friday afternoon so don’t want to hold this up. We’re using this component in lesson plans (will be live 5/25) so would like to have @bethanyaconnor take a look to see if we’re expecting disruption. I can test closer on staging.

@bethanyaconnor
Copy link
Contributor

We’re using this component in lesson plans (will be live 5/25) so would like to have @bethanyaconnor take a look to see if we’re expecting disruption.

Pulled this locally and did a quick check and it looks good to me. The change to the component we use in lesson plans is small. It looks like we don't display the write instructions for this type of level so I created https://codedotorg.atlassian.net/browse/PLAT-1045 to track that.

Small thing when I was testing -- looking like the instructions cover up the tooltip for the bubbles
Screen Shot 2021-05-12 at 3 27 29 PM

@@ -556,7 +556,8 @@ class TopInstructions extends Component {
isRtl ? styles.mainRtl : styles.main,
mainStyle,
{
height: height - RESIZER_HEIGHT
height: height - RESIZER_HEIGHT,
zIndex: 1021
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, is this an arbitrary z index? Do we have guidelines on what values to use or what the boundaries of z indexes are?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated this to show where it comes from (borrowed from InstructionsCSF) and only set it when the overlay is showing beneath a dynamic instruction, which prevents the broader regression that @bethanyaconnor caught. I'm not familiar with central guidelines, but there are occasional comments such as here. Thanks go to you and @bethanyaconnor for the great catches.

results: 'Review the results.',
saveModel: 'Save the trained model for use in App Lab.',
trainingSettings: 'Adjust column types here if you want.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we track or add a comment about removing this line when main-next is merged since the training settings screen no longer exists? (code-dot-org/ml-playground#178)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Given that we're about to reach that point, I just removed the unnecessary strings.

Copy link
Contributor

@Erin007 Erin007 left a comment

Choose a reason for hiding this comment

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

Couple tiny tidying requests, but looks good! This does a great job of drawing attention to the instructions. I want to make sure that the curriculum team is on board with the typing animation - it's great for a short line of text, but know they often have longer blocks of instructions and want markdown support to do more complicated things in the instructions panel so wonder how the animation would feel in those scenarios. If you've got a 👍 from them, then I don't have any concerns about the code.

@breville breville changed the title AiLab: Dynamic Instructions overlay AiLab: Dynamic Instructions get overlay & Markdown May 16, 2021
@breville
Copy link
Member Author

@erin Good point. I had intended this to be a quick stopgap measure before circling back to Markdown, but given our current point in the schedule, I just went ahead and switched over to Markdown now.

@breville breville requested a review from Erin007 May 16, 2021 04:35
Copy link

@tess323 tess323 left a comment

Choose a reason for hiding this comment

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

If things look good to Bethany this works for me!

@breville breville merged commit bbd351e into staging May 18, 2021
@breville breville deleted the ailab-slow-instructions branch May 18, 2021 00:02
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

5 participants