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

AI rubric product tour with intro js #57757

Merged
merged 47 commits into from Apr 9, 2024
Merged

AI rubric product tour with intro js #57757

merged 47 commits into from Apr 9, 2024

Conversation

Nokondi
Copy link
Contributor

@Nokondi Nokondi commented Apr 3, 2024

  • Installed intro.js and intro.js react wrapper
  • Setup steps and placement of product tour
  • Created new scss theme to style product tour.
  • [Bonus: this PR also resolves the issue in AITT-515
Recording.2024-04-03.105240.mp4

Links

Figma Mock
Jira Ticket

@Nokondi Nokondi requested review from a team, etaderhold and davidsbailey and removed request for a team and etaderhold April 4, 2024 17:19
@Nokondi Nokondi marked this pull request as ready for review April 4, 2024 17:20
Copy link
Member

@davidsbailey davidsbailey left a 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);
Copy link
Member

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

@@ -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'
Copy link
Member

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
Copy link
Member

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

Comment on lines 349 to 358
{/* {showSettings && (
<RubricSettings
productTour={stepsEnabled}
visible={selectedTab === TAB_NAMES.SETTINGS}
refreshAiEvaluations={fetchAiEvaluations}
rubric={rubric}
sectionId={sectionId}
tabSelectCallback={tabSelectCallback}
/>
)} */}
Copy link
Member

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

Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

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)

Copy link
Member

@davidsbailey davidsbailey left a 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 ? (
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2024-04-04 at 2 31 57 PM

Screenshot 2024-04-04 at 2 32 10 PM

Comment on lines 349 to 358
{/* {showSettings && (
<RubricSettings
productTour={stepsEnabled}
visible={selectedTab === TAB_NAMES.SETTINGS}
refreshAiEvaluations={fetchAiEvaluations}
rubric={rubric}
sectionId={sectionId}
tabSelectCallback={tabSelectCallback}
/>
)} */}
Copy link
Member

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

Copy link
Member

@davidsbailey davidsbailey left a 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;
});
Copy link
Member

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.

@davidsbailey
Copy link
Member

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.

Copy link
Member

@davidsbailey davidsbailey left a 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.

@Nokondi Nokondi requested a review from a team as a code owner April 6, 2024 22:43
@@ -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
Copy link
Member

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:

  1. choose an element that will be in the DOM regardless of whether introjs is active, and render it differently when introjs is active
  2. wait for that element to load
  3. write a custom step that looks at that element and decides whether to wait for the skipbutton, and then click it

Copy link
Member

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

Copy link
Member

@davidsbailey davidsbailey left a 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.

Comment on lines 84 to 86
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
Copy link
Member

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.

Copy link
Contributor Author

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.

Comment on lines +125 to +127
.then(response => {
return response.json();
})
Copy link
Member

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;
Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

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

🤩

@davidsbailey
Copy link
Member

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.

ugh! I see these now. boo z-index arms race. I agree in that case there is nothing to do about it then.

@Nokondi Nokondi merged commit 41abb67 into staging Apr 9, 2024
1 of 2 checks passed
@Nokondi Nokondi deleted the install-intro-js branch April 9, 2024 22:39
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