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

Lab2: Expose isProjectTemplateLevel and show icon in AI Chat #57886

Merged
merged 4 commits into from Apr 9, 2024

Conversation

sanchitmalhotra126
Copy link
Contributor

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:
Screenshot 2024-04-08 at 5 58 24 PM (2)

AI Chat presentation page with icon:
Screenshot 2024-04-08 at 5 58 57 PM (2)

Non-Lab2 lab with icon (default tooltip placement above icon):
Screenshot 2024-04-08 at 5 59 39 PM (2)

Links

https://codedotorg.atlassian.net/browse/LABS-671

Testing story

Tested with project template backed levels in Lab2 and outside of Lab2.

@@ -73,8 +78,14 @@ const AichatView: React.FunctionComponent = () => {
onChange: setViewMode,
};

const chatWorkspaceHeader =
viewMode === ViewMode.EDIT ? aichatI18n.aichatWorkspaceHeader() : botName;
const chatWorkspaceHeader = (
Copy link
Contributor

Choose a reason for hiding this comment

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

long term we could consider a common header component that checks the projectTemplateLevel value and adds the icon if necessary, but this seems reasonable for now!

Copy link
Contributor

@fisher-alice fisher-alice left a comment

Choose a reason for hiding this comment

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

Nice work! Thanks for taking care of this so quickly.

@sanchitmalhotra126 sanchitmalhotra126 merged commit 3d94ca6 into staging Apr 9, 2024
2 checks passed
@sanchitmalhotra126 sanchitmalhotra126 deleted the sanchit/lab2-project-template-icon branch April 9, 2024 19:29
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

3 participants