Fix scrolling and accessibility issues in Bloblang playgrounds#366
Fix scrolling and accessibility issues in Bloblang playgrounds#366
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR enhances the Bloblang interactive playground with CSS layout refinements, accessibility improvements, and JavaScript refactoring. Changes span three CSS files with editor container sizing, scrollbar styling, dark mode support, and mobile responsiveness; significant JavaScript refactoring in parser enhancements (# Out:, # Output:, # Input: directives), tooltip system refactoring with touch device handling, and accessibility features (ARIA attributes, focus trapping); an extended Ace editor initialization API accepting an options object; and corresponding template updates. Documentation is added to CLAUDE.md. Sequence DiagramsequenceDiagram
actor User
participant UI as UI/DOM
participant JS as JavaScript Handler
participant Ace as Ace Editor
participant Tooltip as Tooltip System
participant A11y as Accessibility Layer
User->>UI: Click "Try It" / Open Playground
UI->>JS: Trigger mini-playground initialization
JS->>A11y: Set up focus trap
JS->>A11y: Apply ARIA attributes (roles, labels, live regions)
JS->>Ace: Initialize with options (minLines: 5, maxLines: null, wrap: true)
Ace->>Ace: Configure CSS-driven height constraints
Ace-->>JS: Editor ready
JS->>Tooltip: Initialize tooltips with touch detection
Tooltip->>Tooltip: Compute isTouch state once
alt Touch Device
Tooltip->>Tooltip: Adjust triggers to focus/click
Tooltip->>A11y: Add aria attributes to tooltips
else Non-Touch
Tooltip->>Tooltip: Use hover triggers
end
JS->>JS: Parse directives (# Input:, # Output:, # Out:)
JS->>Ace: Populate editor with content
Ace->>UI: Render editor with styled scrollbars
A11y->>UI: Enable keyboard navigation and focus indicators
User->>UI: Interact (type, run, close)
JS->>A11y: Update ARIA live regions (status messages)
A11y->>User: Announce state changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for docs-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/js/16-bloblang-interactive.js (1)
763-774:⚠️ Potential issue | 🟡 MinorAvoid nested dialog roles on overlay.
Both the overlay and the inner container declarerole="dialog"/aria-modal, which can confuse screen readers. Keep the dialog semantics on the inner container only.🔧 Suggested fix
const overlay = document.createElement('div'); overlay.className = 'bloblang-playground-overlay'; -overlay.setAttribute('role', 'dialog'); -overlay.setAttribute('aria-modal', 'true'); -overlay.setAttribute('aria-labelledby', 'playground-title');
a8c0475 to
b01f8a7
Compare
The editors were cutting off content and hiding scrollbars when dealing with large data. This fixes both the full playground and mini playground. Changes: - Enable word wrap in Ace editors to prevent horizontal text cutoff - Remove maxLines option that conflicted with CSS max-height - Fix overflow:hidden on parent containers that clipped scrollbars - Add explicit scrollbar styling for macOS overlay scrollbar visibility - Add focus trap and ARIA attributes to mini playground modal - Add keyboard shortcut hint (Ctrl+Enter to run) - Skip tooltips on touch devices for Try It, Copy, and Ask AI buttons Also updated CLAUDE.md with notes on these features for future work.
b01f8a7 to
27d4115
Compare

Summary
When testing the Bloblang playgrounds with large data sets (50+ JSON items, long mappings), several issues became apparent:
What's Fixed
Full Playground (
bloblang-playground.hbs,bloblang-playground.css)wrap: trueto Ace editors for word wrappingmaxLines: 50which conflicted with CSS height controloverflow: hiddentooverflow: visibleon parent containers so scrollbars aren't clippedMini Playground (
16-bloblang-interactive.js,bloblang-interactive.css)max-heightinstead ofmaxLinesrole="dialog",aria-modal, andaria-liveattributes for screen readersTouch Device Improvements
Testing