fix(editor): stop the add-block palette from being clipped by the viewport - #560
Merged
Merged
Conversation
…wport The block palette lists 23 block types across 5 groups (~875px tall), but PopoverContent had no height cap and no scroll, so the bottom of the list was cut off by the viewport on desktop — "Separador" was unreachable and the last row of "Estructura" sat half off-screen. `popover.tsx` was the only base-ui overlay primitive missing the `max-h-(--available-height) overflow-y-auto` treatment that select, dropdown-menu and combobox already have, so fix it there: every over-tall popover now scrolls inside the space the positioner reports instead of overflowing (lesson-component-picker had the same latent bug). Also bumped the palette's legibility: item labels 11px -> 12px at full foreground contrast, group headings 10px/60% -> 11px at full muted-foreground, and the popover 340px -> 360px so the wider labels fit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MVN1bVpXJQ2CT7nv4acFRz
guillermoscript
marked this pull request as ready for review
July 26, 2026 18:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the teacher lesson editor (Contenido tab), clicking Añadir bloque opens a palette listing 23 block types across 5 groups — roughly 875px tall.
PopoverContenthad no height cap and no scroll, so on a normal desktop viewport the bottom of the list was simply cut off: the Separador block was completely unreachable and the last Estructura row sat half off-screen.Measured on a 1440×800 viewport with the lower "Añadir bloque" trigger: popup bottom at 880px vs a 800px viewport → 80px of blocks with no way to reach them.
Root cause
components/ui/popover.tsxwas the only base-ui overlay primitive in the repo missing the height treatment its siblings already have —select.tsx,dropdown-menu.tsxandcombobox.tsxall usemax-h-(--available-height)+overflow-y-auto(base-ui sets--available-heighton the positioner). So any popover taller than the space around its trigger overflowed the viewport.lesson-component-picker.tsxhas the same latent bug.Changes
components/ui/popover.tsx— addmax-h-(--available-height) overflow-y-auto overscroll-contain, matching the other overlay primitives. Fixes every over-tall popover, not just this one.components/teacher/block-editor/add-block-menu.tsx— readability pass on the palette, since the user also reported it was hard to read:text-[11px]muted →text-xsattext-foreground/80(the 11px muted-on-popover pairing was below comfortable contrast)text-[10px]attext-muted-foreground/60→text-[11px]at fulltext-muted-foreground340px→360pxso the larger labels still fit 3 columnsVerification
npm run typecheck— cleannpm run build— passesnpx eslinton both changed files — cleancreator@codeacademy.comon/es/dashboard/teacher/courses/2001/lessons/2001:880px, 80px clipped, "Separador" invisiblemax-height: 774px= reported available height, popup bottom780px(inside the viewport),scrollHeight 874 > clientHeight 774→ scrolls, and Separador is reachableQA script
npm run dev, sign in ascreator@codeacademy.com/password123atcode-academy.lvh.me:3000/es/dashboard/teacher/courses/2001/lessons/2001→ Contenido tab+inserter that appears when hovering between two blocks🤖 Generated with Claude Code
https://claude.ai/code/session_01MVN1bVpXJQ2CT7nv4acFRz