Skip to content

Conversation

@cnbrenci
Copy link
Contributor

@cnbrenci cnbrenci commented Feb 6, 2026

This PR adds alerts/notifications to the top of the course and unit overview pages for courses that require AI Chat Tools to function (i.e. have essential AI Chat Tools in one or more levels in the course)

image image image image

Links

Testing story

  • Manually tested that
    • the information alert shows up when the course contains essential AI Chat, and does not show up when the course does not contain essential AI Chat.
    • the red notification with the button shows up when the section has AI Chat Tools disabled for a course with essential AI Chat

Deployment strategy

  • the UI is behind an experiment, but the extra info in section summary etc is happening outside the experiment.

Follow-up work

PR Creation Checklist:

  • Tests provide adequate coverage
  • Privacy impacts have been documented
  • Security impacts have been documented
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Follow-up work items (including potential tech debt) are tracked and linked

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🖼️ Storybook Visual Comparison Report

✅ No Storybook eyes differences detected!

course_path: link,
course_offering_edit_path: for_edit && course_version&.course_offering ? edit_course_offering_path(course_version.course_offering.key) : nil
course_offering_edit_path: for_edit && course_version&.course_offering ? edit_course_offering_path(course_version.course_offering.key) : nil,
requires_ai_chat_tools: requires_ai_chat_tools?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to replace this with Erin's ai_chat_tools_dependency from #70681

@cnbrenci cnbrenci marked this pull request as ready for review February 10, 2026 01:11
@cnbrenci cnbrenci requested a review from a team as a code owner February 10, 2026 01:11
@cnbrenci cnbrenci requested a review from Erin007 February 10, 2026 01:11
@@ -0,0 +1,80 @@
import Alert, {alertTypes} from '@code-dot-org/component-library/alert';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Ok, I see what you mean about organizing all of these alerts together and consolidating where we can. I think that's probably fine to do as a follow up if it makes merging our separate PRs more complicated. Up to you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! I'll do a follow-up refactor

isOnTeacherDashboard: PropTypes.bool,
aiChatToolsDependency: PropTypes.oneOf(
Object.values(AiChatToolsDependency)
),
Copy link
Contributor

Choose a reason for hiding this comment

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

is this one required too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had it as required originally, but scripts/show.js doesn't pass it, and can't with the current impl since I'm getting it from the section summary and scripts/show.js is not in context of a section. It's also not in the designs to show this alert on the Unit page in that context, so I'm leaving it off for now. I should probably clarify with Molly whether she thinks we need it on the Unit page outside of teacher dashboard.

@cnbrenci cnbrenci force-pushed the cassi/tutor/permissions/section-assignment branch from b1a6106 to 21063ba Compare February 10, 2026 21:26
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.

wahoo! great progress! this is coming together 🎉

@cnbrenci cnbrenci requested a review from MollyPeredo February 11, 2026 19:28
Object.entries(APPLICATION_ALIASES).forEach(([alias, localPath]) => {
jestAliases[`${alias}/(.*)`] = `${localPath}/$1`;
// Anchor to avoid matching unrelated packages that merely contain `${alias}/`
jestAliases[`^${alias}/(.*)$`] = `${localPath}/$1`;
Copy link
Contributor Author

@cnbrenci cnbrenci Feb 11, 2026

Choose a reason for hiding this comment

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

@stephenliang I was getting this error when running my tests:

    
    Could not locate module ../../../../../../../node_modules/emotion-element-f0de968e.browser.esm.js mapped as:
    /home/cassi/code/code-dot-org/apps/node_modules/react/$1.
    
    Please check your configuration for these entries:
    {
      "moduleNameMapper": {
        "/react\/(.*)/": "/home/cassi/code/code-dot-org/apps/node_modules/react/$1"
      },
      "resolver": undefined
    }

and codex suggested this fix. It seemed to fix the problem, but I don't know much about webpack or jest so wanted to get your take on if this seems reasonable to do!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops noticed you are out sick. Sorry for the ping! asking in dev-support.

@MollyPeredo
Copy link

These look good to me! I'm wondering if we should change out the AI bot icon, since Karim is asking us to move away from using the bot entirely. Maybe we switch to the sparkles icon?

@cnbrenci
Copy link
Contributor Author

cnbrenci commented Feb 11, 2026

These look good to me! I'm wondering if we should change out the AI bot icon, since Karim is asking us to move away from using the bot entirely. Maybe we switch to the sparkles icon?

I think we probably need to get agreement from different folks to make a change like that since variations of the bot icon show up in the tutor UI. Let's discuss!

Dropped a discussion thread here but mostly just to set a slack reminder to continue the discussion once Tess is back.

@cnbrenci cnbrenci changed the title Tutor Permissions: WIP info alert & warning on course overview Tutor Permissions: Info alert & warning on course & unit overview Feb 11, 2026
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.

3 participants