Java Lab2: add prompter to theater by molly-moen · Pull Request #73492 · code-dot-org/code-dot-org · GitHub
Skip to content

Java Lab2: add prompter to theater#73492

Open
molly-moen wants to merge 7 commits into
stagingfrom
molly/java-lab2-prompter
Open

Java Lab2: add prompter to theater#73492
molly-moen wants to merge 7 commits into
stagingfrom
molly/java-lab2-prompter

Conversation

@molly-moen

@molly-moen molly-moen commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This PR adds prompter support to the theater in Java Lab on lab2. In legacy, we replace the entire console with the prompter input. That seems non-ideal accessibility wise, and in lab2 Java Lab the theater preview is right next to the console as opposed to off to the side. I opted instead to have a button appear over the preview area (which will have no preview yet since the image must be uploaded before the gif is generated), and to have focus go to the prompter button when it appears. The button text will be the text the user provided.

Legacy behavior

Screen.Recording.2026-06-25.at.11.19.43.AM.mov

Lab2 behavior

This screen recording has the chrome setting on to view the currently highlighted element, so you can see focus going to the button.

Screen.Recording.2026-06-25.at.11.21.27.AM.mov

Testing story

Tested locally and added unit tests.

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 Lab2 Java Lab support for the Theater “photo prompter” workflow by overlaying a focused photo-picker button on the preview area and relaying Theater input messages back to Javabuilder via Codebridge context.

Changes:

  • Wire a new sendTypedInputMessage callback from Java Lab2 runtime utilities through Javalab2ViewCodebridgeCodebridgeContext.
  • Update TheaterPreview to open/close a photo prompter UI and forward selected files to the Theater mini-app.
  • Introduce PhotoPrompterButton (+ styles) and a unit test for focus/label/upload behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/test/unit/codebridge/MiniAppPreview/PhotoPrompterButtonTest.tsx Adds unit tests for the new prompter button.
apps/src/javalab/lab2/Javalab2View.tsx Passes sendTypedInputMessage into Codebridge for Java Lab2.
apps/src/javalab/lab2/javabuilderRunUtils.ts Adds a helper to send typed input messages over the active Javabuilder connection.
apps/src/codebridge/types.ts Defines SendTypedInputMessageFunction in Codebridge types.
apps/src/codebridge/MiniAppPreview/TheaterPreview.tsx Implements prompter open/close + file forwarding for Theater preview.
apps/src/codebridge/MiniAppPreview/PhotoPrompterButton.tsx New overlay button + hidden file input to select a photo.
apps/src/codebridge/MiniAppPreview/photo-prompter-button.module.scss Styles for centered overlay and hidden input.
apps/src/codebridge/MiniAppPreview/mini-app-preview.module.scss Makes the preview container a positioning context for the overlay.
apps/src/codebridge/codebridgeContext/codebridgeContext.tsx Extends Codebridge context type with sendTypedInputMessage.
apps/src/codebridge/Codebridge.tsx Threads sendTypedInputMessage through to the context provider.

Comment thread apps/src/codebridge/MiniAppPreview/PhotoPrompterButton.tsx Outdated
Comment thread apps/src/codebridge/MiniAppPreview/PhotoPrompterButton.tsx
Comment thread apps/test/unit/codebridge/MiniAppPreview/PhotoPrompterButtonTest.tsx Outdated
@molly-moen molly-moen marked this pull request as ready for review June 25, 2026 18:35
@molly-moen molly-moen requested a review from a team June 25, 2026 18:36

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.

useHiddenFileInput could be useful here (may need to add some more params)

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