Skip to content

Commit f32066a

Browse files
authored
Remove teacher-notifications experiment flag after release (#70032)
* Remove teacher-notifications experiment flag after release * Fix tests
1 parent c71b6c3 commit f32066a

File tree

5 files changed

+93
-112
lines changed

5 files changed

+93
-112
lines changed

apps/src/aiDifferentiation/AiDiffFloatingActionButton.tsx

Lines changed: 43 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import {
1111
trySetLocalStorage,
1212
} from '@cdo/apps/utils';
1313
import i18n from '@cdo/locale';
14-
import aiFabWithIconBase from '@cdo/static/ai-bot-ta-base.png';
1514
import aiFabWithoutText from '@cdo/static/ai-bot-ta-no-text.png';
16-
import aiFabWithIconTag from '@cdo/static/ai-bot-ta-tag-cyan.png';
1715

1816
import {EVENTS, PLATFORMS} from '../metrics/AnalyticsConstants';
1917
import analyticsReporter from '../metrics/AnalyticsReporter';
@@ -186,65 +184,49 @@ const AiDiffFloatingActionButton: React.FC<AiDiffFloatingActionButtonProps> = ({
186184
onClick={handleClick}
187185
type="button"
188186
>
189-
{experiments.isEnabled('teacher-notifications') ? (
190-
<Badge
191-
badgeContent={
192-
unreadNotificationCount === 'loading'
193-
? 0
194-
: unreadNotificationCount > 0
195-
? unreadNotificationCount
196-
: 'TA'
197-
}
198-
color="error"
199-
overlap="circular"
200-
aria-label={
201-
unreadNotificationCount &&
202-
i18n.unreadNotificationsCount({
203-
unreadCount: unreadNotificationCount,
204-
})
205-
}
206-
sx={{
207-
height: '48px',
208-
width: '48px',
209-
'& .MuiBadge-badge': {
210-
backgroundColor:
211-
unreadNotificationCount === 'loading' ||
212-
unreadNotificationCount > 0
213-
? 'var(--background-error-primary)'
214-
: '#3CFFF8',
215-
color:
216-
unreadNotificationCount === 'loading' ||
217-
unreadNotificationCount > 0
218-
? 'var(--text-neutral-white-fixed)'
219-
: 'var(--text-neutral-black-fixed)',
220-
top: '5%',
221-
right: '5%',
222-
},
223-
}}
224-
className={style.badge}
225-
>
226-
<img
227-
alt="AI bot - unread notifications"
228-
src={aiFabWithoutText}
229-
onLoad={() => !isFabImageLoaded && setIsFabImageLoaded(true)}
230-
className={style.fabImageWithBadge}
231-
/>
232-
</Badge>
233-
) : (
234-
<div>
235-
<img
236-
alt="AI bot"
237-
src={aiFabWithIconBase}
238-
onLoad={() => !isFabImageLoaded && setIsFabImageLoaded(true)}
239-
/>
240-
<img
241-
alt="TA tag"
242-
src={aiFabWithIconTag}
243-
className={style.floatingActionButtonTag}
244-
onLoad={() => !isFabImageLoaded && setIsFabImageLoaded(true)}
245-
/>
246-
</div>
247-
)}
187+
<Badge
188+
badgeContent={
189+
unreadNotificationCount === 'loading'
190+
? 0
191+
: unreadNotificationCount > 0
192+
? unreadNotificationCount
193+
: 'TA'
194+
}
195+
color="error"
196+
overlap="circular"
197+
aria-label={
198+
unreadNotificationCount &&
199+
i18n.unreadNotificationsCount({
200+
unreadCount: unreadNotificationCount,
201+
})
202+
}
203+
sx={{
204+
height: '48px',
205+
width: '48px',
206+
'& .MuiBadge-badge': {
207+
backgroundColor:
208+
unreadNotificationCount === 'loading' ||
209+
unreadNotificationCount > 0
210+
? 'var(--background-error-primary)'
211+
: '#3CFFF8',
212+
color:
213+
unreadNotificationCount === 'loading' ||
214+
unreadNotificationCount > 0
215+
? 'var(--text-neutral-white-fixed)'
216+
: 'var(--text-neutral-black-fixed)',
217+
top: '5%',
218+
right: '5%',
219+
},
220+
}}
221+
className={style.badge}
222+
>
223+
<img
224+
alt="AI bot - unread notifications"
225+
src={aiFabWithoutText}
226+
onLoad={() => !isFabImageLoaded && setIsFabImageLoaded(true)}
227+
className={style.fabImageWithBadge}
228+
/>
229+
</Badge>
248230
</button>
249231
<AiDiffContainer
250232
context={context}

apps/src/aiDifferentiation/AiDiffSidebar.tsx

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -198,31 +198,29 @@ const AiDiffSidebar: React.FC<AiDiffSidebarProps> = ({
198198
</Box>
199199
{isCollapsed ? (
200200
<Box className={styles.sidebarActions}>
201-
{experiments.isEnabled('teacher-notifications') && (
202-
<WithTooltip
203-
tooltipProps={{
204-
tooltipId: 'notifications-button-tooltip',
205-
direction: 'onRight',
206-
text: commonI18n.notifications(),
207-
className: styles.sidebarActionTooltip,
208-
hideTail: true,
209-
size: 's',
210-
}}
211-
>
212-
<Button
213-
isIconOnly
214-
onClick={onNotificationsButtonClick}
215-
className={classNames(
216-
unreadNotificationCount > 0 && styles.buttonWithUnreadDot
217-
)}
218-
color="black"
219-
type="tertiary"
220-
size="s"
221-
icon={{iconName: 'bell'}}
222-
aria-label={commonI18n.notifications()}
223-
/>
224-
</WithTooltip>
225-
)}
201+
<WithTooltip
202+
tooltipProps={{
203+
tooltipId: 'notifications-button-tooltip',
204+
direction: 'onRight',
205+
text: commonI18n.notifications(),
206+
className: styles.sidebarActionTooltip,
207+
hideTail: true,
208+
size: 's',
209+
}}
210+
>
211+
<Button
212+
isIconOnly
213+
onClick={onNotificationsButtonClick}
214+
className={classNames(
215+
unreadNotificationCount > 0 && styles.buttonWithUnreadDot
216+
)}
217+
color="black"
218+
type="tertiary"
219+
size="s"
220+
icon={{iconName: 'bell'}}
221+
aria-label={commonI18n.notifications()}
222+
/>
223+
</WithTooltip>
226224
{experiments.isEnabled('daily-bytes') && (
227225
<WithTooltip
228226
tooltipProps={{
@@ -248,27 +246,25 @@ const AiDiffSidebar: React.FC<AiDiffSidebarProps> = ({
248246
</Box>
249247
) : (
250248
<Box className={styles.sidebarCategories}>
251-
{experiments.isEnabled('teacher-notifications') && (
252-
<button
253-
onClick={onNotificationsButtonClick}
254-
className={classNames(styles.categoryActionButton, {
255-
[styles.selected]: showNotifications,
256-
})}
257-
id="ui-notificationsButton"
258-
type="button"
259-
>
260-
<FontAwesomeV6Icon iconName="bell" />
261-
<span>{commonI18n.notifications()}</span>
262-
{unreadNotificationCount > 0 && (
263-
<FontAwesomeV6Icon
264-
iconName="circle"
265-
iconStyle="solid"
266-
className={styles.readAt}
267-
aria-label={i18n.unread()}
268-
/>
269-
)}
270-
</button>
271-
)}
249+
<button
250+
onClick={onNotificationsButtonClick}
251+
className={classNames(styles.categoryActionButton, {
252+
[styles.selected]: showNotifications,
253+
})}
254+
id="ui-notificationsButton"
255+
type="button"
256+
>
257+
<FontAwesomeV6Icon iconName="bell" />
258+
<span>{commonI18n.notifications()}</span>
259+
{unreadNotificationCount > 0 && (
260+
<FontAwesomeV6Icon
261+
iconName="circle"
262+
iconStyle="solid"
263+
className={styles.readAt}
264+
aria-label={i18n.unread()}
265+
/>
266+
)}
267+
</button>
272268
{experiments.isEnabled('daily-bytes') && (
273269
<button
274270
onClick={onDailyBytesButtonClick}

apps/src/aiDifferentiation/AiDiffWorkspace.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, {useCallback, useEffect, useState} from 'react';
22

33
import {PersonalizationData} from '@cdo/apps/aiDifferentiation/hooks/useTeachingProfileData';
4-
import experiments from '@cdo/apps/util/experiments';
54

65
import HttpClient from '../util/HttpClient';
76

@@ -125,7 +124,7 @@ const AiDiffWorkSpace: React.FC<AiDiffWorkSpaceProps> = ({
125124
showNotifications={showNotifications}
126125
unreadNotificationCount={unreadNotificationCount}
127126
/>
128-
{showNotifications && experiments.isEnabled('teacher-notifications') ? (
127+
{showNotifications ? (
129128
<AiDiffNotificationList aiPromptClick={aiPromptOutsideChatClicked} />
130129
) : (
131130
<AiDiffChat

apps/test/unit/aiDifferentiation/AiDiffFloatingActionButtonTest.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ describe('AIDiffFloatingActionButton', () => {
205205
});
206206
expect(fab.classList.contains('unittest-fab-pulse')).toBe(false);
207207

208-
const fabImage = screen.getByRole('img', {name: 'AI bot'});
208+
const fabImage = screen.getByRole('img', {
209+
name: 'AI bot - unread notifications',
210+
});
209211
fireEvent.load(fabImage);
210212
expect(fab.classList.contains('unittest-fab-pulse')).toBe(true);
211213
});
@@ -226,7 +228,9 @@ describe('AIDiffFloatingActionButton', () => {
226228
}
227229
);
228230
});
229-
const image = screen.getByRole('img', {name: 'AI bot'});
231+
const image = screen.getByRole('img', {
232+
name: 'AI bot - unread notifications',
233+
});
230234
fireEvent.load(image);
231235
const fab = screen.getByRole('button', {
232236
name: i18n.openOrCloseTeachingAssistant(),

dashboard/test/ui/features/teacher_tools/ai_diff/ai_differentiation_chat.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Feature: Send and receive messages in the AI differentiation chat
145145
# Teacher views lesson page and floating action button
146146
When I sign in as "Stilgar"
147147
And I get debug info for the current user
148-
And I am on "http://studio.code.org/teacher_dashboard/home?enableExperiments=teacher-notifications"
148+
And I am on "http://studio.code.org/teacher_dashboard/home"
149149
And I wait until element "h2:contains(Welcome, Stilgar)" is visible
150150
And element "#sign_in_or_user" contains text "Stilgar"
151151
And I wait until element "#ui-floatingActionButton" is visible

0 commit comments

Comments
 (0)