Skip to content

fix playwright slides test, and fix sizing#9642

Merged
Light2Dark merged 1 commit into
mainfrom
sham/fix-playwright
May 21, 2026
Merged

fix playwright slides test, and fix sizing#9642
Light2Dark merged 1 commit into
mainfrom
sham/fix-playwright

Conversation

@Light2Dark
Copy link
Copy Markdown
Collaborator

📝 Summary

  1. Fix playwright test
  2. For a notebook with very few cells, we didn't stretch the slide area fully. This fixes that. See the snapshot picture for reference.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Copilot AI review requested due to automatic review settings May 21, 2026 14:01
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment May 21, 2026 2:01pm

Request Review

@Light2Dark Light2Dark added internal A refactor or improvement that is not user facing bug Something isn't working labels May 21, 2026
Copy link
Copy Markdown
Contributor

@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.

No issues found across 5 files

Architecture diagram
sequenceDiagram
    participant Playwright as Playwright Test
    participant Browser as Browser Page
    participant Reveal as Reveal.js Deck
    participant Slides as SlidesLayout
    participant Minimap as Slides Minimap

    Note over Playwright,Minimap: Slide Rendering & Keyboard Navigation Flow

    Playwright->>Browser: Navigate to slides page
    Browser->>Reveal: Initialize slide deck
    Reveal->>Reveal: Set tabIndex=-1 on .reveal wrapper
    Reveal->>Reveal: Focus .reveal wrapper (preventScroll: true)
    Reveal-->>Browser: Deck ready

    Browser->>Slides: Render slides layout
    Slides->>Slides: Apply flex-1 class for vertical stretching
    Slides->>Minimap: Pass cells with output
    Minimap-->>Slides: Render minimap
    Slides-->>Browser: Rendered slides container

    Playwright->>Browser: Query .slides > section elements
    Browser->>Reveal: Get slide sections
    Reveal-->>Browser: Return sections
    Browser-->>Playwright: 2 slides found
    Playwright->>Browser: Assert nth(0) has class .present

    Playwright->>Browser: Click slides container
    Browser->>Browser: Set document.activeElement to .reveal wrapper
    Browser-->>Playwright: Focus confirmed via polling

    Playwright->>Browser: Press ArrowRight key
    Browser->>Reveal: Dispatch keydown event
    alt document.activeElement is not input/textarea
        Reveal->>Reveal: Advance to next slide
        Reveal-->>Browser: nth(1) slide has class .present
    else document.activeElement is input/textarea (e.g., speaker notes)
        Reveal->>Reveal: Ignore keydown (no navigation)
    end
    Browser-->>Playwright: Assert nth(1) has class .present

    Playwright->>Browser: Press ArrowLeft key
    Browser->>Reveal: Dispatch keydown event
    alt document.activeElement is .reveal wrapper
        Reveal->>Reveal: Go to previous slide
        Reveal-->>Browser: nth(0) slide has class .present
    end
    Browser-->>Playwright: Assert nth(0) has class .present
Loading

Re-trigger cubic

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR stabilizes the slides Playwright E2E test by making slide selection and keyboard navigation more reliable, and adjusts the editor slides layout so the slide area properly stretches even for notebooks with very few cells.

Changes:

  • Ensure Reveal’s deck wrapper receives focus on initialization so arrow-key navigation works without requiring a click (even when focus was previously restored to an input like speaker notes).
  • Fix slides layout sizing by letting the editor slides container grow to fill available space.
  • Update the Playwright slides test to identify slides positionally and verify focus/navigation behavior more robustly.

Reviewed changes

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

File Description
frontend/src/components/slides/reveal-component.tsx Forces focus onto the Reveal wrapper on deck ready to make keyboard navigation consistent.
frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx Adds flex-1 to ensure the slides layout stretches to fill the available vertical space.
frontend/e2e-tests/slides.spec.ts Updates slide selection logic and adds a focus assertion to reduce flakiness in keyboard navigation.

@Light2Dark Light2Dark requested a review from mscolnick May 21, 2026 15:37
@Light2Dark Light2Dark enabled auto-merge (squash) May 21, 2026 15:37
@Light2Dark Light2Dark merged commit 973f073 into main May 21, 2026
36 of 37 checks passed
@Light2Dark Light2Dark deleted the sham/fix-playwright branch May 21, 2026 15:56
@github-actions
Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.7-dev73

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

Labels

bug Something isn't working internal A refactor or improvement that is not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants