Lab2: Expose isProjectTemplateLevel and show icon in AI Chat #57886
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Warning!!
The AP CSP Create Performance Task is in progress. The most critical dates are from April 3 - April 30, 2024. Please consider any risk introduced by this PR that could affect our students taking AP CSP. Code.org students taking AP CSP primarily use App Lab for their Create Task, however a small percent use Game Lab. Carefully consider whether your change has any risk of alterering, changing, or breaking anything in these two labs. Even small changes, such as a different button color, are considered significant during this time period. Reach out to the Student Learning team or Curriculum team for more details.
Description
Expose the
isProjectTemplateLevel
property in Lab2, and use that to show the ProjectTemplateWorkspaceIcon in the AI Chat header. The "projectTemplateLevelName" property comes automatically from the level's properties, so we just need to check if that property exists.Related PR to enable project template backed levels for AI Chat: #57885
There's probably some future discussion here on if Lab2 should somehow control showing that icon automatically, but currently since all Labs own their own UI entirely, it felt like it made sense to have AI Chat just show the icon.
AI Chat edit page with icon:
AI Chat presentation page with icon:
Non-Lab2 lab with icon (default tooltip placement above icon):
Links
https://codedotorg.atlassian.net/browse/LABS-671
Testing story
Tested with project template backed levels in Lab2 and outside of Lab2.