From 8b8c25b7dee1f3abec5911eb1bc49b7dedf7ba4a Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Wed, 21 May 2025 12:12:02 +0100 Subject: [PATCH 01/19] Prefer `history.replace` in concepts search --- src/app/services/search.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/services/search.ts b/src/app/services/search.ts index ff6f3ba1d4..5a60429695 100644 --- a/src/app/services/search.ts +++ b/src/app/services/search.ts @@ -23,7 +23,8 @@ export const pushConceptsToHistory = function(history: History, searchText: stri "query": encodeURIComponent(searchText), "types": subjects.join(","), }; - history.push({ + + history.replace({ // concepts (phy-only) has no "apply filters" button to imply a single search; as such we prefer replace pathname: history.location.pathname, search: queryString.stringify(pickBy(queryOptions), {encode: false}), }); From 25a19d6856e54555728b6607e47172e6f46fe7aa Mon Sep 17 00:00:00 2001 From: Alex Lewin Date: Wed, 21 May 2025 15:36:15 +0100 Subject: [PATCH 02/19] Realign units with value input Remove vertical margin from units selection to bring it back in line with the value input. Keep the margin on small screens to correct the caret position. --- src/app/components/content/IsaacNumericQuestion.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/content/IsaacNumericQuestion.tsx b/src/app/components/content/IsaacNumericQuestion.tsx index db1078d3d0..b976eb85c0 100644 --- a/src/app/components/content/IsaacNumericQuestion.tsx +++ b/src/app/components/content/IsaacNumericQuestion.tsx @@ -14,7 +14,7 @@ import { Row, UncontrolledTooltip } from "reactstrap"; -import {above, isAda, isPhy, siteSpecific, useCurrentQuestionAttempt, useDeviceSize} from "../../services"; +import {above, below, isAda, isPhy, siteSpecific, useCurrentQuestionAttempt, useDeviceSize} from "../../services"; import {IsaacQuestionProps} from "../../../IsaacAppTypes"; import {Markup} from "../elements/markup"; import classNames from "classnames"; @@ -129,7 +129,7 @@ const IsaacNumericQuestion = ({doc, questionId, validationResponse, readonly}: I {setIsOpen(!isOpen);}}> From 66265678a446ad601182d6ad40196b5a2b78cf48 Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Wed, 21 May 2025 12:12:02 +0100 Subject: [PATCH 03/19] Prefer `history.replace` in concepts search --- src/app/services/search.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/services/search.ts b/src/app/services/search.ts index ff6f3ba1d4..5a60429695 100644 --- a/src/app/services/search.ts +++ b/src/app/services/search.ts @@ -23,7 +23,8 @@ export const pushConceptsToHistory = function(history: History, searchText: stri "query": encodeURIComponent(searchText), "types": subjects.join(","), }; - history.push({ + + history.replace({ // concepts (phy-only) has no "apply filters" button to imply a single search; as such we prefer replace pathname: history.location.pathname, search: queryString.stringify(pickBy(queryOptions), {encode: false}), }); From 7ed3adf0b4b9d4641a4f9207a7fece2fd42583d2 Mon Sep 17 00:00:00 2001 From: Alex Lewin Date: Wed, 21 May 2025 15:36:15 +0100 Subject: [PATCH 04/19] Realign units with value input Remove vertical margin from units selection to bring it back in line with the value input. Keep the margin on small screens to correct the caret position. --- src/app/components/content/IsaacNumericQuestion.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/content/IsaacNumericQuestion.tsx b/src/app/components/content/IsaacNumericQuestion.tsx index db1078d3d0..b976eb85c0 100644 --- a/src/app/components/content/IsaacNumericQuestion.tsx +++ b/src/app/components/content/IsaacNumericQuestion.tsx @@ -14,7 +14,7 @@ import { Row, UncontrolledTooltip } from "reactstrap"; -import {above, isAda, isPhy, siteSpecific, useCurrentQuestionAttempt, useDeviceSize} from "../../services"; +import {above, below, isAda, isPhy, siteSpecific, useCurrentQuestionAttempt, useDeviceSize} from "../../services"; import {IsaacQuestionProps} from "../../../IsaacAppTypes"; import {Markup} from "../elements/markup"; import classNames from "classnames"; @@ -129,7 +129,7 @@ const IsaacNumericQuestion = ({doc, questionId, validationResponse, readonly}: I {setIsOpen(!isOpen);}}> From 2bf054d7b0cdb58f46b8aebcebfa6610d6c2dffd Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Thu, 22 May 2025 10:14:45 +0100 Subject: [PATCH 05/19] Add "coming soon" to quick quiz cards --- src/app/components/pages/subjectLandingPageComponents.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/pages/subjectLandingPageComponents.ts b/src/app/components/pages/subjectLandingPageComponents.ts index 873b095691..f06b2a4220 100644 --- a/src/app/components/pages/subjectLandingPageComponents.ts +++ b/src/app/components/pages/subjectLandingPageComponents.ts @@ -68,7 +68,8 @@ const CoreSkillsCard = (context: NonNullable>): ListV }, icon: {type: "hex", icon: "icon-quiz"}, subject: context.subject, - linkTags: [{tag: "Practise a core skill", url: extendUrl(context, 'quick_quizzes')}] + linkTags: [{tag: "Practise a core skill", url: extendUrl(context, 'quick_quizzes')}], + state: AbstractListViewItemState.COMING_SOON, }); const GlossaryCard = (context: NonNullable>): ListViewCardProps => ({ From 317a1253ede63592698223e690bf0f5ccf62b27c Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Thu, 22 May 2025 10:44:39 +0100 Subject: [PATCH 06/19] Rephrase and better position numeric entry help box --- .../components/content/IsaacNumericQuestion.tsx | 16 +++++++--------- src/scss/phy/questions.scss | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/app/components/content/IsaacNumericQuestion.tsx b/src/app/components/content/IsaacNumericQuestion.tsx index b976eb85c0..5c14af473b 100644 --- a/src/app/components/content/IsaacNumericQuestion.tsx +++ b/src/app/components/content/IsaacNumericQuestion.tsx @@ -107,7 +107,7 @@ const IsaacNumericQuestion = ({doc, questionId, validationResponse, readonly}: I - +
Value @@ -155,15 +155,13 @@ const IsaacNumericQuestion = ({doc, questionId, validationResponse, readonly}: I
} - {!readonly && isPhy && above['md'](deviceSize) && <> -
- -
+ {!readonly && isPhy && above['md'](deviceSize) && + {tooltip} - } + }
diff --git a/src/scss/phy/questions.scss b/src/scss/phy/questions.scss index e97f523213..ea25643fb2 100644 --- a/src/scss/phy/questions.scss +++ b/src/scss/phy/questions.scss @@ -106,6 +106,7 @@ .numeric-question { .numeric-help.numeric-help { color: $color-neutral-900; + font-size: 0.875rem; } .unit-selection { From 3c125de33fb3f75b2ccf08ae0b5dc7a306b8c90a Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Thu, 22 May 2025 14:53:37 +0100 Subject: [PATCH 07/19] Set Phy's default tab style to `dropdowns` --- src/app/components/elements/Tabs.tsx | 2 +- src/app/components/pages/AssignmentProgress.tsx | 2 +- src/app/components/pages/MyProgress.tsx | 2 +- src/app/components/pages/books_old/maths_book_gcse.tsx | 2 +- src/app/components/pages/books_old/phys_book_gcse.tsx | 2 +- src/app/components/pages/quizzes/MyQuizzes.tsx | 2 +- src/app/components/pages/quizzes/SetQuizzes.tsx | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/components/elements/Tabs.tsx b/src/app/components/elements/Tabs.tsx index adf4afa375..372fef95a5 100644 --- a/src/app/components/elements/Tabs.tsx +++ b/src/app/components/elements/Tabs.tsx @@ -100,7 +100,7 @@ const DropdownNavbar = ({children, activeTab, changeTab, tabTitleClass=""}: Tabs export const Tabs = (props: TabsProps) => { const { className="", tabContentClass="", children, activeTabOverride, onActiveTabChange, - deselectable=false, refreshHash, expandable, style="tabs" + deselectable=false, refreshHash, expandable, style=(siteSpecific("dropdowns", "tabs")), } = props; const [activeTab, setActiveTab] = useState(activeTabOverride || 1); diff --git a/src/app/components/pages/AssignmentProgress.tsx b/src/app/components/pages/AssignmentProgress.tsx index e4b0652326..bfd0ad8aab 100644 --- a/src/app/components/pages/AssignmentProgress.tsx +++ b/src/app/components/pages/AssignmentProgress.tsx @@ -391,7 +391,7 @@ const GroupDetails = ({group, user}: {group: AppGroup, user: RegisteredUserDTO}) {/* Only full teachers can see the tests tab */} {pageSettings.isTeacher - ? + ? {{ [`Assignments (${assignments.length || 0})`]: assignmentTabComponents, [`Tests (${quizAssignments.length || 0})`]: quizTabComponents diff --git a/src/app/components/pages/MyProgress.tsx b/src/app/components/pages/MyProgress.tsx index 6434dd11a1..e44459eea6 100644 --- a/src/app/components/pages/MyProgress.tsx +++ b/src/app/components/pages/MyProgress.tsx @@ -120,7 +120,7 @@ const MyProgress = withRouter((props: MyProgressProps) => { - { + { const flush = tabRefs[tabIndex - 1].current; if (flush) { // Don't call the flush in an event handler that causes the render, that's too early. diff --git a/src/app/components/pages/books_old/maths_book_gcse.tsx b/src/app/components/pages/books_old/maths_book_gcse.tsx index 54e875654b..a8122989a9 100644 --- a/src/app/components/pages/books_old/maths_book_gcse.tsx +++ b/src/app/components/pages/books_old/maths_book_gcse.tsx @@ -20,7 +20,7 @@ export const MathsBookGcse = () => {
- + {{ 'Boards for Class and Homework':

Chapters:

diff --git a/src/app/components/pages/books_old/phys_book_gcse.tsx b/src/app/components/pages/books_old/phys_book_gcse.tsx index b8f3110d93..393b723269 100644 --- a/src/app/components/pages/books_old/phys_book_gcse.tsx +++ b/src/app/components/pages/books_old/phys_book_gcse.tsx @@ -20,7 +20,7 @@ export const PhysBookGcse = () => {
- + {{ 'Boards for Class and Homework':

Chapters:

diff --git a/src/app/components/pages/quizzes/MyQuizzes.tsx b/src/app/components/pages/quizzes/MyQuizzes.tsx index 5c0a3ea580..943f80e68c 100644 --- a/src/app/components/pages/quizzes/MyQuizzes.tsx +++ b/src/app/components/pages/quizzes/MyQuizzes.tsx @@ -449,7 +449,7 @@ const MyQuizzesPageComponent = ({user}: QuizzesPageProps) => { setQuizStatusFilter={setQuizStatusFilter} activeTab={tabOverride ?? 1} displayMode={displayMode} setDisplayMode={setDisplayMode}/> } /> - { + { history.replace({...history.location, hash: tabAnchors[index - 1]}); setBoardOrder(index === 1 ? QuizzesBoardOrder.dueDate : QuizzesBoardOrder.title); }}> diff --git a/src/app/components/pages/quizzes/SetQuizzes.tsx b/src/app/components/pages/quizzes/SetQuizzes.tsx index ebbaebfe47..d21989feb3 100644 --- a/src/app/components/pages/quizzes/SetQuizzes.tsx +++ b/src/app/components/pages/quizzes/SetQuizzes.tsx @@ -394,7 +394,7 @@ const SetQuizzesPageComponent = ({user}: SetQuizzesPageProps) => { manageQuizzesGroupNameFilter={manageQuizzesGroupNameFilter} setManageQuizzesGroupNameFilter={setManageQuizzesGroupNameFilter}/>} - + {{ [siteSpecific("Set Tests", "Available tests")]: From 0deab679a1f4f1a9694793afb97b9a4253608f8b Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Fri, 23 May 2025 10:52:51 +0100 Subject: [PATCH 08/19] Prefer `IconButton` styling for scroll to top --- src/app/components/site/ScrollToTop.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/components/site/ScrollToTop.tsx b/src/app/components/site/ScrollToTop.tsx index b05d764989..22a4c8ffba 100644 --- a/src/app/components/site/ScrollToTop.tsx +++ b/src/app/components/site/ScrollToTop.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useEffect } from "react"; import classNames from "classnames"; import { siteSpecific } from "../../services"; -import { Button } from "reactstrap"; +import { IconButton } from "../elements/AffixButton"; export const ScrollToTop = ({mainContent}: {mainContent: React.MutableRefObject}) => { const [sticky, setSticky] = React.useState(false); @@ -18,16 +18,15 @@ export const ScrollToTop = ({mainContent}: {mainContent: React.MutableRefObject< }, [isSticky]); return siteSpecific( - , + />,