From 5580dbdc520f4421711a8898976dcd025f34aea1 Mon Sep 17 00:00:00 2001 From: Jaycie Brown Date: Wed, 25 Mar 2026 11:05:50 +0000 Subject: [PATCH 01/17] Add temporary bookmark logic for testing --- .../list-groups/AbstractListViewItem.tsx | 4 +++ src/app/components/pages/QuestionFinder.tsx | 2 +- src/app/services/bookmarks.ts | 25 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/app/services/bookmarks.ts diff --git a/src/app/components/elements/list-groups/AbstractListViewItem.tsx b/src/app/components/elements/list-groups/AbstractListViewItem.tsx index 89cbcca7d2..bb05d6f50d 100644 --- a/src/app/components/elements/list-groups/AbstractListViewItem.tsx +++ b/src/app/components/elements/list-groups/AbstractListViewItem.tsx @@ -16,6 +16,7 @@ import { ContentPropertyTags } from "../ContentPropertyTags"; import { LLMFreeTextQuestionIndicator } from "../LLMFreeTextQuestionIndicator"; import { CrossTopicQuestionIndicator } from "../CrossTopicQuestionIndicator"; import { SupersededDeprecatedBoardContentWarning } from "../../navigation/SupersededDeprecatedWarning"; +import { useBookmarks } from "../../../services/bookmarks"; const Breadcrumb = ({breadcrumb}: {breadcrumb: string[]}) => { return <> @@ -132,6 +133,7 @@ type ALVIType = { audienceViews?: ViewingContext[]; status?: CompletionState; quizTag?: string; // this is for quick quizzes only, which are currently just gameboards; may change in future + bookmark?: boolean; // if set, displays a bookmark for logged-in users that will save the alvi to the user's bookmarks on click } | { // quizzes – have exclusive "preview" and "view test" buttons alviType: "quiz"; @@ -168,6 +170,7 @@ export type AbstractListViewItemProps = { export const AbstractListViewItem = ({title, icon, subject, subtitle, breadcrumb, tags, forceFullWidth, url, state, className, hasCaret, ...typedProps}: AbstractListViewItemProps) => { const deviceSize = useDeviceSize(); + const { isBookmarked, bookmarkItem } = useBookmarks(); const user = useAppSelector(selectors.user.orNull); const isItem = typedProps.alviType === "item"; @@ -259,6 +262,7 @@ export const AbstractListViewItem = ({title, icon, subject, subtitle, breadcrumb {isQuiz && } + {isItem && typedProps.bookmark && isTeacherOrAbove(user) &&