feat(marketplace): preview attempt frontend#8513
Draft
LWS49 wants to merge 9 commits into
Draft
Conversation
LWS49
marked this pull request as draft
July 24, 2026 03:50
LWS49
force-pushed
the
lws49/feat-marketplace-pr7b-preview-attempt
branch
from
July 24, 2026 05:03
d9d825a to
f850512
Compare
A bare <Outlet/> nulls the outlet context, so the reused SubmissionEditIndex banner would read undefined from useCourseContext() on the preview page (and throw when destructuring). Forward CourseContainer's context and read it defensively in the banner.
Add a play (attempt) icon button between the preview eye and duplicate buttons in each listing row. Extract the create-attempt + navigate + 409-notify flow into a shared useStartPreviewAttempt hook reused by the listing preview page.
…attempt/null Preview pages reuse the submission edit UI, but a preview URL has no /assessments/:aid/submissions segment, so any id derived from the path was null. - getSubmissionId() also parses /courses/:c/marketplace/attempt/:id, so the SubmissionForm pollers and action buttons stop emitting /attempt/null/... - AnswersAPI routes per-answer saveDraft/submitAnswer to the shallow attempt endpoint in preview (same fallback as Submissions.js/Scribing.js). - Recorder reducer no longer calls stopRecord() when nothing is recording, which produced an unhandled 'Recorder has already stopped' rejection on unmount.
LWS49
force-pushed
the
lws49/feat-marketplace-pr7b-preview-attempt
branch
from
July 24, 2026 05:29
f850512 to
3900460
Compare
LWS49
force-pushed
the
lws49/feat-marketplace-pr7c-preview-frontend
branch
from
July 24, 2026 05:29
3312db1 to
cc62410
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 (frontend) of the marketplace preview attempt, stacked on #8511 (PR7b, the backend serving stack). This adds the frontend for previewing a published marketplace assessment as a real, interactive attempt: an entrance from the listing preview page and from each marketplace index row, the interactive attempt page itself, and a banner marking it as a throwaway preview. The attempt page reuses the real submission editor (
SubmissionEditIndex) wholesale, since PR7b deliberately made the preview serving payload shape-compatible with the real submissionedit.json. The only new machinery is a small context seam so the reused submission API routes to the shallow/marketplace/attempt/...endpoints, plus the banner and the two entrances. No backend changes.Design decisions
SubmissionEditIndexwholesale instead of forking it - PR7b's payload is shape-compatible on purpose, and forking would duplicate the ~30-component submission editor and guarantee the two experiences drift.getActivePreview()singleton that swaps the URL prefix to/courses/:c/marketplace/attempt. The swap also triggers whenever the URL carries no assessment id, so a poller firing after the preview page unmounts can never emit a/assessments/null/...request (the fallback the repo's preview note calls for).useEffect- the reused class component dispatches its fetch incomponentDidMount, which runs before a parent component's effects, so an effect would set the flag too late for the first request.useStartPreviewAttempthook for the create -> navigate -> 409-notify flow.Regression prevention
getActivePreviewsingleton lifecycle; submission, scribing, and create-attempt URL routing including theassessments/nullfallback (mutation-verified); the preview banner render plus its Reset and Exit actions; the route wrapper's synchronous singleton set, unmount cleanup, and course-context forwarding (mutation-verified); both entrances (create -> navigate on success, notification and no navigation on 409); and the index row play button's position between the preview and duplicate buttons and its callback.onAttempttable prop is optional, so existing submission and marketplace behaviour is unchanged.