Long command approvals overflow the full bottom container
https://github.com/user-attachments/assets/6b9cc1b3-4802-4ba5-ad53-74a2449755da the text box should have scroll, not the bottom part of the app
hey @k11kirky can you please assign this issue to me, would love to contribute
Hi team 👋
I've raised a PR to fix this issue: https://github.com/PostHog/code/pull/2333
Root cause: The outer permission panel wrapper used max-h-1/2 (percentage-based max-height), which doesn't resolve in a flex container because it requires a parent with a definite height. As a result, the panel expanded unconstrained.
Fix: Removed the broken constraint from the outer wrapper and moved a viewport-relative max-h-[50vh] onto the ActionSelector dialog box itself, so the entire dialog (title, command preview, and action buttons) scrolls as a single unit within the rounded border. Also cleaned up a redundant inner scroll wrapper in ExecutePermission and McpPermission that would have created a double scrollbar.
Happy to address any feedback. Thanks!
Hey, looked into this one to pick it up. The desktop app recently migrated from PostHog/code into this monorepo (products/desktop), and looking at the current ActionSelector component, the layout already does the right thing: the outer dialog container doesn't overflow (its scrollHeight matches clientHeight), and only the inner content box scrolls (has its own overflow-y-auto with a bounded max height). I reproduced this with a long command via Storybook and confirmed the outer container stays fixed while the inner box scrolls independently.
Looks like this got fixed as a side effect of the migration/rewrite rather than intentionally. Might be worth closing unless someone can still reproduce it on a current build.
Checked this against main today — looks like it's already handled, so wanted to flag before anyone picks it up.
The approval flow now has three stacked layers of scroll containment that cover exactly this case:
products/desktop/packages/ui/src/features/permissions/ExecutePermission.tsxwraps the command itself in<Box className="max-h-[30vh] overflow-auto">.products/desktop/packages/ui/src/primitives/action-selector/ActionSelector.tsxcaps the selector atmax-h-[80vh]withmin-h-0 flex-1 overflow-y-autoon the content wrapper.products/desktop/packages/ui/src/features/sessions/components/PermissionDock.tsxcaps the whole dock at 50–60% of the column height, resizable, withmin-h-0 flex-1 overflow-y-autoaround its children.
A very long or unbroken command scrolls inside the command block rather than growing the dock.
For context: #77138 (closed by stale-bot, never merged) attempted a fix but touched primitives/CodeBlock.tsx instead — that component is only used in chat/markdown rendering (ChatMarkdown, StreamingMarkdown, etc.), not in this approval path, so it wasn't actually fixing this issue.
Happy to be wrong if there's a repro I'm missing — but if not, this looks safe to close.
This appears to be fixed as a side effect of the monorepo migration. The current approval flow has three layers of scroll containment:
- ExecutePermission.tsx: max-h-[30vh] overflow-auto on the command block
- ActionSelector.tsx: max-h-[80vh] with overflow-y-auto on content
- PermissionDock.tsx: max-h-[50-60%] with overflow-y-auto around children
Long commands now scroll inside the command block rather than growing the dock. Confirmed via Storybook. Safe to close.
Hi! I'd like to work on this issue. Please let me know if I can be assigned. Thanks!
Hi! I'd like to fix long command approvals overflowing the bottom container. Plan: reproduce, fix the layout overflow, add a test. May I be assigned?
Hey! Is this issue still open I would like to work on it.
Hi @k11kirky @jonathanlab 👋
I reviewed the layout hierarchy across ExecutePermission.tsx, ActionSelector.tsx, and PermissionDock.tsx on the latest main.
The 3-tier flex containment and max-h-[30vh] bounds appear to already prevent the bottom container overflow reported here. If this is fully resolved on current desktop builds, this looks safe to close; otherwise, if there are specific edge cases still reproducing, I have a patch ready to submit. Let me know!
PostHog self-driving picked up this issue. Status: Research is done.
Somebody may already be working on it, so ask before you start a fix.
Report (team access only): https://us.posthog.com/project/2/inbox/reports/01a204af-f11d-7606-9a10-0a61192ca0e3?link_source=github_comment
The approval dialog now has a bounded height and only the inner content scrolls, so long commands no longer overflow the bottom container. Closing as fixed. Please reopen if you still see it.