Skip to content

Standalone Sketch Lab#73988

Merged
molly-moen merged 14 commits into
stagingfrom
molly/standalone-sketch-lab
Jul 21, 2026
Merged

Standalone Sketch Lab#73988
molly-moen merged 14 commits into
stagingfrom
molly/standalone-sketch-lab

Conversation

@molly-moen

@molly-moen molly-moen commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This adds a standalone version of sketch lab, currently only available via /projects/sketchlab/new. It also adds a share view page for standalone sketch lab. The changes included here are:

  • (For all lab2 standalone levels) Auto-collapse the resource panel if AI tutor is not an available tab. Discussed in slack. This lines up how things were working in practice, but simplifies the checks and makes them more robust.
  • Add the new standalone sketch lab level and all required plumbing
  • Add the sketch lab share view. I modeled it after Web Lab 2 and Python Lab, and refactored the side panel used by those labs to be reusable rather than copy/pasting it a third time 😄 I also slightly widened the side panel to fix the new logo. The new logo doesn't show up in light mode, which I started another slack thread about.
  • Don't try to start the sketch lab product tour in share view (it wouldn't start, but would poll for a button unnecessarily).
  • When in read only in sketch lab, default to the grab cursor so you can move the canvas around (the entire toolbar is hidden, so previously you couldn't move the canvas around at all in read only).

The most finicky part of all this was getting the right border on the collapsed tabs working correctly, because we currently draw a border for the previously-opened collapsed tab, but not the other ones. Music Lab has some magical workaround for this where everything looks like one border, and web lab 2/python lab use the resize bar to cover it up (which they shouldn't do, and I will look into fixing that as a follow up). I added a way to hide this extra border so sketch lab can draw a basic 1px border, but there may be a way to clean this up so all labs don't need custom logic here.

Screenshots

Standalone Project

Screenshot 2026-07-20 at 3 40 40 PM

Share view

Screenshot 2026-07-20 at 3 41 31 PM Screenshot 2026-07-20 at 3 41 03 PM

Note that light mode is buggy, see note and linked slack thread above. I also removed "show code" for sketch lab since there's no code to show.

Links

Testing story

Tested locally.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Sketch Lab as a standalone/project-backed Lab2 experience, including share-view UI alignment with other Lab2 labs and project-level wiring in dashboard.

Changes:

  • Adds a new Sketch Lab project level and registers sketchlab as a project type in ProjectsController.
  • Introduces a reusable Lab2 share sidebar (ShareButtonPanel) and adopts it in Web Lab 2, Python Lab, and Sketch Lab.
  • Updates Sketch Lab ReactFlow view to support share mode and standalone resource-panel collapsing behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dashboard/config/levels/custom/sketchlab/New Sketch Lab Project.level Adds the “New Sketch Lab Project” level config marked as a project level.
dashboard/app/models/levels/sketchlab.rb Persists is_project_level on Sketch Lab levels.
dashboard/app/controllers/projects_controller.rb Registers sketchlab in the project-level name map.
apps/src/weblab2/layout/ShareView.tsx Refactors share sidebar to use shared ShareButtonPanel.
apps/src/pythonlab/layout/ShareView.tsx Refactors share sidebar to use shared ShareButtonPanel while keeping lab-specific controls.
apps/src/sketchlab/reactFlow/ShareView.tsx Adds a Sketch Lab share-only view using standard share sidebar + read-only canvas.
apps/src/sketchlab/reactFlow/ReactFlowSketchLabView.tsx Adds share-view branching and better handling for collapsed standalone resource panel.
apps/src/sketchlab/reactFlow/introTour/useReactFlowSketchLabTour.ts Allows disabling the intro tour in share view.
apps/src/sketchlab/reactFlow/components/ReactFlowCanvas.tsx Defaults tool to “grab” for read-only viewers.
apps/src/lab2/views/components/layout/ShareButtonPanel.tsx New shared sidebar component for share pages (view/remix/report).
apps/src/lab2/views/components/layout/share-layout.module.scss Widens share sidebar column to fit buttons.
apps/src/lab2/views/components/Instructions/ResourcePanel/index.tsx Adjusts standalone auto-collapse behavior (keep open when AI Tutor tab exists).
apps/src/lab2/constants.ts Enables new share dialog handling for sketchlab.

Comment thread apps/src/lab2/views/components/layout/ShareButtonPanel.tsx
@molly-moen
molly-moen marked this pull request as ready for review July 20, 2026 23:55
@molly-moen
molly-moen requested review from a team July 20, 2026 23:55

@hannahbergam hannahbergam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Super thoughtful and also exciting! Godspeed

@@ -0,0 +1,77 @@
import FontAwesomeV6Icon from '@code-dot-org/component-library/fontAwesomeV6Icon';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for this refactor!

@molly-moen
molly-moen merged commit 2b5cebc into staging Jul 21, 2026
8 checks passed
@molly-moen
molly-moen deleted the molly/standalone-sketch-lab branch July 21, 2026 18:07
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