Skip to content

feat: implement mentoring page#57

Open
ihor-romaniuk wants to merge 2 commits intoaxm-mentoring-appfrom
romaniuk/implement-mentoring-page
Open

feat: implement mentoring page#57
ihor-romaniuk wants to merge 2 commits intoaxm-mentoring-appfrom
romaniuk/implement-mentoring-page

Conversation

@ihor-romaniuk
Copy link

Description: implement mentoring page

Copy link

@PKulkoRaccoonGang PKulkoRaccoonGang left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Left some comments

@@ -0,0 +1,23 @@
import React from 'react';

Choose a reason for hiding this comment

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

[optional]: Let's try remove this import


const MentoringTab = ({ intl }) => (
<>
<h2 aria-level="1" className="h2 my-3">

Choose a reason for hiding this comment

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

[nit]: I wonder if it is necessary to change aria-level="1" for the <h2> heading? By default, all headers have aria-level equal to the header level (<h2> - aria-level="2"), in this case you increase aria-level (<h2> - aria-level="1").

I looked, on other tabs (Progress, Dates) a similar aria attribute is added in case of using another tag, different from the heading (<div role="heading" aria-level="1" class="h2 my-3">Important dates</div>).

Let's change this a <h1> level heading and remove aria-level

Suggested change
<h2 aria-level="1" className="h2 my-3">
<h1 className="my-3">

}, [url]);

const sendMessage = (msg) => {
if (socket.current.readyState === WebSocket.OPEN) {

Choose a reason for hiding this comment

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

[optional]: Let's additionally check for the presence of socket.current

Suggested change
if (socket.current.readyState === WebSocket.OPEN) {
if (socket.current && socket.current.readyState === WebSocket.OPEN) {

const messages = defineMessages({
title: {
id: 'learning.mentoring.title',
defaultMessage: 'Mentoring Assistant',

Choose a reason for hiding this comment

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

[optional]: Similar to Your progress (first letter is capital, rest are lowercase)

Suggested change
defaultMessage: 'Mentoring Assistant',
defaultMessage: 'Mentoring assistant',

title: {
id: 'learning.mentoring.title',
defaultMessage: 'Mentoring Assistant',
description: 'The title of mentoring tab (course timeline).',

Choose a reason for hiding this comment

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

Suggested change
description: 'The title of mentoring tab (course timeline).',
description: 'The title of mentoring tab (course outline).',

const { courseId } = useSelector(state => state.courseHome);

const { sendMessage } = useWebSocket({
url: `ws://${OPENEDX_AI_SOCKET_DOMAIN}/ws/chatgpt/${courseId}/`,

Choose a reason for hiding this comment

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

[question]: Have you tried to test this functionality on different courses?

Choose a reason for hiding this comment

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

It would also be useful to understand what limitations we have related to the course size + how the provision of course context works if it is empty.

const data = JSON.parse(e.data);
onMessage(data);
} catch (err) {
onMessage({ text: e.data });

Choose a reason for hiding this comment

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

[optional]: Should we display an error message in the catch block?

gap={2}
ref={idx === chatMessages.length - 1 ? lastMessageRef : null}
>
{msg.sender === 'ai' && (

Choose a reason for hiding this comment

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

[optional]: Let's move all senders to the SENDER_TYPES or SENDERS object

For example:

const SENDERS = {
    STUDENT: 'student',
    AI: 'ai',
    ...
}

<Stack
key={idx} // eslint-disable-line react/no-array-index-key
direction="horizontal"
className={`w-100 fade-in ${msg.sender === 'student' ? 'justify-content-end' : 'justify-content-start'}`}

Choose a reason for hiding this comment

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

Suggested change
className={`w-100 fade-in ${msg.sender === 'student' ? 'justify-content-end' : 'justify-content-start'}`}
className={`w-100 fade-in ${msg.sender === SENDERS.STUDENT ? 'justify-content-end' : 'justify-content-start'}`}

import messages from './messages';
import './MentoringTab.scss';

const MentoringTab = ({ intl }) => (

Choose a reason for hiding this comment

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

[optional]: Let's add a little support message about what AI Mentoring is

Choose a reason for hiding this comment

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

As an additional support option, we can add a paragon product tour to quickly introduce the user to the mentoring application. What do you think?

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.

2 participants