From e854fc3d057bef118b6202ffb0684ffba412da5d Mon Sep 17 00:00:00 2001 From: Sol Dubock <94075844+sjd210@users.noreply.github.com> Date: Mon, 3 Nov 2025 10:00:38 +0000 Subject: [PATCH 01/39] Remove all Phy-specific references from item --- .../ContentSummaryListGroupItem.tsx | 59 ++++++------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx b/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx index c5a2178cf5..6fbbf1491f 100644 --- a/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx +++ b/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx @@ -9,10 +9,7 @@ import { generateQuestionTitle, isAda, isIntendedAudience, - isPhy, - notRelevantMessage, SEARCH_RESULT_TYPE, - siteSpecific, TAG_ID, TAG_LEVEL, tags, @@ -20,14 +17,13 @@ import { useUserViewingContext } from "../../../services"; import {Link} from "react-router-dom"; -import React, {useRef} from "react"; +import React from "react"; import {selectors, useAppSelector} from "../../../state"; -import {v4 as uuid_v4} from "uuid"; import {StageAndDifficultySummaryIcons} from "../StageAndDifficultySummaryIcons"; import {ShortcutResponse} from "../../../../IsaacAppTypes"; import {Markup} from "../markup"; import classNames from "classnames"; -import {ListGroup, ListGroupItem, UncontrolledTooltip} from "reactstrap"; +import {ListGroup, ListGroupItem} from "reactstrap"; import { CSSModule } from "reactstrap/types/lib/utils"; import { LLMFreeTextQuestionIndicator } from "../LLMFreeTextQuestionIndicator"; import { QuestionPropertyTags } from "../ContentPropertyTags"; @@ -46,7 +42,6 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar contentTypeVisibility?: ContentTypeVisibility; ignoreIntendedAudience?: boolean; }) => { - const componentId = useRef(uuid_v4().slice(0, 4)).current; const userContext = useUserViewingContext(); const user = useAppSelector(selectors.user.orNull); const isContentsIntendedAudience = ignoreIntendedAudience || isIntendedAudience(item.audience, userContext, user); @@ -94,7 +89,7 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar switch (item.type) { case (SEARCH_RESULT_TYPE.SHORTCUT): linkDestination = item.url; - icon = Shortcut icon; + icon = Shortcut icon; if (isAda) { typeLabel = "Shortcut"; } @@ -102,9 +97,6 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar case (DOCUMENT_TYPE.QUESTION): case (DOCUMENT_TYPE.FAST_TRACK_QUESTION): title = generateQuestionTitle(item); - if (isPhy) { - itemClasses += item.state === CompletionState.ALL_CORRECT ? "bg-success" : "text-info"; - } if (isAda) { typeLabel = "Question"; } @@ -115,24 +107,24 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar break; case (DOCUMENT_TYPE.CONCEPT): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.CONCEPT]}/${item.id}`; - icon = Concept page icon; + icon = Concept page icon; if (isAda) { typeLabel = "Concept"; } break; case (DOCUMENT_TYPE.EVENT): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.EVENT]}/${item.id}`; - icon = Event page icon; + icon = Event page icon; typeLabel = "Event"; break; case (DOCUMENT_TYPE.TOPIC_SUMMARY): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.TOPIC_SUMMARY]}/${item.id?.slice("topic_summary_".length)}`; - icon = Topic summary page icon; + icon = Topic summary page icon; typeLabel = "Topic"; break; case (DOCUMENT_TYPE.GENERIC): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.GENERIC]}/${item.id}`; - icon = Generic page icon; + icon = Generic page icon; if (isAda) { typeLabel = "Info"; } @@ -143,34 +135,25 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar return null; } - return + return - {contentTypeVisibility !== ContentTypeVisibility.FULLY_HIDDEN && - {siteSpecific( - icon, -
- {icon} - {contentTypeVisibility !== ContentTypeVisibility.ICON_ONLY && <> -
- {typeLabel} - } -
- )} + {contentTypeVisibility !== ContentTypeVisibility.FULLY_HIDDEN && +
+ {icon} + {contentTypeVisibility !== ContentTypeVisibility.ICON_ONLY && <> +
+ {typeLabel} + } +
} -
+
- + {title ?? ""} - {isPhy && typeLabel && - ({typeLabel}) - }
- {(isPhy && item.summary) &&
- {item.summary} -
} {(!item.summary || deviceSize === "xs") && item.subtitle &&
{item.subtitle}
} @@ -182,12 +165,6 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar
}
- {isPhy && !isContentsIntendedAudience &&
- - - {`This content has ${notRelevantMessage(userContext)}.`} - -
}
{audienceViews && audienceViews.length > 0 && }
From da8f7744a30643f738399896e789dda0e9bc3b93 Mon Sep 17 00:00:00 2001 From: Sol Dubock <94075844+sjd210@users.noreply.github.com> Date: Mon, 3 Nov 2025 10:28:07 +0000 Subject: [PATCH 02/39] Make Ada-specific references into generic ones --- .../ContentSummaryListGroupItem.tsx | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx b/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx index 6fbbf1491f..24b74042be 100644 --- a/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx +++ b/src/app/components/elements/list-groups/ContentSummaryListGroupItem.tsx @@ -7,7 +7,6 @@ import { documentTypePathPrefix, filterAudienceViewsByProperties, generateQuestionTitle, - isAda, isIntendedAudience, SEARCH_RESULT_TYPE, TAG_ID, @@ -59,7 +58,7 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar titleClasses += itemSubject.id; } const hierarchyTags = tags.getByIdsAsHierarchy((item.tags || []) as TAG_ID[]) - .filter((_t, i) => !isAda || i !== 0); // CS always has Computer Science at the top level + .filter((_t, i) => i !== 0); // CS always has Computer Science at the top level let questionIconLabel, questionIcon; switch(item.state) { @@ -90,16 +89,12 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar case (SEARCH_RESULT_TYPE.SHORTCUT): linkDestination = item.url; icon = Shortcut icon; - if (isAda) { - typeLabel = "Shortcut"; - } + typeLabel = "Shortcut"; break; case (DOCUMENT_TYPE.QUESTION): case (DOCUMENT_TYPE.FAST_TRACK_QUESTION): title = generateQuestionTitle(item); - if (isAda) { - typeLabel = "Question"; - } + typeLabel = "Question"; linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.QUESTION]}/${item.id}`; icon = questionIcon; audienceViews = filterAudienceViewsByProperties(determineAudienceViews(item.audience), AUDIENCE_DISPLAY_FIELDS); @@ -108,9 +103,7 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar case (DOCUMENT_TYPE.CONCEPT): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.CONCEPT]}/${item.id}`; icon = Concept page icon; - if (isAda) { - typeLabel = "Concept"; - } + typeLabel = "Concept"; break; case (DOCUMENT_TYPE.EVENT): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.EVENT]}/${item.id}`; @@ -125,9 +118,7 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar case (DOCUMENT_TYPE.GENERIC): linkDestination = `/${documentTypePathPrefix[DOCUMENT_TYPE.GENERIC]}/${item.id}`; icon = Generic page icon; - if (isAda) { - typeLabel = "Info"; - } + typeLabel = "Info"; break; default: // Do not render this item if there is no matching DOCUMENT_TYPE @@ -136,8 +127,8 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar } return - - {contentTypeVisibility !== ContentTypeVisibility.FULLY_HIDDEN && + + {contentTypeVisibility !== ContentTypeVisibility.FULLY_HIDDEN &&
{icon} {contentTypeVisibility !== ContentTypeVisibility.ICON_ONLY && <> @@ -146,10 +137,10 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar }
} -
+
- + {title ?? ""} @@ -169,7 +160,7 @@ export const ContentSummaryListGroupItem = ({item, search, showBreadcrumb, noCar {audienceViews && audienceViews.length > 0 && }
- {isAda && !noCaret &&