Skip to content

Refactor Permutation Visualizer Interaction Model#178

Closed
aaylward wants to merge 3 commits into
mainfrom
refactor-permutation-visualizer-interaction-5987427631121500021
Closed

Refactor Permutation Visualizer Interaction Model#178
aaylward wants to merge 3 commits into
mainfrom
refactor-permutation-visualizer-interaction-5987427631121500021

Conversation

@aaylward

Copy link
Copy Markdown
Contributor

This PR refactors the PermutationVisualizer component to improve its pedagogical value and user experience.

Key Changes:

  1. Interaction Model: Replaced the previous drag-and-drop system, which allowed users to map multiple domain elements to the same image element (creating non-bijective functions), with a swap-based interaction. Users now swap elements in the bottom row (Image) relative to a fixed top row (Domain). This constraint ensures that the state always represents a valid permutation.
  2. Visual Structure: Explicitly labels the visualization as "Two-Line Notation", with the top row representing the input (1, 2, 3, 4) and the bottom row representing the output.
  3. Real-time Feedback: The "Cycle Graph" and "Cycle Notation" now update instantly as users swap elements, reinforcing the connection between different representations of the same permutation.
  4. UX Polish: Updated instructions and removed error states associated with invalid mappings.

Verification:

  • Manual Verification: Verified using a Playwright script that simulated drag-and-drop swaps and confirmed the resulting cycle notation updates correctly (e.g., swapping 1 and 2 results in (1 2)).
  • Regression Testing: Ran the full test suite (npm run test:run), passing all 204 tests.

PR created automatically by Jules for task 5987427631121500021 started by @aaylward

Replaces the "drag-to-map" interaction model with a "Two-Row Swap" model for constructing permutations. This ensures the visualizer always represents a valid bijection (permutation), preventing invalid states.
- Implements a static top row (Domain) and a draggable bottom row (Image).
- Adds didactic labels for "Two-Line Notation" and "Cycle Graph".
- Updates instructions to explain the swap interaction.
- Removes error handling for non-bijective states as they are now impossible by design.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 15, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
muchq 587274a Commit Preview URL

Branch Preview URL
Mar 09 2026, 01:45 AM

@aaylward aaylward closed this Mar 10, 2026
@aaylward aaylward deleted the refactor-permutation-visualizer-interaction-5987427631121500021 branch March 10, 2026 01:44
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.

1 participant