Skip to content

Conversation

@Tyratox
Copy link
Contributor

@Tyratox Tyratox commented Nov 19, 2025


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

    • New “Showcase” tab to drag-and-drop student and reference solutions, with instant preview.
    • Ordering persists per task via local storage (useShowcaseOrder), fulfilling CRT-204’s requirement.
    • Presentation page with carousel navigation showing the selected solutions in order.
  • Refactors

    • SortableList supports string IDs and an optional noGap layout.
    • CodeView container centers its empty state.

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.

  • Frontend
    • Showcase feature:
      • New Showcase component and page to drag-and-drop solution order (student/reference), preview selection in CodeView, and open a presentation with selected IDs.
    • Presentation mode:
      • New ShowcasePresentation with carousel navigation (prev/next) showing ordered solutions in CodeView.
    • Navigation:
      • Adds showcase tab in TaskInstanceNavigation and routes under .../task/[taskId]/showcase and .../showcase/present.
    • State persistence:
      • useShowcaseOrder hook stores per-task solution ordering in local storage.
    • UI utilities:
      • SortableList now supports string IDs and optional noGap layout.
      • CodeViewContainer centers its empty/placeholder content.

Written by Cursor Bugbot for commit b4fde40. This will update automatically on new commits. Configure here.

@Tyratox Tyratox self-assigned this Nov 19, 2025
@Tyratox Tyratox force-pushed the feature/CRT-204_showcase_tab branch from d9423ba to 01ceabc Compare November 19, 2025 17:03
Copy link
Contributor

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 :-)

@pierluca pierluca merged commit 8b66e77 into feature/CRT-197_ChakraUIIntegration Nov 19, 2025
1 check passed
@pierluca pierluca deleted the feature/CRT-204_showcase_tab branch November 19, 2025 23:19
Copy link

@cursor cursor bot left a 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),
);
Copy link

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.

Fix in Cursor Fix in Web

<LuArrowRight />
</Icon>
</HStack>
</Button>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Wrong message ID for next button in ShowcasePresentation

The next button uses id="ShowcasePresentation.previous" instead of a corresponding next message ID. This causes the wrong translation key to be fetched from i18n, resulting in the previous button's label appearing on the next button.

Fix in Cursor Fix in Web

solutionHash={selectedSolution.solutionHash}
/>
</GridItem>
</Grid>
Copy link

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.

Fix in Cursor Fix in Web

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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}
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 19, 2025

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}
+        /&gt;
+      &lt;/GridItem&gt;
</file context>
Fix with Cubic

<LuArrowLeft />
</Icon>
<FormattedMessage
id="ShowcasePresentation.previous"
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 19, 2025

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 @@
+              &lt;LuArrowLeft /&gt;
+            &lt;/Icon&gt;
+            &lt;FormattedMessage
+              id=&quot;ShowcasePresentation.previous&quot;
+              defaultMessage=&quot;Previous&quot;
+            /&gt;
</file context>
Suggested change
id="ShowcasePresentation.previous"
id="ShowcasePresentation.next"
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants