From c594962cc0bd8b65ba49f30faa8ef6f91858006b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 17:17:39 +0800 Subject: [PATCH 01/35] fix(deps): update dependency react-ace to v14 (#3136) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 54cef43cad..edd22feea9 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "query-string": "^9.0.0", "re-resizable": "^6.9.9", "react": "^18.3.1", - "react-ace": "^12.0.0", + "react-ace": "^14.0.0", "react-copy-to-clipboard": "^5.1.0", "react-debounce-render": "^8.0.2", "react-dom": "^18.3.1", diff --git a/yarn.lock b/yarn.lock index 434d1aa399..0688760849 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4195,7 +4195,7 @@ __metadata: languageName: node linkType: hard -"ace-builds@npm:^1.32.8, ace-builds@npm:^1.36.3, ace-builds@npm:^1.4.12": +"ace-builds@npm:^1.36.3, ace-builds@npm:^1.4.12": version: 1.36.3 resolution: "ace-builds@npm:1.36.3" checksum: 10c0/7d7a35f393cd70555d559afcc0521dcda7fe78585cdfd41525a7bd9d59115f8b9f40ac3ff597907faf2ac2f71e1174c6797df698df48a8041c6b6433dba316b5 @@ -7348,7 +7348,7 @@ __metadata: query-string: "npm:^9.0.0" re-resizable: "npm:^6.9.9" react: "npm:^18.3.1" - react-ace: "npm:^12.0.0" + react-ace: "npm:^14.0.0" react-copy-to-clipboard: "npm:^5.1.0" react-debounce-render: "npm:^8.0.2" react-dom: "npm:^18.3.1" @@ -11279,19 +11279,19 @@ __metadata: languageName: node linkType: hard -"react-ace@npm:^12.0.0": - version: 12.0.0 - resolution: "react-ace@npm:12.0.0" +"react-ace@npm:^14.0.0": + version: 14.0.1 + resolution: "react-ace@npm:14.0.1" dependencies: - ace-builds: "npm:^1.32.8" + ace-builds: "npm:^1.36.3" diff-match-patch: "npm:^1.0.5" lodash.get: "npm:^4.4.2" lodash.isequal: "npm:^4.5.0" prop-types: "npm:^15.8.1" peerDependencies: - react: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 - react-dom: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 - checksum: 10c0/e7f33d4f0910f482e939f321db8f5a8bb7fe0bf40a9db0cde12ed2b368e8c77fc2683b2fb0737cd88216f732258e363705f2c6cfbbcaabced3fba8eff7fb43ad + react: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10c0/dbc77970836f13bad88365903d077edd68cc1955857290475bc067e0b801181c1d60a9ee08cf89b20895fe312dbb169c072c5b23338d7176f9f658db7929732f languageName: node linkType: hard From 1f7f36e05b3f835bd1e63488b786b48096d51e45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 09:30:30 +0000 Subject: [PATCH 02/35] chore(deps): update dependency npm-run-all2 to v8 (#3137) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index edd22feea9..1f5e6c93fa 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,7 @@ "identity-obj-proxy": "^3.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "npm-run-all2": "^7.0.0", + "npm-run-all2": "^8.0.0", "os-browserify": "^0.3.0", "path": "^0.12.7", "path-browserify": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index 0688760849..bdc58315d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5725,7 +5725,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -7337,7 +7337,7 @@ __metadata: mdast-util-from-markdown: "npm:^2.0.0" mdast-util-to-hast: "npm:^13.0.0" normalize.css: "npm:^8.0.1" - npm-run-all2: "npm:^7.0.0" + npm-run-all2: "npm:^8.0.0" os-browserify: "npm:^0.3.0" path: "npm:^0.12.7" path-browserify: "npm:^1.0.1" @@ -10139,7 +10139,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.0, minimatch@npm:^9.0.4": +"minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" dependencies: @@ -10442,14 +10442,14 @@ __metadata: languageName: node linkType: hard -"npm-run-all2@npm:^7.0.0": - version: 7.0.1 - resolution: "npm-run-all2@npm:7.0.1" +"npm-run-all2@npm:^8.0.0": + version: 8.0.4 + resolution: "npm-run-all2@npm:8.0.4" dependencies: ansi-styles: "npm:^6.2.1" - cross-spawn: "npm:^7.0.3" + cross-spawn: "npm:^7.0.6" memorystream: "npm:^0.3.1" - minimatch: "npm:^9.0.0" + picomatch: "npm:^4.0.2" pidtree: "npm:^0.6.0" read-package-json-fast: "npm:^4.0.0" shell-quote: "npm:^1.7.3" @@ -10459,7 +10459,7 @@ __metadata: npm-run-all2: bin/npm-run-all/index.js run-p: bin/run-p/index.js run-s: bin/run-s/index.js - checksum: 10c0/1f2438341473280f7f55015f04a9c5bbbb3226e8235ef50811f50f98514f10ff2ac1640da592e0d5a2e6c7b95060e1bb1c7a86b5177fa746151912ac99a8f3b7 + checksum: 10c0/cfc2987df224e55456629301991b5fa6980cc644d1836fe3c22d74a4508512737d30389795b759bb5d659103e54281c59741ecdc0241cfd2615cb9bffbf7cceb languageName: node linkType: hard @@ -10935,6 +10935,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.2": + version: 4.0.2 + resolution: "picomatch@npm:4.0.2" + checksum: 10c0/7c51f3ad2bb42c776f49ebf964c644958158be30d0a510efd5a395e8d49cb5acfed5b82c0c5b365523ce18e6ab85013c9ebe574f60305892ec3fa8eee8304ccc + languageName: node + linkType: hard + "pidtree@npm:^0.6.0": version: 0.6.0 resolution: "pidtree@npm:0.6.0" From 1e1bf1df5e8fb9060a6cdb4ff3839c797e5382d0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 09:35:50 +0000 Subject: [PATCH 03/35] fix(deps): update dependency i18next to v25 (#3138) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 1f5e6c93fa..557ffc202b 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "flexboxgrid": "^6.3.1", "flexboxgrid-helpers": "^1.1.3", "hastscript": "^9.0.0", - "i18next": "^23.11.2", + "i18next": "^25.0.0", "i18next-browser-languagedetector": "^8.0.0", "java-slang": "^1.0.13", "js-cookie": "^3.0.5", diff --git a/yarn.lock b/yarn.lock index bdc58315d1..c0d927e525 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1436,6 +1436,13 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.27.1": + version: 7.27.6 + resolution: "@babel/runtime@npm:7.27.6" + checksum: 10c0/89726be83f356f511dcdb74d3ea4d873a5f0cf0017d4530cb53aa27380c01ca102d573eff8b8b77815e624b1f8c24e7f0311834ad4fb632c90a770fda00bd4c8 + languageName: node + linkType: hard + "@babel/template@npm:^7.22.15, @babel/template@npm:^7.26.9, @babel/template@npm:^7.27.0, @babel/template@npm:^7.3.3": version: 7.27.0 resolution: "@babel/template@npm:7.27.0" @@ -7321,7 +7328,7 @@ __metadata: hastscript: "npm:^9.0.0" https-browserify: "npm:^1.0.0" husky: "npm:^9.0.0" - i18next: "npm:^23.11.2" + i18next: "npm:^25.0.0" i18next-browser-languagedetector: "npm:^8.0.0" identity-obj-proxy: "npm:^3.0.0" java-slang: "npm:^1.0.13" @@ -8031,12 +8038,17 @@ __metadata: languageName: node linkType: hard -"i18next@npm:^23.11.2": - version: 23.11.2 - resolution: "i18next@npm:23.11.2" +"i18next@npm:^25.0.0": + version: 25.2.1 + resolution: "i18next@npm:25.2.1" dependencies: - "@babel/runtime": "npm:^7.23.2" - checksum: 10c0/1d33cc53eaa9e078534f8cf7fb2b79be5ec4314555ad1dafc5a5ff367b79ed1a735e9d17452f7bcc11777344e90613ebcf44ebc823e63c1036a6c26c35db014a + "@babel/runtime": "npm:^7.27.1" + peerDependencies: + typescript: ^5 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/9e8817bdb930c15467ba31edfd834dcfc0a8979bb04f089b8249547a5c50ded820c1cce224563fc1dfe0a6f51e67e0e2d5231fb80a50fd7bd95320f120dfd0ae languageName: node linkType: hard From f91764bff25fb096cd6dc5314b32fbdf8d577799 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Mon, 16 Jun 2025 22:02:30 +0800 Subject: [PATCH 04/35] chore: update yarn.lock --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index c0d927e525..86c90d9cc3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13728,11 +13728,11 @@ __metadata: "typescript@patch:typescript@npm%3A^5.8.2#optional!builtin": version: 5.8.2 - resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin::version=5.8.2&hash=5786d5" + resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin::version=5.8.2&hash=b45daf" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/5448a08e595cc558ab321e49d4cac64fb43d1fa106584f6ff9a8d8e592111b373a995a1d5c7f3046211c8a37201eb6d0f1566f15cdb7a62a5e3be01d087848e2 + checksum: 10c0/8a6cd29dfb59bd5a978407b93ae0edb530ee9376a5b95a42ad057a6f80ffb0c410489ccd6fe48d1d0dfad6e8adf5d62d3874bbd251f488ae30e11a1ce6dabd28 languageName: node linkType: hard From 5ccd67f9a62bf2dbbe506e11d55d8a1698623c9e Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Wed, 26 Mar 2025 10:42:16 +0800 Subject: [PATCH 05/35] feat: make editor work with playground again --- src/commons/application/Application.tsx | 15 +++++-------- .../AssessmentWorkspace.tsx | 4 +++- .../workspace/reducers/editorReducer.ts | 12 ++++++++-- src/features/vscode/messages.ts | 22 +++++++++++++++++-- src/pages/playground/Playground.tsx | 9 ++++++++ 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 31f2b666de..e65b2dd305 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -116,17 +116,12 @@ const Application: React.FC = () => { } break; case MessageTypeNames.Text: - const code = message.code; + const { workspaceLocation, code } = message; console.log(`FRONTEND: TextMessage: ${code}`); - // TODO: Don't change ace editor directly - // const elements = document.getElementsByClassName('react-ace'); - // if (elements.length === 0) { - // return; - // } - // // @ts-expect-error: ace is not available at compile time - // const editor = ace.edit(elements[0]); - // editor.setValue(code); - dispatch(WorkspaceActions.updateEditorValue('assessment', 0, code)); + dispatch(WorkspaceActions.updateEditorValue(workspaceLocation, 0, code)); + break; + case MessageTypeNames.EvalEditor: + dispatch(WorkspaceActions.evalEditor(message.workspaceLocation)); break; } }); diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 20138018e5..353a1ad87c 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -391,7 +391,9 @@ const AssessmentWorkspace: React.FC = props => { ); handleClearContext(question.library, true); handleUpdateHasUnsavedChanges(false); - sendToWebview(Messages.NewEditor(`assessment${assessment.id}`, props.questionId, '')); + sendToWebview( + Messages.NewEditor(workspaceLocation, `assessment${assessment.id}`, props.questionId, '') + ); if (options.editorValue) { // TODO: Hardcoded to make use of the first editor tab. Refactoring is needed for this workspace to enable Folder mode. handleEditorValueChange(0, options.editorValue); diff --git a/src/commons/workspace/reducers/editorReducer.ts b/src/commons/workspace/reducers/editorReducer.ts index fa83906b49..e907173f45 100644 --- a/src/commons/workspace/reducers/editorReducer.ts +++ b/src/commons/workspace/reducers/editorReducer.ts @@ -1,5 +1,9 @@ import { ActionReducerMapBuilder } from '@reduxjs/toolkit'; -import Messages, { sendToWebview } from 'src/features/vscode/messages'; +import Messages, { + isVscWorkspaceLocation, + sendToWebview, + VscWorkspaceLocation +} from 'src/features/vscode/messages'; import WorkspaceActions from '../WorkspaceActions'; import { getWorkspaceLocation } from '../WorkspaceReducer'; @@ -54,7 +58,11 @@ export const handleEditorActions = (builder: ActionReducerMapBuilder { diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 4d0dbf15d2..bc4a3d9410 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -2,21 +2,39 @@ // It also needs to be copied to source-academy/frontend:src/features/vscode/messages.ts // Ideally it is split into multiple files, but for ease of copying, it is kept as one file. +/** A subset of the WorkspaceLocation type found in source-academy/frontend */ +const VscWorkspaceLocationArray = ['assessment', 'playground']; +export const isVscWorkspaceLocation = (s: any) => VscWorkspaceLocationArray.includes(s); +export type VscWorkspaceLocation = 'assessment' | 'playground'; + // ================================================================================ // Message type definitions // ================================================================================ +// Note to devs: Ctrl+clicking each type will not work. Use a search instead. const Messages = createMessages({ /** Sent from the iframe to the extension */ ExtensionPing: () => ({}), /** Sent from the extension to the iframe */ ExtensionPong: (token: string | null) => ({ token }), IsVsc: () => ({}), - NewEditor: (assessmentName: string, questionId: number, code: string) => ({ + NewEditor: ( + workspaceLocation: VscWorkspaceLocation, + assessmentName: string, + questionId: number, + code: string + ) => ({ + workspaceLocation, assessmentName, questionId, code }), - Text: (code: string) => ({ code }) + Text: (workspaceLocation: VscWorkspaceLocation, code: string) => ({ + workspaceLocation, + code + }), + EvalEditor: (workspaceLocation: VscWorkspaceLocation) => ({ + workspaceLocation: workspaceLocation + }) }); export default Messages; diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 02bd08ee99..e0b910c279 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -41,6 +41,7 @@ import { shortenURL, updateShortURL } from 'src/features/playground/PlaygroundActions'; +import Messages, { sendToWebview } from 'src/features/vscode/messages'; import { getDefaultFilePath, @@ -373,6 +374,14 @@ const Playground: React.FC = props => { [handleEditorValueChange] ); + useEffect(() => { + // Only the playground is expected to work with VSC for now + if (workspaceLocation === 'sicp') { + return; + } + sendToWebview(Messages.NewEditor(workspaceLocation, 'playground', 1, '')); + }, []); + // const onChangeTabs = useCallback( // ( // newTabId: SideContentType, From 909070653b54bfbd005ec6fb312a5ae7208cda33 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Wed, 26 Mar 2025 11:54:42 +0800 Subject: [PATCH 06/35] fix: don't trigger mobile breakpoints when in VSC --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 3 ++- src/pages/playground/Playground.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 353a1ad87c..d8d094dcc6 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -96,6 +96,7 @@ const AssessmentWorkspace: React.FC = props => { const [sessionId, setSessionId] = useState(''); const [isSubmitted, setIsSubmitted] = useState(false); const { isMobileBreakpoint } = useResponsive(); + const isVscode = useTypedSelector(state => state.vscode.isVscode); const assessment = useTypedSelector(state => state.session.assessments[props.assessmentId]); const assessmentOverviews = useTypedSelector(state => state.session.assessmentOverviews); @@ -970,7 +971,7 @@ It is safe to close this window.`} {submissionOverlay} {overlay} {resetTemplateOverlay} - {!isMobileBreakpoint ? ( + {isVscode || !isMobileBreakpoint ? ( ) : ( diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index e0b910c279..90770d9cbb 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -194,6 +194,7 @@ const Playground: React.FC = props => { const { isSicpEditor } = props; const workspaceLocation: WorkspaceLocation = isSicpEditor ? 'sicp' : 'playground'; const { isMobileBreakpoint } = useResponsive(); + const isVscode = useTypedSelector(state => state.vscode.isVscode); const [deviceSecret, setDeviceSecret] = useState(); const location = useLocation(); @@ -359,7 +360,7 @@ const Playground: React.FC = props => { useEffect(() => { if (!selectedTab) return; - if (isMobileBreakpoint && desktopOnlyTabIds.includes(selectedTab)) { + if (!isVscode && isMobileBreakpoint && desktopOnlyTabIds.includes(selectedTab)) { setSelectedTab(SideContentType.mobileEditor); } else if (!isMobileBreakpoint && mobileOnlyTabIds.includes(selectedTab)) { setSelectedTab(SideContentType.introduction); @@ -1038,7 +1039,8 @@ const Playground: React.FC = props => { } }; - return isMobileBreakpoint ? ( + // return !isVscode && isMobileBreakpoint ? ( + return false && isMobileBreakpoint ? (
From bc5a2cd45ca0840493108930feb23cf04993f6e5 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Wed, 26 Mar 2025 11:54:02 +0800 Subject: [PATCH 07/35] fix: hide unnecessary buttons when in VSC --- src/commons/workspace/Workspace.tsx | 24 ++++++++++++---------- src/pages/academy/game/Game.tsx | 31 ++++++++++++++++------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/commons/workspace/Workspace.tsx b/src/commons/workspace/Workspace.tsx index fa2e63c235..3f940b7b45 100644 --- a/src/commons/workspace/Workspace.tsx +++ b/src/commons/workspace/Workspace.tsx @@ -227,17 +227,19 @@ const Workspace: React.FC = props => { {createWorkspaceInput(props)} )}
- -
{isTestStudent && (
From 8654d75f773244527f4c176107a9eb83e9e339f9 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Tue, 1 Apr 2025 19:31:46 +0800 Subject: [PATCH 08/35] refactor: make api abstraction clearer --- src/features/vscode/messages.ts | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index bc4a3d9410..af5269213e 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -93,19 +93,29 @@ export const MessageTypeNames = (() => // Wrapper functions // ================================================================================ -export const FRONTEND_ELEMENT_ID = 'frontend'; - +/** + * API to send a Message to the VSC extension. + * To only be used within source-academy/frontend. + */ export function sendToWebview(message: MessageType) { + // In reality, the message is passed to the Webview context (middleman) first. window.parent.postMessage(message, '*'); } -export function sendToFrontend(document: Document, message: MessageType) { - const iframe: HTMLIFrameElement = document.getElementById( - FRONTEND_ELEMENT_ID - ) as HTMLIFrameElement; - const contentWindow = iframe.contentWindow; - if (!contentWindow) { + +/** Stub type of vscode.WebviewPanel */ +// Would be great to figure out how this can be typed to vscode.WebviewPanel in source-academy/vscode; +// but to never in source-academy/frontend +type VscodeWebviewPanel = any; + +/** + * API to send a Message to the Frontend iframe. + * To only be used within source-academy/vscode. + */ +export function sendToFrontend(panel: VscodeWebviewPanel, message: MessageType) { + if (!panel) { + console.error('VSC panel does not exist! Not sending message.'); return; } - // TODO: Don't hardcode this! - contentWindow.postMessage(message, 'http://localhost:8000'); + // In reality, the message is passed to the Webview context (middleman) first. + panel.webview.postMessage(message); } From 040d53f3a08654a67ee3798932459c8a57556c2a Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:40:30 +0800 Subject: [PATCH 09/35] fix: don't hardcode constants and join paths properly --- src/commons/application/Application.tsx | 2 +- src/features/vscode/messages.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index e65b2dd305..92a6d771d9 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -88,7 +88,7 @@ const Application: React.FC = () => { }; } - const message = Messages.ExtensionPing(); + const message = Messages.ExtensionPing(window.origin); sendToWebview(message); window.addEventListener('message', event => { diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index af5269213e..91885ee161 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -13,7 +13,7 @@ export type VscWorkspaceLocation = 'assessment' | 'playground'; // Note to devs: Ctrl+clicking each type will not work. Use a search instead. const Messages = createMessages({ /** Sent from the iframe to the extension */ - ExtensionPing: () => ({}), + ExtensionPing: (frontendOrigin: string) => ({ frontendOrigin }), /** Sent from the extension to the iframe */ ExtensionPong: (token: string | null) => ({ token }), IsVsc: () => ({}), From e07539a858b2707e855dc2c130dc99b7a980c23b Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:01:08 +0800 Subject: [PATCH 10/35] fix: make editor less buggy in VS Code by not sending Text messages from frontend to VSC --- .../assessmentWorkspace/AssessmentWorkspace.tsx | 13 ++++++++++++- src/commons/workspace/WorkspaceActions.ts | 5 ++--- src/commons/workspace/__tests__/WorkspaceActions.ts | 3 +-- src/commons/workspace/reducers/editorReducer.ts | 12 ------------ src/features/vscode/messages.ts | 8 ++++++-- src/pages/playground/Playground.tsx | 12 +++++++++++- 6 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index d8d094dcc6..9e35cbe625 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -392,8 +392,19 @@ const AssessmentWorkspace: React.FC = props => { ); handleClearContext(question.library, true); handleUpdateHasUnsavedChanges(false); + + const chapter = question.library.chapter; + const prepend = 'prepend' in question ? question.prepend : ''; + const solutionTemplate = 'solutionTemplate' in question ? question.solutionTemplate : ''; sendToWebview( - Messages.NewEditor(workspaceLocation, `assessment${assessment.id}`, props.questionId, '') + Messages.NewEditor( + workspaceLocation, + `assessment${assessment.id}`, + props.questionId, + chapter, + prepend, + solutionTemplate + ) ); if (options.editorValue) { // TODO: Hardcoded to make use of the first editor tab. Refactoring is needed for this workspace to enable Folder mode. diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index 49da980224..a8393b34fc 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -111,9 +111,8 @@ const newActions = createActions('workspace', { updateEditorValue: ( workspaceLocation: WorkspaceLocation, editorTabIndex: number, - newEditorValue: string, - isFromVscode: boolean = false - ) => ({ workspaceLocation, editorTabIndex, newEditorValue, isFromVscode }), + newEditorValue: string + ) => ({ workspaceLocation, editorTabIndex, newEditorValue }), setEditorBreakpoint: ( workspaceLocation: WorkspaceLocation, editorTabIndex: number, diff --git a/src/commons/workspace/__tests__/WorkspaceActions.ts b/src/commons/workspace/__tests__/WorkspaceActions.ts index f9c236617c..65dade0f70 100644 --- a/src/commons/workspace/__tests__/WorkspaceActions.ts +++ b/src/commons/workspace/__tests__/WorkspaceActions.ts @@ -258,8 +258,7 @@ test('updateEditorValue generates correct action object', () => { payload: { workspaceLocation: assessmentWorkspace, editorTabIndex, - newEditorValue, - isFromVscode: false + newEditorValue } }); }); diff --git a/src/commons/workspace/reducers/editorReducer.ts b/src/commons/workspace/reducers/editorReducer.ts index e907173f45..dc314a2cd3 100644 --- a/src/commons/workspace/reducers/editorReducer.ts +++ b/src/commons/workspace/reducers/editorReducer.ts @@ -1,9 +1,4 @@ import { ActionReducerMapBuilder } from '@reduxjs/toolkit'; -import Messages, { - isVscWorkspaceLocation, - sendToWebview, - VscWorkspaceLocation -} from 'src/features/vscode/messages'; import WorkspaceActions from '../WorkspaceActions'; import { getWorkspaceLocation } from '../WorkspaceReducer'; @@ -57,13 +52,6 @@ export const handleEditorActions = (builder: ActionReducerMapBuilder { const workspaceLocation = getWorkspaceLocation(action); diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 91885ee161..e35cc2d9cb 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -21,12 +21,16 @@ const Messages = createMessages({ workspaceLocation: VscWorkspaceLocation, assessmentName: string, questionId: number, - code: string + chapter: number, + prepend: string, + initialCode: string ) => ({ workspaceLocation, assessmentName, questionId, - code + chapter, + prepend, + initialCode }), Text: (workspaceLocation: VscWorkspaceLocation, code: string) => ({ workspaceLocation, diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 90770d9cbb..878b00fff5 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -380,7 +380,17 @@ const Playground: React.FC = props => { if (workspaceLocation === 'sicp') { return; } - sendToWebview(Messages.NewEditor(workspaceLocation, 'playground', 1, '')); + const initialCode = editorTabs[0]?.value ?? ''; + sendToWebview( + Messages.NewEditor( + workspaceLocation, + 'playground', + 1, + playgroundSourceChapter, + '', + initialCode + ) + ); }, []); // const onChangeTabs = useCallback( From 18c4597cfeff2b589b2f657839c5a739cdec4e70 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:45:12 +0800 Subject: [PATCH 11/35] temp --- default.nix.2nix | 19 +++++++++++++++++++ src/commons/application/Application.tsx | 5 ++++- src/commons/assessment/Assessment.tsx | 21 ++++++++++++++++++++- src/features/vscode/messages.ts | 14 ++++++++++++++ src/styles/_global.scss | 9 +++++++++ 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 default.nix.2nix diff --git a/default.nix.2nix b/default.nix.2nix new file mode 100644 index 0000000000..75e93fa936 --- /dev/null +++ b/default.nix.2nix @@ -0,0 +1,19 @@ +{ + description = "Template for a direnv shell"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.${system} = { + default = pkgs.callPackage (import ./default.nix) {}; + }; + }; +} diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 92a6d771d9..f6d09909b6 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useDispatch } from 'react-redux'; -import { Outlet } from 'react-router-dom'; +import { Outlet, useNavigate } from 'react-router-dom'; import Messages, { MessageType, MessageTypeNames, @@ -18,6 +18,7 @@ import VscodeActions from './actions/VscodeActions'; const Application: React.FC = () => { const dispatch = useDispatch(); const { isLoggedIn } = useSession(); + const navigate = useNavigate(); // Used in the mobile/PWA experience (e.g. separate handling of orientation changes on Andriod & iOS due to unique browser behaviours) const isMobile = /iPhone|iPad|Android/.test(navigator.userAgent); @@ -123,6 +124,8 @@ const Application: React.FC = () => { case MessageTypeNames.EvalEditor: dispatch(WorkspaceActions.evalEditor(message.workspaceLocation)); break; + case MessageTypeNames.Navigate: + navigate(message.route); } }); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index 2fbfb5526c..bae5d6a6a4 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -20,11 +20,12 @@ import { import { IconNames } from '@blueprintjs/icons'; import classNames from 'classnames'; import { sortBy } from 'lodash'; -import React, { useMemo, useState } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import { useDispatch } from 'react-redux'; import { Navigate, useLoaderData, useParams } from 'react-router'; import { NavLink } from 'react-router-dom'; import { numberRegExp } from 'src/features/academy/AcademyTypes'; +import Messages, { sendToWebview } from 'src/features/vscode/messages'; import classes from 'src/styles/Academy.module.scss'; import defaultCoverImage from '../../assets/default_cover_image.jpg'; @@ -61,6 +62,24 @@ const Assessment: React.FC = () => { const { courseId, role, assessmentOverviews: assessmentOverviewsUnfiltered } = useSession(); const dispatch = useDispatch(); + useEffect(() => { + console.log('Iam in Assessment'); + console.log(assessmentOverviewsUnfiltered); + if (assessmentOverviewsUnfiltered) { + sendToWebview( + Messages.NotifyAssessmentsOverview( + assessmentOverviewsUnfiltered.map(oa => ({ + type: oa.type, + closeAt: oa.closeAt, + id: oa.id, + isPublished: oa.isPublished, + title: oa.title + })) + ) + ); + } + }, [assessmentOverviewsUnfiltered]); + const toggleClosedAssessments = () => setShowClosedAssessments(!showClosedAssessments); const toggleOpenAssessments = () => setShowOpenedAssessments(!showOpenedAssessments); const toggleUpcomingAssessments = () => setShowUpcomingAssessments(!showUpcomingAssessments); diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index e35cc2d9cb..ba2cbf6569 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -7,6 +7,14 @@ const VscWorkspaceLocationArray = ['assessment', 'playground']; export const isVscWorkspaceLocation = (s: any) => VscWorkspaceLocationArray.includes(s); export type VscWorkspaceLocation = 'assessment' | 'playground'; +export type VscAssessmentOverview = { + type: string; + closeAt: string; + id: number; + isPublished?: boolean; + title: string; +}; + // ================================================================================ // Message type definitions // ================================================================================ @@ -38,6 +46,12 @@ const Messages = createMessages({ }), EvalEditor: (workspaceLocation: VscWorkspaceLocation) => ({ workspaceLocation: workspaceLocation + }), + NotifyAssessmentsOverview: (assessmentOverviews: VscAssessmentOverview[]) => ({ + assessmentOverviews + }), + Navigate: (route: string) => ({ + route }) }); diff --git a/src/styles/_global.scss b/src/styles/_global.scss index ed4971068b..082e633e5c 100644 --- a/src/styles/_global.scss +++ b/src/styles/_global.scss @@ -43,3 +43,12 @@ $achievement-assets: 'https://source-academy-assets.s3-ap-southeast-1.amazonaws. } } } + +// canvas { +// width: 60% !important; +// height: 60% !important; +// } + +// img[alt="Mosaic Reference Image"] { +// width: 30% !important; +// } From c02d15306d4332edfc79c342b0eabc864c86b28c Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Tue, 17 Jun 2025 00:00:56 +0800 Subject: [PATCH 12/35] feat: Send MCQ questions to VSC extension - New MCQQuestion message type --- src/commons/application/Application.tsx | 10 +++++ .../AssessmentWorkspace.tsx | 40 ++++++++++++++----- src/commons/workspace/WorkspaceActions.ts | 6 +++ src/features/vscode/messages.ts | 17 ++++++++ 4 files changed, 63 insertions(+), 10 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index f6d09909b6..e1f1526832 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -124,6 +124,16 @@ const Application: React.FC = () => { case MessageTypeNames.EvalEditor: dispatch(WorkspaceActions.evalEditor(message.workspaceLocation)); break; + case MessageTypeNames.MCQQuestion: + dispatch( + WorkspaceActions.showMcqPane( + message.workspaceLocation, + message.question, + message.options, + message.correctOption, + ), + ); + break; case MessageTypeNames.Navigate: navigate(message.route); } diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 9e35cbe625..51c57a1368 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -394,18 +394,38 @@ const AssessmentWorkspace: React.FC = props => { handleUpdateHasUnsavedChanges(false); const chapter = question.library.chapter; + const questionType = question.type; const prepend = 'prepend' in question ? question.prepend : ''; const solutionTemplate = 'solutionTemplate' in question ? question.solutionTemplate : ''; - sendToWebview( - Messages.NewEditor( - workspaceLocation, - `assessment${assessment.id}`, - props.questionId, - chapter, - prepend, - solutionTemplate - ) - ); + + switch (questionType) { + case QuestionTypes.mcq: + const mcqQuestionData: IMCQQuestion = question; + sendToWebview( + Messages.MCQQuestion( + workspaceLocation, + `assessment${assessment.id}`, + props.questionId, + chapter, + mcqQuestionData.content, + mcqQuestionData.choices.map(choice => choice.content), + mcqQuestionData.solution || 0 + ) + ); + break; + case QuestionTypes.programming: + sendToWebview( + Messages.NewEditor( + workspaceLocation, + `assessment${assessment.id}`, + props.questionId, + chapter, + prepend, + solutionTemplate + ) + ); + break; + } if (options.editorValue) { // TODO: Hardcoded to make use of the first editor tab. Refactoring is needed for this workspace to enable Folder mode. handleEditorValueChange(0, options.editorValue); diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index a8393b34fc..df40875c26 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -240,6 +240,12 @@ const newActions = createActions('workspace', { workspaceLocation: WorkspaceLocation, storyEnv?: string ) => ({ errorMsg, workspaceLocation, storyEnv }), + showMcqPane: ( + workspaceLocation: WorkspaceLocation, + question: string, + options: string[], + correctOption: number, + ) => ({ workspaceLocation, question, options, correctOption }), toggleUsingCse: (usingCse: boolean, workspaceLocation: WorkspaceLocationsWithTools) => ({ usingCse, workspaceLocation diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index ba2cbf6569..d8fd687602 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -52,6 +52,23 @@ const Messages = createMessages({ }), Navigate: (route: string) => ({ route + }), + MCQQuestion: ( + workspaceLocation: VscWorkspaceLocation, + assessmentName: string, + questionId: number, + chapter: number, + question: string, + options: string[], + correctOption: number + ) => ({ + workspaceLocation, + assessmentName, + questionId, + chapter, + question, + options, + correctOption }) }); From 2ab1c33495ba75b784bd67e977e6bf753beadbe2 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Thu, 19 Jun 2025 14:57:58 +0800 Subject: [PATCH 13/35] Revert "temp" This reverts commit 18c4597cfeff2b589b2f657839c5a739cdec4e70. --- default.nix.2nix | 19 ------------------- src/commons/application/Application.tsx | 5 +---- src/commons/assessment/Assessment.tsx | 21 +-------------------- src/features/vscode/messages.ts | 14 -------------- src/styles/_global.scss | 9 --------- 5 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 default.nix.2nix diff --git a/default.nix.2nix b/default.nix.2nix deleted file mode 100644 index 75e93fa936..0000000000 --- a/default.nix.2nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - description = "Template for a direnv shell"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - }; - - outputs = { - self, - nixpkgs, - }: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - packages.${system} = { - default = pkgs.callPackage (import ./default.nix) {}; - }; - }; -} diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index e1f1526832..56cb64aedd 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useDispatch } from 'react-redux'; -import { Outlet, useNavigate } from 'react-router-dom'; +import { Outlet } from 'react-router-dom'; import Messages, { MessageType, MessageTypeNames, @@ -18,7 +18,6 @@ import VscodeActions from './actions/VscodeActions'; const Application: React.FC = () => { const dispatch = useDispatch(); const { isLoggedIn } = useSession(); - const navigate = useNavigate(); // Used in the mobile/PWA experience (e.g. separate handling of orientation changes on Andriod & iOS due to unique browser behaviours) const isMobile = /iPhone|iPad|Android/.test(navigator.userAgent); @@ -134,8 +133,6 @@ const Application: React.FC = () => { ), ); break; - case MessageTypeNames.Navigate: - navigate(message.route); } }); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index bae5d6a6a4..2fbfb5526c 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -20,12 +20,11 @@ import { import { IconNames } from '@blueprintjs/icons'; import classNames from 'classnames'; import { sortBy } from 'lodash'; -import React, { useEffect, useMemo, useState } from 'react'; +import React, { useMemo, useState } from 'react'; import { useDispatch } from 'react-redux'; import { Navigate, useLoaderData, useParams } from 'react-router'; import { NavLink } from 'react-router-dom'; import { numberRegExp } from 'src/features/academy/AcademyTypes'; -import Messages, { sendToWebview } from 'src/features/vscode/messages'; import classes from 'src/styles/Academy.module.scss'; import defaultCoverImage from '../../assets/default_cover_image.jpg'; @@ -62,24 +61,6 @@ const Assessment: React.FC = () => { const { courseId, role, assessmentOverviews: assessmentOverviewsUnfiltered } = useSession(); const dispatch = useDispatch(); - useEffect(() => { - console.log('Iam in Assessment'); - console.log(assessmentOverviewsUnfiltered); - if (assessmentOverviewsUnfiltered) { - sendToWebview( - Messages.NotifyAssessmentsOverview( - assessmentOverviewsUnfiltered.map(oa => ({ - type: oa.type, - closeAt: oa.closeAt, - id: oa.id, - isPublished: oa.isPublished, - title: oa.title - })) - ) - ); - } - }, [assessmentOverviewsUnfiltered]); - const toggleClosedAssessments = () => setShowClosedAssessments(!showClosedAssessments); const toggleOpenAssessments = () => setShowOpenedAssessments(!showOpenedAssessments); const toggleUpcomingAssessments = () => setShowUpcomingAssessments(!showUpcomingAssessments); diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index d8fd687602..9431e8039e 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -7,14 +7,6 @@ const VscWorkspaceLocationArray = ['assessment', 'playground']; export const isVscWorkspaceLocation = (s: any) => VscWorkspaceLocationArray.includes(s); export type VscWorkspaceLocation = 'assessment' | 'playground'; -export type VscAssessmentOverview = { - type: string; - closeAt: string; - id: number; - isPublished?: boolean; - title: string; -}; - // ================================================================================ // Message type definitions // ================================================================================ @@ -47,12 +39,6 @@ const Messages = createMessages({ EvalEditor: (workspaceLocation: VscWorkspaceLocation) => ({ workspaceLocation: workspaceLocation }), - NotifyAssessmentsOverview: (assessmentOverviews: VscAssessmentOverview[]) => ({ - assessmentOverviews - }), - Navigate: (route: string) => ({ - route - }), MCQQuestion: ( workspaceLocation: VscWorkspaceLocation, assessmentName: string, diff --git a/src/styles/_global.scss b/src/styles/_global.scss index 082e633e5c..ed4971068b 100644 --- a/src/styles/_global.scss +++ b/src/styles/_global.scss @@ -43,12 +43,3 @@ $achievement-assets: 'https://source-academy-assets.s3-ap-southeast-1.amazonaws. } } } - -// canvas { -// width: 60% !important; -// height: 60% !important; -// } - -// img[alt="Mosaic Reference Image"] { -// width: 30% !important; -// } From 75fd859a91cc597165d2535d2229e24aa4e5146f Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Thu, 19 Jun 2025 15:04:39 +0800 Subject: [PATCH 14/35] fix: server changes never get sent to extension --- src/commons/application/Application.tsx | 4 ++-- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 8 ++++---- src/commons/workspace/WorkspaceActions.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 56cb64aedd..10d0c665d0 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -129,8 +129,8 @@ const Application: React.FC = () => { message.workspaceLocation, message.question, message.options, - message.correctOption, - ), + message.correctOption + ) ); break; } diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 51c57a1368..9d1f221336 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -395,12 +395,10 @@ const AssessmentWorkspace: React.FC = props => { const chapter = question.library.chapter; const questionType = question.type; - const prepend = 'prepend' in question ? question.prepend : ''; - const solutionTemplate = 'solutionTemplate' in question ? question.solutionTemplate : ''; switch (questionType) { case QuestionTypes.mcq: - const mcqQuestionData: IMCQQuestion = question; + const mcqQuestionData = question; sendToWebview( Messages.MCQQuestion( workspaceLocation, @@ -414,6 +412,8 @@ const AssessmentWorkspace: React.FC = props => { ); break; case QuestionTypes.programming: + const prepend = question.prepend; + const code = question.answer ?? question.solutionTemplate; sendToWebview( Messages.NewEditor( workspaceLocation, @@ -421,7 +421,7 @@ const AssessmentWorkspace: React.FC = props => { props.questionId, chapter, prepend, - solutionTemplate + code ) ); break; diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index df40875c26..ac5d609c51 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -244,7 +244,7 @@ const newActions = createActions('workspace', { workspaceLocation: WorkspaceLocation, question: string, options: string[], - correctOption: number, + correctOption: number ) => ({ workspaceLocation, question, options, correctOption }), toggleUsingCse: (usingCse: boolean, workspaceLocation: WorkspaceLocationsWithTools) => ({ usingCse, From ea11ea8b3eafa6cf9ae6b54339e557dfcb35ed29 Mon Sep 17 00:00:00 2001 From: mug1wara26 Date: Fri, 20 Jun 2025 16:05:04 +0800 Subject: [PATCH 15/35] Added message passing to vscode on chapter select --- src/features/vscode/messages.ts | 6 ++++++ src/pages/playground/Playground.tsx | 1 + yarn.lock | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 9431e8039e..91036e6308 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -3,6 +3,8 @@ // Ideally it is split into multiple files, but for ease of copying, it is kept as one file. /** A subset of the WorkspaceLocation type found in source-academy/frontend */ +import { Chapter, Variant } from 'js-slang/dist/types'; + const VscWorkspaceLocationArray = ['assessment', 'playground']; export const isVscWorkspaceLocation = (s: any) => VscWorkspaceLocationArray.includes(s); export type VscWorkspaceLocation = 'assessment' | 'playground'; @@ -55,6 +57,10 @@ const Messages = createMessages({ question, options, correctOption + }), + ChangeChapter: (chapter: Chapter, variant: Variant) => ({ + chapter, + variant }) }); diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 878b00fff5..7b97be4d33 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -509,6 +509,7 @@ const Playground: React.FC = props => { pushLog(input); + sendToWebview(Messages.ChangeChapter(chapter, variant)); handleChapterSelect(chapter, variant); // Hardcoded for Playground only for now, while we await workspace refactoring // to decouple the SicpWorkspace from the Playground. diff --git a/yarn.lock b/yarn.lock index 86c90d9cc3..c0d927e525 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13728,11 +13728,11 @@ __metadata: "typescript@patch:typescript@npm%3A^5.8.2#optional!builtin": version: 5.8.2 - resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin::version=5.8.2&hash=b45daf" + resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin::version=5.8.2&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/8a6cd29dfb59bd5a978407b93ae0edb530ee9376a5b95a42ad057a6f80ffb0c410489ccd6fe48d1d0dfad6e8adf5d62d3874bbd251f488ae30e11a1ce6dabd28 + checksum: 10c0/5448a08e595cc558ab321e49d4cac64fb43d1fa106584f6ff9a8d8e592111b373a995a1d5c7f3046211c8a37201eb6d0f1566f15cdb7a62a5e3be01d087848e2 languageName: node linkType: hard From 9bb54a982e5d0fb428117d52fc5c9286eaba6669 Mon Sep 17 00:00:00 2001 From: mug1wara26 Date: Fri, 20 Jun 2025 16:47:20 +0800 Subject: [PATCH 16/35] added more info in the message for chapterSelect --- src/features/vscode/messages.ts | 9 ++++++++- src/pages/playground/Playground.tsx | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 91036e6308..b1e37464bf 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -58,7 +58,14 @@ const Messages = createMessages({ options, correctOption }), - ChangeChapter: (chapter: Chapter, variant: Variant) => ({ + ChangeChapter: ( + assessmentName: string, + questionId: number, + chapter: Chapter, + variant: Variant + ) => ({ + assessmentName, + questionId, chapter, variant }) diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 7b97be4d33..de60d62eab 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -509,7 +509,7 @@ const Playground: React.FC = props => { pushLog(input); - sendToWebview(Messages.ChangeChapter(chapter, variant)); + sendToWebview(Messages.ChangeChapter('playground', 1, chapter, variant)); handleChapterSelect(chapter, variant); // Hardcoded for Playground only for now, while we await workspace refactoring // to decouple the SicpWorkspace from the Playground. From 3de5ceebe5fb05d0f02179b87f39e4fe59bd459e Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Tue, 24 Jun 2025 03:49:07 +0800 Subject: [PATCH 17/35] Update mcq handling functionality --- src/commons/application/Application.tsx | 11 +++++++---- .../assessmentWorkspace/AssessmentWorkspace.tsx | 2 +- src/commons/workspace/WorkspaceActions.ts | 3 +-- src/features/vscode/messages.ts | 15 ++++++++++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index e1f1526832..8a144c0d1e 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -124,16 +124,19 @@ const Application: React.FC = () => { case MessageTypeNames.EvalEditor: dispatch(WorkspaceActions.evalEditor(message.workspaceLocation)); break; - case MessageTypeNames.MCQQuestion: + case MessageTypeNames.McqQuestion: dispatch( WorkspaceActions.showMcqPane( message.workspaceLocation, message.question, - message.options, - message.correctOption, - ), + message.options + ) ); break; + case MessageTypeNames.McqAnswer: + console.log(`FRONTEND: MCQAnswerMessage: ${message}`); + dispatch(SessionActions.submitAnswer(message.questionId, message.choice)); + break; case MessageTypeNames.Navigate: navigate(message.route); } diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 51c57a1368..ae3b9dcd98 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -402,7 +402,7 @@ const AssessmentWorkspace: React.FC = props => { case QuestionTypes.mcq: const mcqQuestionData: IMCQQuestion = question; sendToWebview( - Messages.MCQQuestion( + Messages.McqQuestion( workspaceLocation, `assessment${assessment.id}`, props.questionId, diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index df40875c26..ad4ce57f4d 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -244,8 +244,7 @@ const newActions = createActions('workspace', { workspaceLocation: WorkspaceLocation, question: string, options: string[], - correctOption: number, - ) => ({ workspaceLocation, question, options, correctOption }), + ) => ({ workspaceLocation, question, options }), toggleUsingCse: (usingCse: boolean, workspaceLocation: WorkspaceLocationsWithTools) => ({ usingCse, workspaceLocation diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index d8fd687602..059f89c095 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -60,7 +60,6 @@ const Messages = createMessages({ chapter: number, question: string, options: string[], - correctOption: number ) => ({ workspaceLocation, assessmentName, @@ -68,8 +67,18 @@ const Messages = createMessages({ chapter, question, options, - correctOption - }) + }), + MCQAnswer: ( + workspaceLocation: VscWorkspaceLocation, + assessmentName: string, + questionId: number, + choice: number, + ) => ({ + workspaceLocation, + assessmentName, + questionId, + choice, + }), }); export default Messages; From 37ad18f3424eea76e7b7ca35bf8209ac8bb1c695 Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Tue, 24 Jun 2025 03:59:57 +0800 Subject: [PATCH 18/35] Fix: Merge issues --- src/commons/application/Application.tsx | 2 -- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 3 +-- src/features/vscode/messages.ts | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 4758900d58..0a6f1fe540 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -136,8 +136,6 @@ const Application: React.FC = () => { console.log(`FRONTEND: MCQAnswerMessage: ${message}`); dispatch(SessionActions.submitAnswer(message.questionId, message.choice)); break; - case MessageTypeNames.Navigate: - navigate(message.route); } }); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 2ca033d27a..74f066594f 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -406,8 +406,7 @@ const AssessmentWorkspace: React.FC = props => { props.questionId, chapter, mcqQuestionData.content, - mcqQuestionData.choices.map(choice => choice.content), - mcqQuestionData.solution || 0 + mcqQuestionData.choices.map(choice => choice.content) ) ); break; diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index a8a63a01ba..763a30594c 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -41,7 +41,7 @@ const Messages = createMessages({ EvalEditor: (workspaceLocation: VscWorkspaceLocation) => ({ workspaceLocation: workspaceLocation }), - MCQQuestion: ( + McqQuestion: ( workspaceLocation: VscWorkspaceLocation, assessmentName: string, questionId: number, @@ -56,7 +56,7 @@ const Messages = createMessages({ question, options }), - MCQAnswer: ( + McqAnswer: ( workspaceLocation: VscWorkspaceLocation, assessmentName: string, questionId: number, From 705b31a0b409d297d738d041f808ce6d6353094c Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Tue, 24 Jun 2025 10:55:30 +0800 Subject: [PATCH 19/35] Feat: basic voting question type support --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 74f066594f..dffe534c34 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -410,7 +410,7 @@ const AssessmentWorkspace: React.FC = props => { ) ); break; - case QuestionTypes.programming: + case QuestionTypes.programming || QuestionTypes.voting: const prepend = question.prepend; const code = question.answer ?? question.solutionTemplate; sendToWebview( From d13ebaf9205d6f0878425d5315c21c2f6691000b Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Tue, 24 Jun 2025 10:55:30 +0800 Subject: [PATCH 20/35] Feat: basic voting question type support --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 2 +- src/features/vscode/messages.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 74f066594f..dffe534c34 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -410,7 +410,7 @@ const AssessmentWorkspace: React.FC = props => { ) ); break; - case QuestionTypes.programming: + case QuestionTypes.programming || QuestionTypes.voting: const prepend = question.prepend; const code = question.answer ?? question.solutionTemplate; sendToWebview( diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 763a30594c..1fa48bd2a1 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -41,6 +41,9 @@ const Messages = createMessages({ EvalEditor: (workspaceLocation: VscWorkspaceLocation) => ({ workspaceLocation: workspaceLocation }), + Navigate: (route: string) => ({ + route + }), McqQuestion: ( workspaceLocation: VscWorkspaceLocation, assessmentName: string, From 8b47473f78083462aa19b659004967d11d41592c Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Tue, 24 Jun 2025 12:28:34 +0800 Subject: [PATCH 21/35] Simplify vscode mcq message Remove the question description from the McqQuestion payload as it is not used. --- src/commons/application/Application.tsx | 1 - src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 1 - src/commons/workspace/WorkspaceActions.ts | 3 +-- src/features/vscode/messages.ts | 2 -- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index e8952b5040..29fc320c38 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -131,7 +131,6 @@ const Application: React.FC = () => { dispatch( WorkspaceActions.showMcqPane( message.workspaceLocation, - message.question, message.options ) ); diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index dffe534c34..86a91fae6d 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -405,7 +405,6 @@ const AssessmentWorkspace: React.FC = props => { `assessment${assessment.id}`, props.questionId, chapter, - mcqQuestionData.content, mcqQuestionData.choices.map(choice => choice.content) ) ); diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index fac569bbd9..a46c6cf5c9 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -240,9 +240,8 @@ const newActions = createActions('workspace', { workspaceLocation: WorkspaceLocation, storyEnv?: string ) => ({ errorMsg, workspaceLocation, storyEnv }), - showMcqPane: (workspaceLocation: WorkspaceLocation, question: string, options: string[]) => ({ + showMcqPane: (workspaceLocation: WorkspaceLocation, options: string[]) => ({ workspaceLocation, - question, options }), toggleUsingCse: (usingCse: boolean, workspaceLocation: WorkspaceLocationsWithTools) => ({ diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 55043a7972..1256dfbb2c 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -60,14 +60,12 @@ const Messages = createMessages({ assessmentName: string, questionId: number, chapter: number, - question: string, options: string[] ) => ({ workspaceLocation, assessmentName, questionId, chapter, - question, options }), McqAnswer: ( From 03b83cb67978bfe9bae131afa32bf6f518f38098 Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Thu, 26 Jun 2025 00:08:57 +0800 Subject: [PATCH 22/35] Contest code view functionality --- .../assessmentWorkspace/AssessmentWorkspace.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 86a91fae6d..7cf14ee531 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -448,6 +448,18 @@ const AssessmentWorkspace: React.FC = props => { const handleContestEntryClick = (_submissionId: number, answer: string) => { // TODO: Hardcoded to make use of the first editor tab. Refactoring is needed for this workspace to enable Folder mode. handleEditorValueChange(0, answer); + // Hacky way to view the editor, might cause issues + sendToWebview( + Messages.NewEditor( + workspaceLocation, + `submission${_submissionId}`, + questionId, + question.library.chapter, + "", + answer + ) + ); + // }; const tabs: SideContentTab[] = [ From 631195c9dab43804179cdac7d7cf9fade53585b9 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Thu, 19 Jun 2025 21:00:06 +0800 Subject: [PATCH 23/35] feat: update VSC message to support sidepanel --- src/commons/application/Application.tsx | 14 +++++--------- src/commons/assessment/Assessment.tsx | 7 +++---- src/features/vscode/messages.ts | 5 +++-- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 29fc320c38..096e9b7549 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useDispatch } from 'react-redux'; -import { Outlet, useNavigate } from 'react-router-dom'; +import { Outlet } from 'react-router-dom'; import Messages, { MessageType, MessageTypeNames, @@ -18,7 +18,6 @@ import VscodeActions from './actions/VscodeActions'; const Application: React.FC = () => { const dispatch = useDispatch(); const { isLoggedIn } = useSession(); - const navigate = useNavigate(); // Used in the mobile/PWA experience (e.g. separate handling of orientation changes on Andriod & iOS due to unique browser behaviours) const isMobile = /iPhone|iPad|Android/.test(navigator.userAgent); @@ -125,15 +124,12 @@ const Application: React.FC = () => { dispatch(WorkspaceActions.evalEditor(message.workspaceLocation)); break; case MessageTypeNames.Navigate: - navigate(message.route); + window.location.replace(message.route); + // TODO: Figure out why this doesn't work, this is faster in theory + // navigate(message.route); break; case MessageTypeNames.McqQuestion: - dispatch( - WorkspaceActions.showMcqPane( - message.workspaceLocation, - message.options - ) - ); + dispatch(WorkspaceActions.showMcqPane(message.workspaceLocation, message.options)); break; case MessageTypeNames.McqAnswer: console.log(`FRONTEND: MCQAnswerMessage: ${message}`); diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index bae5d6a6a4..7110061074 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -63,9 +63,7 @@ const Assessment: React.FC = () => { const dispatch = useDispatch(); useEffect(() => { - console.log('Iam in Assessment'); - console.log(assessmentOverviewsUnfiltered); - if (assessmentOverviewsUnfiltered) { + if (assessmentOverviewsUnfiltered && courseId) { sendToWebview( Messages.NotifyAssessmentsOverview( assessmentOverviewsUnfiltered.map(oa => ({ @@ -74,7 +72,8 @@ const Assessment: React.FC = () => { id: oa.id, isPublished: oa.isPublished, title: oa.title - })) + })), + courseId ) ); } diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 1256dfbb2c..79ff0e71dc 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -49,8 +49,9 @@ const Messages = createMessages({ EvalEditor: (workspaceLocation: VscWorkspaceLocation) => ({ workspaceLocation: workspaceLocation }), - NotifyAssessmentsOverview: (assessmentOverviews: VscAssessmentOverview[]) => ({ - assessmentOverviews + NotifyAssessmentsOverview: (assessmentOverviews: VscAssessmentOverview[], courseId: number) => ({ + assessmentOverviews, + courseId }), Navigate: (route: string) => ({ route From 1047df159d34ff6113876e7fb5640e6d3bd780cb Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Thu, 26 Jun 2025 17:53:12 +0800 Subject: [PATCH 24/35] Fix: run button vanishes on zoom --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 7cf14ee531..2f7636ef10 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -245,7 +245,7 @@ const AssessmentWorkspace: React.FC = props => { useEffect(() => { if (!selectedTab) return; - if (!isMobileBreakpoint && mobileOnlyTabIds.includes(selectedTab)) { + if ((!isMobileBreakpoint || isVscode) && mobileOnlyTabIds.includes(selectedTab)) { setSelectedTab(SideContentType.questionOverview); } }, [isMobileBreakpoint, props, selectedTab, setSelectedTab]); @@ -780,7 +780,7 @@ const AssessmentWorkspace: React.FC = props => { ); return { - editorButtons: !isMobileBreakpoint + editorButtons: (!isMobileBreakpoint || isVscode) ? [runButton, saveButton, resetButton, chapterSelect] : [saveButton, resetButton], flowButtons: [previousButton, questionView, nextButton] From 31b64615a24e418f59a6ab518d88cf6e32823698 Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Thu, 26 Jun 2025 21:43:33 +0800 Subject: [PATCH 25/35] Fix: MCQ id --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 2f7636ef10..07790110de 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -403,7 +403,7 @@ const AssessmentWorkspace: React.FC = props => { Messages.McqQuestion( workspaceLocation, `assessment${assessment.id}`, - props.questionId, + mcqQuestionData.id, chapter, mcqQuestionData.choices.map(choice => choice.content) ) From 7b5d34d3f767714c1ab2a7760f37e37fe16ab7e5 Mon Sep 17 00:00:00 2001 From: Shirshajit Sen Gupta Date: Fri, 27 Jun 2025 00:56:44 +0800 Subject: [PATCH 26/35] Feat: reset functionality for vsc --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 5 +++++ src/features/vscode/messages.ts | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 07790110de..1212ae0b01 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -929,6 +929,11 @@ It is safe to close this window.`} (assessment!.questions[questionId] as IProgrammingQuestion).solutionTemplate ); handleUpdateHasUnsavedChanges(true); + if (isVscode) { + + sendToWebview(Messages.ResetEditor(workspaceLocation, + (assessment!.questions[questionId] as IProgrammingQuestion).solutionTemplate)); + } }} options={{ minimal: false, intent: Intent.DANGER }} /> diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 79ff0e71dc..2c9c9e3857 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -90,6 +90,13 @@ const Messages = createMessages({ questionId, chapter, variant + }), + ResetEditor: ( + workspaceLocation: VscWorkspaceLocation, + initialCode: string, + ) => ({ + workspaceLocation, + initialCode, }) }); From ec5c9a32e47d766e4b5e84f795916f47f6e64b58 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Thu, 19 Jun 2025 21:00:06 +0800 Subject: [PATCH 27/35] re-add changes removed during merge; lint --- src/commons/assessment/Assessment.tsx | 2 +- .../AssessmentWorkspace.tsx | 20 +++++++++++-------- src/features/vscode/messages.ts | 7 ++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index 7110061074..c87ddfe950 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -77,7 +77,7 @@ const Assessment: React.FC = () => { ) ); } - }, [assessmentOverviewsUnfiltered]); + }, [assessmentOverviewsUnfiltered, courseId]); const toggleClosedAssessments = () => setShowClosedAssessments(!showClosedAssessments); const toggleOpenAssessments = () => setShowOpenedAssessments(!showOpenedAssessments); diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 1212ae0b01..7fcd3a5593 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -455,11 +455,11 @@ const AssessmentWorkspace: React.FC = props => { `submission${_submissionId}`, questionId, question.library.chapter, - "", + '', answer ) ); - // + // }; const tabs: SideContentTab[] = [ @@ -780,9 +780,10 @@ const AssessmentWorkspace: React.FC = props => { ); return { - editorButtons: (!isMobileBreakpoint || isVscode) - ? [runButton, saveButton, resetButton, chapterSelect] - : [saveButton, resetButton], + editorButtons: + !isMobileBreakpoint || isVscode + ? [runButton, saveButton, resetButton, chapterSelect] + : [saveButton, resetButton], flowButtons: [previousButton, questionView, nextButton] }; }; @@ -930,9 +931,12 @@ It is safe to close this window.`} ); handleUpdateHasUnsavedChanges(true); if (isVscode) { - - sendToWebview(Messages.ResetEditor(workspaceLocation, - (assessment!.questions[questionId] as IProgrammingQuestion).solutionTemplate)); + sendToWebview( + Messages.ResetEditor( + workspaceLocation, + (assessment!.questions[questionId] as IProgrammingQuestion).solutionTemplate + ) + ); } }} options={{ minimal: false, intent: Intent.DANGER }} diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 2c9c9e3857..8136e5fced 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -91,12 +91,9 @@ const Messages = createMessages({ chapter, variant }), - ResetEditor: ( - workspaceLocation: VscWorkspaceLocation, - initialCode: string, - ) => ({ + ResetEditor: (workspaceLocation: VscWorkspaceLocation, initialCode: string) => ({ workspaceLocation, - initialCode, + initialCode }) }); From 70675886d296e587990753e4c5a9da881c577eb6 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Fri, 27 Jun 2025 23:17:23 +0800 Subject: [PATCH 28/35] fix: try using window.location.pathname --- src/commons/application/Application.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 096e9b7549..e7d82af0ce 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -124,7 +124,7 @@ const Application: React.FC = () => { dispatch(WorkspaceActions.evalEditor(message.workspaceLocation)); break; case MessageTypeNames.Navigate: - window.location.replace(message.route); + window.location.pathname = message.route; // TODO: Figure out why this doesn't work, this is faster in theory // navigate(message.route); break; From c122be55adf9798499a51cb365252137f9502a22 Mon Sep 17 00:00:00 2001 From: mug1wara26 Date: Fri, 27 Jun 2025 23:31:37 +0800 Subject: [PATCH 29/35] Added message to trigger save assessment --- src/commons/application/Application.tsx | 3 +++ src/features/vscode/messages.ts | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index 096e9b7549..ef88cfc004 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -135,6 +135,9 @@ const Application: React.FC = () => { console.log(`FRONTEND: MCQAnswerMessage: ${message}`); dispatch(SessionActions.submitAnswer(message.questionId, message.choice)); break; + case MessageTypeNames.AssessmentAnswer: + dispatch(SessionActions.submitAnswer(message.questionId, message.answer)); + break; } }); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/features/vscode/messages.ts b/src/features/vscode/messages.ts index 2c9c9e3857..3c8004b171 100644 --- a/src/features/vscode/messages.ts +++ b/src/features/vscode/messages.ts @@ -91,12 +91,13 @@ const Messages = createMessages({ chapter, variant }), - ResetEditor: ( - workspaceLocation: VscWorkspaceLocation, - initialCode: string, - ) => ({ + ResetEditor: (workspaceLocation: VscWorkspaceLocation, initialCode: string) => ({ workspaceLocation, - initialCode, + initialCode + }), + AssessmentAnswer: (questionId: number, answer: string) => ({ + questionId, + answer }) }); From 230e689dade06445c08c2964bc7a9b6ff117ea5b Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:06:53 +0800 Subject: [PATCH 30/35] fix oopsie with isVscode --- src/pages/playground/Playground.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index de60d62eab..76fb10b45f 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -1050,8 +1050,7 @@ const Playground: React.FC = props => { } }; - // return !isVscode && isMobileBreakpoint ? ( - return false && isMobileBreakpoint ? ( + return !isVscode && isMobileBreakpoint ? (
From f204b4a056be1197db8403de944332d826057205 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:27:57 +0800 Subject: [PATCH 31/35] Revert "fix oopsie with isVscode" This reverts commit 230e689dade06445c08c2964bc7a9b6ff117ea5b. --- src/pages/playground/Playground.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 76fb10b45f..de60d62eab 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -1050,7 +1050,8 @@ const Playground: React.FC = props => { } }; - return !isVscode && isMobileBreakpoint ? ( + // return !isVscode && isMobileBreakpoint ? ( + return false && isMobileBreakpoint ? (
From db441df2cc9369bad8d780dd6cd79079b15a10ad Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:57:57 +0800 Subject: [PATCH 32/35] update yarn.lock --- yarn.lock | 604 +++++++++++++++++------------------------------------- 1 file changed, 191 insertions(+), 413 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1efc666f2e..7ef8b8e72e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,10 +32,10 @@ __metadata: languageName: node linkType: hard -"@adobe/css-tools@npm:^4.3.2": - version: 4.3.3 - resolution: "@adobe/css-tools@npm:4.3.3" - checksum: 10c0/e76e712df713964b87cdf2aca1f0477f19bebd845484d5fcba726d3ec7782366e2f26ec8cb2dcfaf47081a5c891987d8a9f5c3f30d11e1eb3c1848adc27fcb24 +"@adobe/css-tools@npm:^4.4.0": + version: 4.4.3 + resolution: "@adobe/css-tools@npm:4.4.3" + checksum: 10c0/6d16c4d4b6752d73becf6e58611f893c7ed96e04017ff7084310901ccdbe0295171b722b158f6a2b0aa77182ef3446ffd62b39488fa5a7adab1f0dfe5ffafbae languageName: node linkType: hard @@ -103,7 +103,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.27.3, @babel/generator@npm:^7.27.5, @babel/generator@npm:^7.7.2": +"@babel/generator@npm:^7.27.5, @babel/generator@npm:^7.7.2": version: 7.27.5 resolution: "@babel/generator@npm:7.27.5" dependencies: @@ -225,7 +225,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.25.9, @babel/helper-plugin-utils@npm:^7.27.1, @babel/helper-plugin-utils@npm:^7.8.0": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.27.1, @babel/helper-plugin-utils@npm:^7.8.0": version: 7.27.1 resolution: "@babel/helper-plugin-utils@npm:7.27.1" checksum: 10c0/94cf22c81a0c11a09b197b41ab488d416ff62254ce13c57e62912c85700dc2e99e555225787a4099ff6bae7a1812d622c80fbaeda824b79baa10a6c5ac4cf69b @@ -310,18 +310,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.19.4, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.27.2, @babel/parser@npm:^7.27.4, @babel/parser@npm:^7.27.5": - version: 7.27.5 - resolution: "@babel/parser@npm:7.27.5" - dependencies: - "@babel/types": "npm:^7.27.3" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/f7faaebf21cc1f25d9ca8ac02c447ed38ef3460ea95be7ea760916dcf529476340d72a5a6010c6641d9ed9d12ad827c8424840277ec2295c5b082ba0f291220a - languageName: node - linkType: hard - -"@babel/parser@npm:^7.27.7": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.19.4, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.27.2, @babel/parser@npm:^7.27.5, @babel/parser@npm:^7.27.7": version: 7.27.7 resolution: "@babel/parser@npm:7.27.7" dependencies: @@ -491,18 +480,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.18.6, @babel/plugin-syntax-jsx@npm:^7.7.2": - version: 7.25.9 - resolution: "@babel/plugin-syntax-jsx@npm:7.25.9" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.25.9" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/d56597aff4df39d3decda50193b6dfbe596ca53f437ff2934622ce19a743bf7f43492d3fb3308b0289f5cee2b825d99ceb56526a2b9e7b68bf04901546c5618c - languageName: node - linkType: hard - -"@babel/plugin-syntax-jsx@npm:^7.27.1": +"@babel/plugin-syntax-jsx@npm:^7.18.6, @babel/plugin-syntax-jsx@npm:^7.27.1, @babel/plugin-syntax-jsx@npm:^7.7.2": version: 7.27.1 resolution: "@babel/plugin-syntax-jsx@npm:7.27.1" dependencies: @@ -601,7 +579,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.27.1": +"@babel/plugin-syntax-typescript@npm:^7.27.1, @babel/plugin-syntax-typescript@npm:^7.7.2": version: 7.27.1 resolution: "@babel/plugin-syntax-typescript@npm:7.27.1" dependencies: @@ -612,17 +590,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.25.9 - resolution: "@babel/plugin-syntax-typescript@npm:7.25.9" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.25.9" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/5192ebe11bd46aea68b7a60fd9555465c59af7e279e71126788e59121b86e00b505816685ab4782abe159232b0f73854e804b54449820b0d950b397ee158caa2 - languageName: node - linkType: hard - "@babel/plugin-syntax-unicode-sets-regex@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-syntax-unicode-sets-regex@npm:7.18.6" @@ -1438,22 +1405,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.27.1, @babel/traverse@npm:^7.27.3": - version: 7.27.4 - resolution: "@babel/traverse@npm:7.27.4" - dependencies: - "@babel/code-frame": "npm:^7.27.1" - "@babel/generator": "npm:^7.27.3" - "@babel/parser": "npm:^7.27.4" - "@babel/template": "npm:^7.27.2" - "@babel/types": "npm:^7.27.3" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10c0/6de8aa2a0637a6ee6d205bf48b9e923928a02415771fdec60085ed754dcdf605e450bb3315c2552fa51c31a4662275b45d5ae4ad527ce55a7db9acebdbbbb8ed - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.27.7": +"@babel/traverse@npm:^7.27.1, @babel/traverse@npm:^7.27.3, @babel/traverse@npm:^7.27.7": version: 7.27.7 resolution: "@babel/traverse@npm:7.27.7" dependencies: @@ -1468,17 +1420,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.3, @babel/types@npm:^7.27.1, @babel/types@npm:^7.27.3, @babel/types@npm:^7.27.6, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": - version: 7.27.6 - resolution: "@babel/types@npm:7.27.6" - dependencies: - "@babel/helper-string-parser": "npm:^7.27.1" - "@babel/helper-validator-identifier": "npm:^7.27.1" - checksum: 10c0/39d556be114f2a6d874ea25ad39826a9e3a0e98de0233ae6d932f6d09a4b222923a90a7274c635ed61f1ba49bbd345329226678800900ad1c8d11afabd573aaf - languageName: node - linkType: hard - -"@babel/types@npm:^7.27.7": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.3, @babel/types@npm:^7.27.1, @babel/types@npm:^7.27.3, @babel/types@npm:^7.27.6, @babel/types@npm:^7.27.7, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": version: 7.27.7 resolution: "@babel/types@npm:7.27.7" dependencies: @@ -1495,15 +1437,6 @@ __metadata: languageName: node linkType: hard -"@blueprintjs/colors@npm:^5.1.1": - version: 5.1.1 - resolution: "@blueprintjs/colors@npm:5.1.1" - dependencies: - tslib: "npm:~2.6.2" - checksum: 10c0/213c00ddc8720896451ec41de5e339e9f3acee9f3657e83f71daa4277a7bb7facb3fd96ef0b8793fcbac860731d662ee8a60528a161742c604ad4d2fe25872ba - languageName: node - linkType: hard - "@blueprintjs/colors@npm:^5.1.8": version: 5.1.8 resolution: "@blueprintjs/colors@npm:5.1.8" @@ -1513,35 +1446,7 @@ __metadata: languageName: node linkType: hard -"@blueprintjs/core@npm:^5.10.1": - version: 5.10.1 - resolution: "@blueprintjs/core@npm:5.10.1" - dependencies: - "@blueprintjs/colors": "npm:^5.1.1" - "@blueprintjs/icons": "npm:^5.9.0" - "@popperjs/core": "npm:^2.11.8" - classnames: "npm:^2.3.1" - normalize.css: "npm:^8.0.1" - react-popper: "npm:^2.3.0" - react-transition-group: "npm:^4.4.5" - react-uid: "npm:^2.3.3" - tslib: "npm:~2.6.2" - use-sync-external-store: "npm:^1.2.0" - peerDependencies: - "@types/react": ^16.14.41 || 17 || 18 - react: ^16.8 || 17 || 18 - react-dom: ^16.8 || 17 || 18 - peerDependenciesMeta: - "@types/react": - optional: true - bin: - upgrade-blueprint-2.0.0-rename: scripts/upgrade-blueprint-2.0.0-rename.sh - upgrade-blueprint-3.0.0-rename: scripts/upgrade-blueprint-3.0.0-rename.sh - checksum: 10c0/b1ad7ad406f5bd90b5eaafa2d0b0065df25ece3fdac34de48adfa7c3c746c6dc584e2082268ab1777e4c30d01b018c4c889a57ef873bb66c59aee9b0965e361e - languageName: node - linkType: hard - -"@blueprintjs/core@npm:^5.19.1": +"@blueprintjs/core@npm:^5.10.1, @blueprintjs/core@npm:^5.19.1": version: 5.19.1 resolution: "@blueprintjs/core@npm:5.19.1" dependencies: @@ -1633,26 +1538,7 @@ __metadata: languageName: node linkType: hard -"@blueprintjs/select@npm:^5.1.3": - version: 5.1.3 - resolution: "@blueprintjs/select@npm:5.1.3" - dependencies: - "@blueprintjs/core": "npm:^5.10.1" - "@blueprintjs/icons": "npm:^5.9.0" - classnames: "npm:^2.3.1" - tslib: "npm:~2.6.2" - peerDependencies: - "@types/react": ^16.14.41 || 17 || 18 - react: ^16.8 || 17 || 18 - react-dom: ^16.8 || 17 || 18 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 10c0/061f442cec997e833f849c68d3c671d564f1448df2d0dd93a1be6370d12d59b49b73280a0300b808598b0422f7a67a0dfd0ae51360718ee3d0b9d8d67866a3c6 - languageName: node - linkType: hard - -"@blueprintjs/select@npm:^5.3.21": +"@blueprintjs/select@npm:^5.1.3, @blueprintjs/select@npm:^5.3.21": version: 5.3.21 resolution: "@blueprintjs/select@npm:5.3.21" dependencies: @@ -1899,18 +1785,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0": - version: 4.4.0 - resolution: "@eslint-community/eslint-utils@npm:4.4.0" - dependencies: - eslint-visitor-keys: "npm:^3.3.0" - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 10c0/7e559c4ce59cd3a06b1b5a517b593912e680a7f981ae7affab0d01d709e99cd5647019be8fafa38c350305bc32f1f7d42c7073edde2ab536c745e365f37b607e - languageName: node - linkType: hard - -"@eslint-community/eslint-utils@npm:^4.7.0": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.7.0": version: 4.7.0 resolution: "@eslint-community/eslint-utils@npm:4.7.0" dependencies: @@ -1921,35 +1796,28 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0": - version: 4.11.0 - resolution: "@eslint-community/regexpp@npm:4.11.0" - checksum: 10c0/0f6328869b2741e2794da4ad80beac55cba7de2d3b44f796a60955b0586212ec75e6b0253291fd4aad2100ad471d1480d8895f2b54f1605439ba4c875e05e523 - languageName: node - linkType: hard - -"@eslint-community/regexpp@npm:^4.12.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.12.1": version: 4.12.1 resolution: "@eslint-community/regexpp@npm:4.12.1" checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard -"@eslint/config-array@npm:^0.20.1": - version: 0.20.1 - resolution: "@eslint/config-array@npm:0.20.1" +"@eslint/config-array@npm:^0.21.0": + version: 0.21.0 + resolution: "@eslint/config-array@npm:0.21.0" dependencies: "@eslint/object-schema": "npm:^2.1.6" debug: "npm:^4.3.1" minimatch: "npm:^3.1.2" - checksum: 10c0/709108c3925d83c2166024646829ab61ba5fa85c6568daefd32508899f46ed8dc36d7153042df6dcc7e58ad543bc93298b646575daecb5eb4e39a43d838dab42 + checksum: 10c0/0ea801139166c4aa56465b309af512ef9b2d3c68f9198751bbc3e21894fe70f25fbf26e1b0e9fffff41857bc21bfddeee58649ae6d79aadcd747db0c5dca771f languageName: node linkType: hard -"@eslint/config-helpers@npm:^0.2.1": - version: 0.2.3 - resolution: "@eslint/config-helpers@npm:0.2.3" - checksum: 10c0/8fd36d7f33013628787947c81894807c7498b31eacf6648efa6d7c7a99aac6bf0d59a8a4d14f968ec2aeebefb76a1a7e4fd4cd556a296323d4711b3d7a7cda22 +"@eslint/config-helpers@npm:^0.3.0": + version: 0.3.0 + resolution: "@eslint/config-helpers@npm:0.3.0" + checksum: 10c0/013ae7b189eeae8b30cc2ee87bc5c9c091a9cd615579003290eb28bebad5d78806a478e74ba10b3fe08ed66975b52af7d2cd4b4b43990376412b14e5664878c8 languageName: node linkType: hard @@ -1988,10 +1856,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:9.29.0": - version: 9.29.0 - resolution: "@eslint/js@npm:9.29.0" - checksum: 10c0/d0ccf37063fa27a3fae9347cb044f84ca10b5a2fa19ffb2b3fedf3b96843ac1ff359ea9f0ab0e80f2f16fda4cb0dc61ea0fed0375090f050fe0a029e7d6de3a3 +"@eslint/js@npm:9.30.0": + version: 9.30.0 + resolution: "@eslint/js@npm:9.30.0" + checksum: 10c0/aec2df7f4e4e884d693dc27dbf4713c1a48afa327bfadac25ebd0e61a2797ce906f2f2a9be0d7d922acb68ccd68cc88779737811f9769eb4933d1f5e574c469e languageName: node linkType: hard @@ -2578,57 +2446,57 @@ __metadata: languageName: node linkType: hard -"@octokit/core@npm:^5.0.0": - version: 5.1.0 - resolution: "@octokit/core@npm:5.1.0" +"@octokit/core@npm:^5.0.2": + version: 5.2.1 + resolution: "@octokit/core@npm:5.2.1" dependencies: "@octokit/auth-token": "npm:^4.0.0" - "@octokit/graphql": "npm:^7.0.0" - "@octokit/request": "npm:^8.0.2" - "@octokit/request-error": "npm:^5.0.0" - "@octokit/types": "npm:^12.0.0" + "@octokit/graphql": "npm:^7.1.0" + "@octokit/request": "npm:^8.4.1" + "@octokit/request-error": "npm:^5.1.1" + "@octokit/types": "npm:^13.0.0" before-after-hook: "npm:^2.2.0" universal-user-agent: "npm:^6.0.0" - checksum: 10c0/a1d2882373b4a33cd9f6e56d76bcc82e5589a477829fc3491b1ef471a8a83fa437b339a2c76d97d9e8ea4ca12bf3ebf32e66119ba16977e542d98f1f5dd3c994 + checksum: 10c0/9759c70a6a6477a636f336d717657761243bab0e9d34c4012a8b2d70aafd89ba3d24289fb7e05352999c6ec526fe572b8aff9ad59e90761842fb72fb7d59ed95 languageName: node linkType: hard -"@octokit/endpoint@npm:^9.0.0": - version: 9.0.4 - resolution: "@octokit/endpoint@npm:9.0.4" +"@octokit/endpoint@npm:^9.0.6": + version: 9.0.6 + resolution: "@octokit/endpoint@npm:9.0.6" dependencies: - "@octokit/types": "npm:^12.0.0" + "@octokit/types": "npm:^13.1.0" universal-user-agent: "npm:^6.0.0" - checksum: 10c0/f1c857c5d85afa9d7e8857f7f97dbec28d3b6ab1dc21fe35172f1bc9e5512c8a3a26edabf6b2d83bb60d700f7ad290c96be960496aa83606095630edfad06db4 + checksum: 10c0/8e06197b21869aeb498e0315093ca6fbee12bd1bdcfc1667fcd7d79d827d84f2c5a30702ffd28bba7879780e367d14c30df5b20d47fcaed5de5fdc05f5d4e013 languageName: node linkType: hard -"@octokit/graphql@npm:^7.0.0": - version: 7.0.2 - resolution: "@octokit/graphql@npm:7.0.2" +"@octokit/graphql@npm:^7.1.0": + version: 7.1.1 + resolution: "@octokit/graphql@npm:7.1.1" dependencies: - "@octokit/request": "npm:^8.0.1" - "@octokit/types": "npm:^12.0.0" + "@octokit/request": "npm:^8.4.1" + "@octokit/types": "npm:^13.0.0" universal-user-agent: "npm:^6.0.0" - checksum: 10c0/96e5d6b970be60877134cc147b9249534f3a79d691b9932d731d453426fa1e1a0a36111a1b0a6ab43d61309c630903a65db5559b5c800300dc26cf588f50fea8 + checksum: 10c0/c27216200f3f4ce7ce2a694fb7ea43f8ea4a807fbee3a423c41ed137dd7948dfc0bbf6ea1656f029a7625c84b583acdef740a7032266d0eff55305c91c3a1ed6 languageName: node linkType: hard -"@octokit/openapi-types@npm:^19.1.0": - version: 19.1.0 - resolution: "@octokit/openapi-types@npm:19.1.0" - checksum: 10c0/ae8081f52b797b91a12d4f6cddc475699c9d34b06645b337adc77d30b583d8fe8506597a45c42f8f1a96bfb2a9d092cee257d8a65d718bfeed23a0d153448eea +"@octokit/openapi-types@npm:^24.2.0": + version: 24.2.0 + resolution: "@octokit/openapi-types@npm:24.2.0" + checksum: 10c0/8f47918b35e9b7f6109be6f7c8fc3a64ad13a48233112b29e92559e64a564b810eb3ebf81b4cd0af1bb2989d27b9b95cca96e841ec4e23a3f68703cefe62fd9e languageName: node linkType: hard -"@octokit/plugin-paginate-rest@npm:^9.0.0": - version: 9.1.5 - resolution: "@octokit/plugin-paginate-rest@npm:9.1.5" +"@octokit/plugin-paginate-rest@npm:11.4.4-cjs.2": + version: 11.4.4-cjs.2 + resolution: "@octokit/plugin-paginate-rest@npm:11.4.4-cjs.2" dependencies: - "@octokit/types": "npm:^12.4.0" + "@octokit/types": "npm:^13.7.0" peerDependencies: - "@octokit/core": ">=5" - checksum: 10c0/a17055dff8fde5ebc03bf935294ffa4605ed714cb15252f0fa63cda1b95e738fafb5ab9748b18fbdfa5615d5f6686cbf193c6d6426e7dc4fd1dda91c87263f3b + "@octokit/core": 5 + checksum: 10c0/1d61a63c98a18c171bccdc6cf63ffe279fe852e8bdc9db6647ffcb27f4ea485fdab78fb71b552ed0f2186785cf5264f8ed3f9a8f33061e4697b5f73b097accb1 languageName: node linkType: hard @@ -2641,58 +2509,58 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-rest-endpoint-methods@npm:^10.0.0": - version: 10.2.0 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:10.2.0" +"@octokit/plugin-rest-endpoint-methods@npm:13.3.2-cjs.1": + version: 13.3.2-cjs.1 + resolution: "@octokit/plugin-rest-endpoint-methods@npm:13.3.2-cjs.1" dependencies: - "@octokit/types": "npm:^12.3.0" + "@octokit/types": "npm:^13.8.0" peerDependencies: - "@octokit/core": ">=5" - checksum: 10c0/4d00a2334753955f0c3841ba8fc0880c093b94838e011864ee737d958d2d64e3d45d34fa4c8b64bccf9e13c6de81318cbd6e2b24df37992941d12f54def28432 + "@octokit/core": ^5 + checksum: 10c0/810fe5cb1861386746bf0218ea969d87c56e553ff339490526483b4b66f53c4b4c6092034bec30c5d453172eb6f33e75b5748ade1b401b76774b5a994e2c10b0 languageName: node linkType: hard -"@octokit/request-error@npm:^5.0.0": - version: 5.0.1 - resolution: "@octokit/request-error@npm:5.0.1" +"@octokit/request-error@npm:^5.1.1": + version: 5.1.1 + resolution: "@octokit/request-error@npm:5.1.1" dependencies: - "@octokit/types": "npm:^12.0.0" + "@octokit/types": "npm:^13.1.0" deprecation: "npm:^2.0.0" once: "npm:^1.4.0" - checksum: 10c0/e72a4627120de345b54876a1f007664095e5be9d624fce2e14fccf7668cd8f5e4929d444d8fc085d48e1fb5cd548538453974aab129a669101110d6679dce6c6 + checksum: 10c0/dc9fc76ea5e4199273e4665ce9ddf345fe8f25578d9999c9a16f276298e61ee6fe0e6f5a6147b91ba3b34fdf5b9e6b7af6ae13d6333175e95b30c574088f7a2d languageName: node linkType: hard -"@octokit/request@npm:^8.0.1, @octokit/request@npm:^8.0.2": - version: 8.1.6 - resolution: "@octokit/request@npm:8.1.6" +"@octokit/request@npm:^8.4.1": + version: 8.4.1 + resolution: "@octokit/request@npm:8.4.1" dependencies: - "@octokit/endpoint": "npm:^9.0.0" - "@octokit/request-error": "npm:^5.0.0" - "@octokit/types": "npm:^12.0.0" + "@octokit/endpoint": "npm:^9.0.6" + "@octokit/request-error": "npm:^5.1.1" + "@octokit/types": "npm:^13.1.0" universal-user-agent: "npm:^6.0.0" - checksum: 10c0/ef84418e0b1f28335c105bca2b1518b04797791761024d26f80f60a528cdcf468baf9897fd34f535c42af0643a598884f882bc832e68edbfe1ea530c2df563a4 + checksum: 10c0/1a69dcb7336de708a296db9e9a58040e5b284a87495a63112f80eb0007da3fc96a9fadecb9e875fc63cf179c23a0f81031fbef2a6f610a219e45805ead03fcf3 languageName: node linkType: hard "@octokit/rest@npm:^20.0.0": - version: 20.0.2 - resolution: "@octokit/rest@npm:20.0.2" + version: 20.1.2 + resolution: "@octokit/rest@npm:20.1.2" dependencies: - "@octokit/core": "npm:^5.0.0" - "@octokit/plugin-paginate-rest": "npm:^9.0.0" + "@octokit/core": "npm:^5.0.2" + "@octokit/plugin-paginate-rest": "npm:11.4.4-cjs.2" "@octokit/plugin-request-log": "npm:^4.0.0" - "@octokit/plugin-rest-endpoint-methods": "npm:^10.0.0" - checksum: 10c0/e9bfc617d0e0bfb0ba9dea3d1e0a19167c5a255beac622dd34280e1754dfab7688323b3251f8e8c85494b39548ecc52385e8b84e21ce0627f58176562a6e2fae + "@octokit/plugin-rest-endpoint-methods": "npm:13.3.2-cjs.1" + checksum: 10c0/712e08c43c7af37c5c219f95ae289b3ac2646270be4e8a7141fa2aa9340ed8f7134f117c9467e89206c5a9797c49c8d2c039b884d4865bb3bde91bc5adb3c38c languageName: node linkType: hard -"@octokit/types@npm:^12.0.0, @octokit/types@npm:^12.3.0, @octokit/types@npm:^12.4.0": - version: 12.4.0 - resolution: "@octokit/types@npm:12.4.0" +"@octokit/types@npm:^13.0.0, @octokit/types@npm:^13.1.0, @octokit/types@npm:^13.7.0, @octokit/types@npm:^13.8.0": + version: 13.10.0 + resolution: "@octokit/types@npm:13.10.0" dependencies: - "@octokit/openapi-types": "npm:^19.1.0" - checksum: 10c0/b52b3fd8af307a1868846991f8376548a790814b20639dee1110271a768c0489081970df893ca2230f6285066003230d22f5877eeac90418971a475c79808241 + "@octokit/openapi-types": "npm:^24.2.0" + checksum: 10c0/f66a401b89d653ec28e5c1529abdb7965752db4d9d40fa54c80e900af4c6bf944af6bd0a83f5b4f1eecb72e3d646899dfb27ffcf272ac243552de7e3b97a038d languageName: node linkType: hard @@ -3296,90 +3164,61 @@ __metadata: languageName: node linkType: hard -"@sentry-internal/browser-utils@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry-internal/browser-utils@npm:8.33.0" +"@sentry-internal/browser-utils@npm:8.55.0": + version: 8.55.0 + resolution: "@sentry-internal/browser-utils@npm:8.55.0" dependencies: - "@sentry/core": "npm:8.33.0" - "@sentry/types": "npm:8.33.0" - "@sentry/utils": "npm:8.33.0" - checksum: 10c0/802b76941faa710d17740822b9e39dfe3bd424b20d0c5ea13782b7a788c4853aba3efa7bff27fc726da3a7a863d85fc87a071a7fe6d371f0152c0999170a67ee + "@sentry/core": "npm:8.55.0" + checksum: 10c0/201eb94ee64a4dab058153c64dd4ce0af082f3c3bc84a5441cdadf344d9554a0a67c9d9dfdff720eb42de214d67d734d5bda25a050c2efd59c03f60562bb139a languageName: node linkType: hard -"@sentry-internal/feedback@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry-internal/feedback@npm:8.33.0" +"@sentry-internal/feedback@npm:8.55.0": + version: 8.55.0 + resolution: "@sentry-internal/feedback@npm:8.55.0" dependencies: - "@sentry/core": "npm:8.33.0" - "@sentry/types": "npm:8.33.0" - "@sentry/utils": "npm:8.33.0" - checksum: 10c0/92859e325d0d80007c0ec0577c8ab72aed2087a85bcfac132818381092a08b48c5dd7da92cdb0fd04099073672f8a66d909a7cf655c30854efe83ca31b13f822 + "@sentry/core": "npm:8.55.0" + checksum: 10c0/2515c4eca6226e3df28a498f7f3771d7820556887bf8c06f2d5469c92474cf72ed81eaa0079f6bcf46905c54315e2631bb7b9ed7ed6741cf9b7f73a3f4875acc languageName: node linkType: hard -"@sentry-internal/replay-canvas@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry-internal/replay-canvas@npm:8.33.0" +"@sentry-internal/replay-canvas@npm:8.55.0": + version: 8.55.0 + resolution: "@sentry-internal/replay-canvas@npm:8.55.0" dependencies: - "@sentry-internal/replay": "npm:8.33.0" - "@sentry/core": "npm:8.33.0" - "@sentry/types": "npm:8.33.0" - "@sentry/utils": "npm:8.33.0" - checksum: 10c0/9e413015b2005f817a473bef20e8091070a13bd2ccf966e9c50665f8e5f0790752aa988ca9a9ea3866027acb525010a92df09a5d90d02fa790c7f7c796122097 + "@sentry-internal/replay": "npm:8.55.0" + "@sentry/core": "npm:8.55.0" + checksum: 10c0/6f3c619ede1de47635035f74477dd5a11e5c2cac9d0906448a7fffb6dad1c5bd9a49a594fbc2a51ba3b1859a91f60e08ab6de2d9961ccbaa343af580f1d13fb1 languageName: node linkType: hard -"@sentry-internal/replay@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry-internal/replay@npm:8.33.0" +"@sentry-internal/replay@npm:8.55.0": + version: 8.55.0 + resolution: "@sentry-internal/replay@npm:8.55.0" dependencies: - "@sentry-internal/browser-utils": "npm:8.33.0" - "@sentry/core": "npm:8.33.0" - "@sentry/types": "npm:8.33.0" - "@sentry/utils": "npm:8.33.0" - checksum: 10c0/f6de59a633640d42a6ed586876c4bf6226450610fb3b6b56d3dce867fc324889b6c4a22e67bb0ab3166c9eeb242912efc7b9dc9b4f8d7246c8844d86583ae25b + "@sentry-internal/browser-utils": "npm:8.55.0" + "@sentry/core": "npm:8.55.0" + checksum: 10c0/320fd5685c1e84c5feebaa88fc72afd0bd5189b95d690f8c24301cd8b13789431b2c1d28e3e5a93f669ca3b80cdc830e672723aa7a28ff8f0b901674ce0c0529 languageName: node linkType: hard "@sentry/browser@npm:^8.33.0": - version: 8.33.0 - resolution: "@sentry/browser@npm:8.33.0" + version: 8.55.0 + resolution: "@sentry/browser@npm:8.55.0" dependencies: - "@sentry-internal/browser-utils": "npm:8.33.0" - "@sentry-internal/feedback": "npm:8.33.0" - "@sentry-internal/replay": "npm:8.33.0" - "@sentry-internal/replay-canvas": "npm:8.33.0" - "@sentry/core": "npm:8.33.0" - "@sentry/types": "npm:8.33.0" - "@sentry/utils": "npm:8.33.0" - checksum: 10c0/13c4ba7e40e2438bcdfaca56bdea5dc670c63ce13e2c2fb7bb39b6c68d5cfbba0f208b7bcf8e8c1e7941cd18f1831ca44fadc3662c4d4993512acb84c749c38c + "@sentry-internal/browser-utils": "npm:8.55.0" + "@sentry-internal/feedback": "npm:8.55.0" + "@sentry-internal/replay": "npm:8.55.0" + "@sentry-internal/replay-canvas": "npm:8.55.0" + "@sentry/core": "npm:8.55.0" + checksum: 10c0/a485de7385851c96ed4c2291d065594aeea2076b11b3b113f4866fdbff1522524abd97664f0d0b011e0eff6c4986a556f080bccfa1b770466c6afcb6122dfbaf languageName: node linkType: hard -"@sentry/core@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry/core@npm:8.33.0" - dependencies: - "@sentry/types": "npm:8.33.0" - "@sentry/utils": "npm:8.33.0" - checksum: 10c0/1121e73afbc066ec1c52b6476b265204c4b29913971e27432797752a466b677c54a033f2833b2ce70a87279cfdfd86c890d6e1f18a0028a8ff20b77e5ce16dfb - languageName: node - linkType: hard - -"@sentry/types@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry/types@npm:8.33.0" - checksum: 10c0/dba9a3c1c74fb3dfda64d3bdc5b1772063359fb1ffc2539da67ffa148c31c64f9b7d50113d60dfd0aacd8594c900f34edc47821be1f4efbdaa308f0125dd7d2e - languageName: node - linkType: hard - -"@sentry/utils@npm:8.33.0": - version: 8.33.0 - resolution: "@sentry/utils@npm:8.33.0" - dependencies: - "@sentry/types": "npm:8.33.0" - checksum: 10c0/70051187adc969f7a92f1f54212363e2d9f0dcdd6dfa08c72e1000623dd7ecaeb6dfa383fc27a0d0dec618725518c3725562a61191d8d47604a3defc410a5c9a +"@sentry/core@npm:8.55.0": + version: 8.55.0 + resolution: "@sentry/core@npm:8.55.0" + checksum: 10c0/51c1768f0bd940a060787b402dba9df3347c918ea4c0fdc300d45c37703ebbf6f7adee9fff332cfd6b23372b33c46e6d2f31a04227762d490aaddc14773894a0 languageName: node linkType: hard @@ -3776,21 +3615,21 @@ __metadata: linkType: hard "@tanstack/react-table@npm:^8.9.3": - version: 8.12.0 - resolution: "@tanstack/react-table@npm:8.12.0" + version: 8.21.3 + resolution: "@tanstack/react-table@npm:8.21.3" dependencies: - "@tanstack/table-core": "npm:8.12.0" + "@tanstack/table-core": "npm:8.21.3" peerDependencies: - react: ">=16" - react-dom: ">=16" - checksum: 10c0/9692fcb23779cc457f74c395b1f79dc700eae246315014879c3a312275a11c8e49fd14a16a122843b8eb14f6f1b71c8fb648ba7fec300806be6d589d7c902c21 + react: ">=16.8" + react-dom: ">=16.8" + checksum: 10c0/85d1d0fcb690ecc011f68a5a61c96f82142e31a0270dcf9cbc699a6f36715b1653fe6ff1518302a6d08b7093351fc4cabefd055a7db3cd8ac01e068956b0f944 languageName: node linkType: hard -"@tanstack/table-core@npm:8.12.0": - version: 8.12.0 - resolution: "@tanstack/table-core@npm:8.12.0" - checksum: 10c0/3300b37dc73e8959718d73ad7a981c5c8e1561c7b1f4ee6c86f056be49d2d20571808cacfc281801b2eb8fb9ead93165a71f933bc209e939d2ca4bd6556bc0a5 +"@tanstack/table-core@npm:8.21.3": + version: 8.21.3 + resolution: "@tanstack/table-core@npm:8.21.3" + checksum: 10c0/40e3560e6d55e07cc047024aa7f83bd47a9323d21920d4adabba8071fd2d21230c48460b26cedf392588f8265b9edc133abb1b0d6d0adf4dae0970032900a8c9 languageName: node linkType: hard @@ -3811,35 +3650,17 @@ __metadata: linkType: hard "@testing-library/jest-dom@npm:^6.0.0": - version: 6.3.0 - resolution: "@testing-library/jest-dom@npm:6.3.0" + version: 6.6.3 + resolution: "@testing-library/jest-dom@npm:6.6.3" dependencies: - "@adobe/css-tools": "npm:^4.3.2" - "@babel/runtime": "npm:^7.9.2" + "@adobe/css-tools": "npm:^4.4.0" aria-query: "npm:^5.0.0" chalk: "npm:^3.0.0" css.escape: "npm:^1.5.1" dom-accessibility-api: "npm:^0.6.3" - lodash: "npm:^4.17.15" + lodash: "npm:^4.17.21" redent: "npm:^3.0.0" - peerDependencies: - "@jest/globals": ">= 28" - "@types/bun": "*" - "@types/jest": ">= 28" - jest: ">= 28" - vitest: ">= 0.32" - peerDependenciesMeta: - "@jest/globals": - optional: true - "@types/bun": - optional: true - "@types/jest": - optional: true - jest: - optional: true - vitest: - optional: true - checksum: 10c0/38ef0dc054b90b253015adaa16828046b1eff8137b86506d5233c10c85a8d8516d55dddb0af5ada46ef98ce9d9bbdad94de42acd29ed07adfb2924fc7bfc6429 + checksum: 10c0/5566b6c0b7b0709bc244aec3aa3dc9e5f4663e8fb2b99d8cd456fc07279e59db6076cbf798f9d3099a98fca7ef4cd50e4e1f4c4dec5a60a8fad8d24a638a5bf6 languageName: node linkType: hard @@ -3864,11 +3685,11 @@ __metadata: linkType: hard "@testing-library/user-event@npm:^14.4.3": - version: 14.4.3 - resolution: "@testing-library/user-event@npm:14.4.3" + version: 14.6.1 + resolution: "@testing-library/user-event@npm:14.6.1" peerDependencies: "@testing-library/dom": ">=7.21.4" - checksum: 10c0/28e1e4ed2fdaa9486e203c6789386be228e305abd3fa41f38c828af415fd4a4e80f4de88de0e502ff11c4b4926f221b874a2a45bcc8170d30714e12dad2c1bd0 + checksum: 10c0/75fea130a52bf320d35d46ed54f3eec77e71a56911b8b69a3fe29497b0b9947b2dc80d30f04054ad4ce7f577856ae3e5397ea7dff0ef14944d3909784c7a93fe languageName: node linkType: hard @@ -3943,9 +3764,9 @@ __metadata: linkType: hard "@types/aria-query@npm:^5.0.1": - version: 5.0.1 - resolution: "@types/aria-query@npm:5.0.1" - checksum: 10c0/bc9e40ce37bd3a1654948778c7829bd55aea1bc5f2cd06fcf6cd650b07bb388995799e9aab6e2d93a6cf55dcba3b85c155f7ba93adefcc7c2e152fc6057061b5 + version: 5.0.4 + resolution: "@types/aria-query@npm:5.0.4" + checksum: 10c0/dc667bc6a3acc7bba2bccf8c23d56cb1f2f4defaa704cfef595437107efaa972d3b3db9ec1d66bc2711bfc35086821edd32c302bffab36f2e79b97f312069f08 languageName: node linkType: hard @@ -4126,14 +3947,7 @@ __metadata: languageName: node linkType: hard -"@types/gapi@npm:*": - version: 0.0.44 - resolution: "@types/gapi@npm:0.0.44" - checksum: 10c0/33039ad11566e694a7f009c3de767820b6a63599c5e7907a7740c7663d0982aab35ee71fb97bba7f9f9f124466d5ea2a4662ab28612d4361cd2d5b9ee12bb81c - languageName: node - linkType: hard - -"@types/gapi@npm:^0.0.47": +"@types/gapi@npm:*, @types/gapi@npm:^0.0.47": version: 0.0.47 resolution: "@types/gapi@npm:0.0.47" checksum: 10c0/014d7326b6182d260c33ae5b7317d7c0271263dde83b9d24fccd78481dce8877f0ec7a110467a626bf9e1c0b73f2b1935c31f5ef66f71f1328ae0926f6e8b0fe @@ -4323,11 +4137,11 @@ __metadata: linkType: hard "@types/react-dom@npm:^18.3.0": - version: 18.3.0 - resolution: "@types/react-dom@npm:18.3.0" - dependencies: - "@types/react": "npm:*" - checksum: 10c0/6c90d2ed72c5a0e440d2c75d99287e4b5df3e7b011838cdc03ae5cd518ab52164d86990e73246b9d812eaf02ec351d74e3b4f5bd325bf341e13bf980392fd53b + version: 18.3.7 + resolution: "@types/react-dom@npm:18.3.7" + peerDependencies: + "@types/react": ^18.0.0 + checksum: 10c0/8bd309e2c3d1604a28a736a24f96cbadf6c05d5288cfef8883b74f4054c961b6b3a5e997fd5686e492be903c8f3380dba5ec017eff3906b1256529cd2d39603e languageName: node linkType: hard @@ -4362,11 +4176,11 @@ __metadata: linkType: hard "@types/react-test-renderer@npm:^18.0.0": - version: 18.0.7 - resolution: "@types/react-test-renderer@npm:18.0.7" + version: 18.3.1 + resolution: "@types/react-test-renderer@npm:18.3.1" dependencies: - "@types/react": "npm:*" - checksum: 10c0/45cbe963354acee2ab090979d856763c84f59ef7b63477d1fef5d0fd52760b69aa67bbd205fbd3bd36264620fce72c8e407735a9f2009c40ca50da59b0058c34 + "@types/react": "npm:^18" + checksum: 10c0/9fc8467ff1a3f14be6cc3498a75fc788d2c92c0fffa7bf21269ed5d9d82db9195bf2178ddc42ea16a0836995c1b77601c6be8abb27bd1864668c418c6d0e5a3b languageName: node linkType: hard @@ -4379,13 +4193,13 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:*, @types/react@npm:^18.3.3": - version: 18.3.3 - resolution: "@types/react@npm:18.3.3" +"@types/react@npm:*, @types/react@npm:^18, @types/react@npm:^18.3.3": + version: 18.3.23 + resolution: "@types/react@npm:18.3.23" dependencies: "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10c0/fe455f805c5da13b89964c3d68060cebd43e73ec15001a68b34634604a78140e6fc202f3f61679b9d809dde6d7a7c2cb3ed51e0fd1462557911db09879b55114 + checksum: 10c0/49331800b76572eb2992a5c44801dbf8c612a5f99c8f4e4200f06c7de6f3a6e9455c661784a6c5469df96fa45622cb4a9d0982c44e6a0d5719be5f2ef1f545ed languageName: node linkType: hard @@ -4743,7 +4557,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.4, acorn@npm:^8.1, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.12.0, acorn@npm:^8.14.0, acorn@npm:^8.15.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": +"acorn@npm:^8.0.4, acorn@npm:^8.1, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.15.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": version: 8.15.0 resolution: "acorn@npm:8.15.0" bin: @@ -5840,10 +5654,10 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^1.1.1": - version: 1.2.1 - resolution: "clsx@npm:1.2.1" - checksum: 10c0/34dead8bee24f5e96f6e7937d711978380647e936a22e76380290e35486afd8634966ce300fc4b74a32f3762c7d4c0303f442c3e259f4ce02374eb0c82834f27 +"clsx@npm:^2.1.1": + version: 2.1.1 + resolution: "clsx@npm:2.1.1" + checksum: 10c0/c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839 languageName: node linkType: hard @@ -7282,20 +7096,13 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 languageName: node linkType: hard -"eslint-visitor-keys@npm:^4.0.0": - version: 4.0.0 - resolution: "eslint-visitor-keys@npm:4.0.0" - checksum: 10c0/76619f42cf162705a1515a6868e6fc7567e185c7063a05621a8ac4c3b850d022661262c21d9f1fc1d144ecf0d5d64d70a3f43c15c3fc969a61ace0fb25698cf5 - languageName: node - linkType: hard - "eslint-visitor-keys@npm:^4.2.1": version: 4.2.1 resolution: "eslint-visitor-keys@npm:4.2.1" @@ -7304,16 +7111,16 @@ __metadata: linkType: hard "eslint@npm:^9.9.0": - version: 9.29.0 - resolution: "eslint@npm:9.29.0" + version: 9.30.0 + resolution: "eslint@npm:9.30.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.12.1" - "@eslint/config-array": "npm:^0.20.1" - "@eslint/config-helpers": "npm:^0.2.1" + "@eslint/config-array": "npm:^0.21.0" + "@eslint/config-helpers": "npm:^0.3.0" "@eslint/core": "npm:^0.14.0" "@eslint/eslintrc": "npm:^3.3.1" - "@eslint/js": "npm:9.29.0" + "@eslint/js": "npm:9.30.0" "@eslint/plugin-kit": "npm:^0.3.1" "@humanfs/node": "npm:^0.16.6" "@humanwhocodes/module-importer": "npm:^1.0.1" @@ -7349,22 +7156,11 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 10c0/75e3f841e0f8b0fa93dbb2ba6ae538bd8b611c3654117bc3dadf90bb009923dfd2c15ec2948dc6e6b8b571317cc125c5cceb9255da8cd644ee740020df645dd8 - languageName: node - linkType: hard - -"espree@npm:^10.0.1": - version: 10.1.0 - resolution: "espree@npm:10.1.0" - dependencies: - acorn: "npm:^8.12.0" - acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^4.0.0" - checksum: 10c0/52e6feaa77a31a6038f0c0e3fce93010a4625701925b0715cd54a2ae190b3275053a0717db698697b32653788ac04845e489d6773b508d6c2e8752f3c57470a0 + checksum: 10c0/ebc4b17cfd96f308ebaeb12dfab133a551eb03200c80109ecf663fbeb9af83c4eb3c143407c1b04522d23b5f5844fe9a629b00d409adfc460c1aadf5108da86a languageName: node linkType: hard -"espree@npm:^10.4.0": +"espree@npm:^10.0.1, espree@npm:^10.4.0": version: 10.4.0 resolution: "espree@npm:10.4.0" dependencies: @@ -7570,20 +7366,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.12": - version: 3.3.2 - resolution: "fast-glob@npm:3.3.2" - dependencies: - "@nodelib/fs.stat": "npm:^2.0.2" - "@nodelib/fs.walk": "npm:^1.2.3" - glob-parent: "npm:^5.1.2" - merge2: "npm:^1.3.0" - micromatch: "npm:^4.0.4" - checksum: 10c0/42baad7b9cd40b63e42039132bde27ca2cb3a4950d0a0f9abe4639ea1aa9d3e3b40f98b1fe31cbc0cc17b664c9ea7447d911a152fa34ec5b72977b125a6fc845 - languageName: node - linkType: hard - -"fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.2.12, fast-glob@npm:^3.3.2": version: 3.3.3 resolution: "fast-glob@npm:3.3.3" dependencies: @@ -10077,9 +9860,9 @@ __metadata: linkType: hard "konva@npm:^9.2.0": - version: 9.2.0 - resolution: "konva@npm:9.2.0" - checksum: 10c0/65b36f1ffa08285830d7150e665c462d8ca6617db0ba7ea3d340f39b39c74135b5849057722439b55dcebf9c9f7625e828ccc2dbb413b35c3e553fca274ce7b3 + version: 9.3.20 + resolution: "konva@npm:9.3.20" + checksum: 10c0/726d52e7105c747a080ba9bfe35bf07fa9dd40c4ae122f061d55723d907b6b7a09e8476cb5277ca0bcaf5504f4f79805ae2db0c29b72c9715b96ceae5c2a1d06 languageName: node linkType: hard @@ -10222,7 +10005,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:4.17.21, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21": +"lodash@npm:4.17.21, lodash@npm:^4.17.14, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 10c0/d8cbea072bb08655bb4c989da418994b073a608dffa608b09ac04b43a791b12aeae7cd7ad919aa4c925f33b48490b5cfe6c1f71d827956071dae2e7bb3a6b74c @@ -12074,15 +11857,15 @@ __metadata: linkType: hard "react-draggable@npm:^4.4.5": - version: 4.4.6 - resolution: "react-draggable@npm:4.4.6" + version: 4.5.0 + resolution: "react-draggable@npm:4.5.0" dependencies: - clsx: "npm:^1.1.1" + clsx: "npm:^2.1.1" prop-types: "npm:^15.8.1" peerDependencies: react: ">= 16.3.0" react-dom: ">= 16.3.0" - checksum: 10c0/1e8cf47414a8554caa68447e5f27749bc40e1eabb4806e2dadcb39ab081d263f517d6aaec5231677e6b425603037c7e3386d1549898f9ffcc98a86cabafb2b9a + checksum: 10c0/6f7591fe450555218bf0d9e31984be02451bf3f678fb121f51ac0a0a645d01a1b5ea8248ef9afddcd24239028911fd88032194b9c00b30ad5ece76ea13397fc3 languageName: node linkType: hard @@ -12151,7 +11934,7 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.0.0, react-is@npm:^18.2.0": +"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.0.0": version: 18.2.0 resolution: "react-is@npm:18.2.0" checksum: 10c0/6eb5e4b28028c23e2bfcf73371e72cd4162e4ac7ab445ddae2afe24e347a37d6dc22fae6e1748632cd43c6d4f9b8f86dcf26bf9275e1874f436d129952528ae0 @@ -12165,6 +11948,13 @@ __metadata: languageName: node linkType: hard +"react-is@npm:^18.3.1": + version: 18.3.1 + resolution: "react-is@npm:18.3.1" + checksum: 10c0/f2f1e60010c683479e74c63f96b09fb41603527cd131a9959e2aee1e5a8b0caf270b365e5ca77d4a6b18aae659b60a86150bb3979073528877029b35aecd2072 + languageName: node + linkType: hard + "react-konva@npm:^18.2.10": version: 18.2.10 resolution: "react-konva@npm:18.2.10" @@ -12415,15 +12205,15 @@ __metadata: linkType: hard "react-test-renderer@npm:^18.2.0": - version: 18.2.0 - resolution: "react-test-renderer@npm:18.2.0" + version: 18.3.1 + resolution: "react-test-renderer@npm:18.3.1" dependencies: - react-is: "npm:^18.2.0" + react-is: "npm:^18.3.1" react-shallow-renderer: "npm:^16.15.0" - scheduler: "npm:^0.23.0" + scheduler: "npm:^0.23.2" peerDependencies: - react: ^18.2.0 - checksum: 10c0/53dfada1da1e8dd0498a5601e9eea3dc6ca23c6c2694d1cab9712faea869c11e4ce1c9a618d674cb668a668b41fb6bcf9a7b0a078cd853b1922f002fa22f42c8 + react: ^18.3.1 + checksum: 10c0/c633558ef9af33bc68f0c4dbb5163a004c4fb9eade7bd0a7cfc0355fb367f36bd9d96533c90b7e85a146be6c525113a15f58683d269e0177ad77e2b04d4fe51c languageName: node linkType: hard @@ -14809,19 +14599,7 @@ __metadata: languageName: node linkType: hard -"use-isomorphic-layout-effect@npm:^1.1.1": - version: 1.1.2 - resolution: "use-isomorphic-layout-effect@npm:1.1.2" - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 10c0/d8deea8b85e55ac6daba237a889630bfdbf0ebf60e9e22b6a78a78c26fabe6025e04ada7abef1e444e6786227d921e648b2707db8b3564daf757264a148a6e23 - languageName: node - linkType: hard - -"use-isomorphic-layout-effect@npm:^1.2.0": +"use-isomorphic-layout-effect@npm:^1.1.1, use-isomorphic-layout-effect@npm:^1.2.0": version: 1.2.1 resolution: "use-isomorphic-layout-effect@npm:1.2.1" peerDependencies: From 6beecc07a2b38edccdb433d70a8a3d5f3e4fb39d Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Sat, 28 Jun 2025 14:01:56 +0800 Subject: [PATCH 33/35] Reapply "fix oopsie with isVscode" This reverts commit f204b4a056be1197db8403de944332d826057205. --- src/pages/playground/Playground.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index de60d62eab..76fb10b45f 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -1050,8 +1050,7 @@ const Playground: React.FC = props => { } }; - // return !isVscode && isMobileBreakpoint ? ( - return false && isMobileBreakpoint ? ( + return !isVscode && isMobileBreakpoint ? (
From be3be9979f92323c8fee99c9107248f3a38ebc00 Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:02:25 +0800 Subject: [PATCH 34/35] fix: add isVscode to useEffect deps (eslint) --- src/commons/assessmentWorkspace/AssessmentWorkspace.tsx | 2 +- src/pages/playground/Playground.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index 7fcd3a5593..23412daa51 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -248,7 +248,7 @@ const AssessmentWorkspace: React.FC = props => { if ((!isMobileBreakpoint || isVscode) && mobileOnlyTabIds.includes(selectedTab)) { setSelectedTab(SideContentType.questionOverview); } - }, [isMobileBreakpoint, props, selectedTab, setSelectedTab]); + }, [isMobileBreakpoint, isVscode, props, selectedTab, setSelectedTab]); /* ================== onChange handlers diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 76fb10b45f..1a38444bf0 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -365,7 +365,7 @@ const Playground: React.FC = props => { } else if (!isMobileBreakpoint && mobileOnlyTabIds.includes(selectedTab)) { setSelectedTab(SideContentType.introduction); } - }, [isMobileBreakpoint, selectedTab, setSelectedTab]); + }, [isMobileBreakpoint, isVscode, selectedTab, setSelectedTab]); const onEditorValueChange = React.useCallback( (editorTabIndex: number, newEditorValue: string) => { From e7595df181938a0cce479036a86ddc602440e27e Mon Sep 17 00:00:00 2001 From: heyzec <61238538+heyzec@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:11:10 +0800 Subject: [PATCH 35/35] fix: squelch warning (eslint) --- src/pages/playground/Playground.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 1a38444bf0..d9c06bd46f 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -391,6 +391,8 @@ const Playground: React.FC = props => { initialCode ) ); + // We don't want to re-send this message even when the variables change + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); // const onChangeTabs = useCallback(