-
Notifications
You must be signed in to change notification settings - Fork 0
[CRT-204] Add showcase view #409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CRT-204] Add showcase view #409
Conversation
d9423ba to
01ceabc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file feels like it should probably be split across multiple files, adding this to the list of things to revisit after the deadline :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| }) satisfies CurrentAnalysisWithId, | ||
| ) | ||
| .toSorted((a, b) => a.index - b.index), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Showcase filter excludes student solutions
The code filters analyses to only include reference solutions via .filter((a) => a.isReferenceSolution), but the feature should display both student and reference solutions. This means student solutions won't appear in the showcase list, breaking the drag-and-drop functionality described in the PR.
| <LuArrowRight /> | ||
| </Icon> | ||
| </HStack> | ||
| </Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| solutionHash={selectedSolution.solutionHash} | ||
| /> | ||
| </GridItem> | ||
| </Grid> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Potential crash accessing undefined solution in carousel
When provided solution IDs don't match any fetched analyses (e.g., deleted solutions or tampered URLs), selectedAnalyses becomes empty. Accessing selectedSolution.solutionHash on line 139 then crashes since selectedAnalyses[carousel.page] is undefined. The parent page guards against empty selectedSolutionIds but not against mismatched solution availability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic analysis
2 issues found across 8 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="frontend/src/components/dashboard/ShowcasePresentation.tsx">
<violation number="1" location="frontend/src/components/dashboard/ShowcasePresentation.tsx:93">
The “Next” button reuses the previous-button translation id, making it impossible to localize a distinct label for “Next”.</violation>
<violation number="2" location="frontend/src/components/dashboard/ShowcasePresentation.tsx:139">
CodeView unconditionally reads selectedSolution.solutionHash, which crashes whenever no selected analyses exist or the carousel index exceeds the filtered list.</violation>
</file>
Linked issue analysis
Linked issue: CRT-204: Add new showcase view
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | The ordering must be persisted | useShowcaseOrder hook saves per-task order to localStorage |
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| sessionId={session.id} | ||
| taskId={task.id} | ||
| taskType={task.type} | ||
| solutionHash={selectedSolution.solutionHash} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeView unconditionally reads selectedSolution.solutionHash, which crashes whenever no selected analyses exist or the carousel index exceeds the filtered list.
Prompt for AI agents
Address the following comment on frontend/src/components/dashboard/ShowcasePresentation.tsx at line 139:
<comment>CodeView unconditionally reads selectedSolution.solutionHash, which crashes whenever no selected analyses exist or the carousel index exceeds the filtered list.</comment>
<file context>
@@ -0,0 +1,182 @@
+ sessionId={session.id}
+ taskId={task.id}
+ taskType={task.type}
+ solutionHash={selectedSolution.solutionHash}
+ />
+ </GridItem>
</file context>
| <LuArrowLeft /> | ||
| </Icon> | ||
| <FormattedMessage | ||
| id="ShowcasePresentation.previous" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “Next” button reuses the previous-button translation id, making it impossible to localize a distinct label for “Next”.
Prompt for AI agents
Address the following comment on frontend/src/components/dashboard/ShowcasePresentation.tsx at line 93:
<comment>The “Next” button reuses the previous-button translation id, making it impossible to localize a distinct label for “Next”.</comment>
<file context>
@@ -0,0 +1,182 @@
+ <LuArrowLeft />
+ </Icon>
+ <FormattedMessage
+ id="ShowcasePresentation.previous"
+ defaultMessage="Previous"
+ />
</file context>
| id="ShowcasePresentation.previous" | |
| id="ShowcasePresentation.next" |
Summary by cubic
Adds a new Showcase view and presentation mode to sort, preview, and present task solutions. The order is saved per task, so it stays put across sessions.
New Features
Refactors
Written for commit b4fde40. Summary will update automatically on new commits.
Note
Adds a Showcase tab to sort and preview solutions with per-task persistent order, plus a presentation mode with carousel navigation.
Showcasecomponent and page to drag-and-drop solution order (student/reference), preview selection inCodeView, and open a presentation with selected IDs.ShowcasePresentationwith carousel navigation (prev/next) showing ordered solutions inCodeView.showcasetab inTaskInstanceNavigationand routes under.../task/[taskId]/showcaseand.../showcase/present.useShowcaseOrderhook stores per-task solution ordering in local storage.SortableListnow supports string IDs and optionalnoGaplayout.CodeViewContainercenters its empty/placeholder content.Written by Cursor Bugbot for commit b4fde40. This will update automatically on new commits. Configure here.