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
AI rubric product tour with intro js #57757
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo, so exciting to see this come together! Some initial comments are inline.
Top-level comment: the spec says "Tour should display the first time a user lands on a page with an editable rubric", but when I go to http://localhost-studio.code.org:3000/s/csd3-2023/lessons/11/levels/4 (as opposed to /5), I still see the tour. I think this looks like a bug -- it is confusing because while the tour works, the highlighted features then disappear since evaluation is not possible on that level.
@@ -52,12 +57,15 @@ export default function RubricContainer({ | |||
|
|||
const [feedbackAdded, setFeedbackAdded] = useState(false); | |||
|
|||
const [stepsEnabled, setStepsEnabled] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to productTour
? If these mean the same thing, I think it would be helpful for readability to name them consistently
dashboard/config/routes.rb
Outdated
@@ -1082,6 +1082,8 @@ | |||
get 'get_teacher_evaluations_for_all' | |||
get 'ai_evaluation_status_for_user' | |||
get 'ai_evaluation_status_for_all' | |||
get 'get_ai_rubrics_tour_seen' | |||
get 'update_ai_rubrics_tour_seen' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't safe -- please use PUT or POST for anything that can cause a state change.
const showSettings = | ||
onLevelForEvaluation && teacherHasEnabledAi && !stepsEnabled; | ||
|
||
// Steps for product tour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please extract product tour config (here through line 231) to a separate JS file to cut down on file size
{/* {showSettings && ( | ||
<RubricSettings | ||
productTour={stepsEnabled} | ||
visible={selectedTab === TAB_NAMES.SETTINGS} | ||
refreshAiEvaluations={fetchAiEvaluations} | ||
rubric={rubric} | ||
sectionId={sectionId} | ||
tabSelectCallback={tabSelectCallback} | ||
/> | ||
)} */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please re-enable or remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may be moot however if you are getting rid of the stepsEnabled
ternary
.introjs-overlay { | ||
position: absolute; | ||
box-sizing: content-box; | ||
z-index: 999999; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like a very high starting point, and the size of the numbers makes it difficult to see how they relate to each other. If possible I would suggest using numbers at most in the 100-200 range for improved readability. if another high z-index prevents this... let's take a follow-up item to reduce the arms race here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this issue looks like it could still use follow-up (in a later PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for splitting my comments up -- I've finished reviewing now. nice job pulling this together!
my other top-level feedback is that this should really have a UI test: https://codedotorg.atlassian.net/browse/AITT-575
alt={i18n.rubricAiHeaderText()} | ||
/> | ||
<span>{i18n.rubricAiHeaderText()}</span> | ||
{stepsEnabled ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing a lot more duplicated code between the two branches of this conditional compared to the number of differences. my recommendation would be to DRY this up and use this conditional inline to change the behavior each place a difference is needed. otherwise it seems like we are setting ourselves up for the product tour to lag or break as other updates are made to the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{/* {showSettings && ( | ||
<RubricSettings | ||
productTour={stepsEnabled} | ||
visible={selectedTab === TAB_NAMES.SETTINGS} | ||
refreshAiEvaluations={fetchAiEvaluations} | ||
rubric={rubric} | ||
sectionId={sectionId} | ||
tabSelectCallback={tabSelectCallback} | ||
/> | ||
)} */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may be moot however if you are getting rid of the stepsEnabled
ternary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
juuust one more comment 😅
|
||
expect(screen.findAllByText('Getting Started with AI Teaching Assistant')) | ||
.to.be.empty; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad to see you're leaning in to React Testing Library! Since it seems like things part way through the product tour could break, my recommendation would be to have some coverage of clicking through the tour. this seems important because people will inevitably be making changes without necessarily thinking about the tour, which risks breaking it.
hey Mark, since the launch deadline is coming up, I want to say the min bar for shipping this is (1) turn the GET into a PUT/POST, and (2) make it not show up on non-eval levels, and (3) if possible a tiny bit more unit test coverage. I think the rest can be deferred to a follow-up PR, as long as it's done before moving onto other tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to merge once tests are passing. once you're back next week, it would be great to make sure we have a list of any PR comments not addressed in order to hit the ship deadline (if any) so that we don't lose track of them.
@@ -39,6 +39,7 @@ Feature: Evaluate student code against rubrics using AI | |||
And element ".teacher-panel td:eq(1)" contains text "Aiden" | |||
And I click selector ".teacher-panel td:eq(1)" to load a new page | |||
And I wait for the page to fully load | |||
And I click selector ".introjs-skipbutton" if it exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the saucelabs video, it looks like the skipbutton is not getting clicked.
looking at this test step, it looks unreliable because when the "I wait for the page to fully load" step completes, the skipbutton may not have rendered yet. this kind of timing issue can often explain the frustrating issue of not being able to repro locally.
to prove/disprove, you could add a wait here (10 sec) to see if that fixes.
for a shippable solution, you could do something like:
- choose an element that will be in the DOM regardless of whether introjs is active, and render it differently when introjs is active
- wait for that element to load
- write a custom step that looks at that element and decides whether to wait for the skipbutton, and then click it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...at this point if the sleep statement fixes it, I think it could be ok to use that approach to get this PR unblocked, and do the "shippable" fix as a fast follow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nokondi I think this is a great workaround for the unit test issues. once again nice job pulling this all together! Looks good to merge. I am seeing one follow-up remaining, for the high z-indexes.
And I wait until element "h1:contains(How did we do?)" is visible | ||
And I wait until element ".introjs-tooltiptext" is visible | ||
And I click selector ".introjs-button:contains(Done)" once I see it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to complete the scenario, I would suggest additional steps which verifies that we're now back into a mode where the teacher can interact with the rubric UI. For example:
- verify contents of rubrics UI matches what it should look like for the current level (as opposed to the tour)
- switch tabs or learning goals, and confirm that the UI updates correspondingly
since this has been tested manually, this seems fine to do as a fast-follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the high z-index is actually part of the introjs module. I had to override their built-in css for some of our styling, so some elements (like the ones with the crazy z-index) are copied straight from their css.
.then(response => { | ||
return response.json(); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this as a way to make sure we do not read the response body/json twice
.introjs-overlay { | ||
position: absolute; | ||
box-sizing: content-box; | ||
z-index: 999999; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this issue looks like it could still use follow-up (in a later PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩
ugh! I see these now. boo z-index arms race. I agree in that case there is nothing to do about it then. |
Recording.2024-04-03.105240.mp4
Links
Figma Mock
Jira Ticket