Skip to content

fix: anchor 160px from top, center on small viewports#809

Merged
rohanchkrabrty merged 1 commit into
mainfrom
worktree-fix-dialog
May 15, 2026
Merged

fix: anchor 160px from top, center on small viewports#809
rohanchkrabrty merged 1 commit into
mainfrom
worktree-fix-dialog

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Dialog and AlertDialog now anchor at 160px from the top of the viewport instead of being vertically centered.
  • On short viewports (where 160px would push content off-screen), the dialog gracefully falls back to true vertical centering — no media queries needed.
  • Implemented via transform: translate(-50%, min(160px, calc(50vh - 50%))). The inner 50% resolves to the element's own height, so min() smoothly switches between the 160px-anchored and centered positions as the viewport resizes.
  • Nested-dialog scaling and starting/ending animation styles updated to use the same translate expression.

Replaces the always-centered positioning of Dialog and AlertDialog with a
160px top offset on tall viewports, falling back to vertical centering when
the viewport is too short to fit the offset. The whole vertical position is
expressed as `translateY(min(160px, calc(50vh - 50%)))` so the transition
between the two modes happens smoothly on resize without media queries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment May 14, 2026 7:54pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request updates dialog positioning and animation behavior in a single CSS module. The .dialogContent class transitions from centered viewport positioning to top-aligned positioning with a viewport-aware vertical offset that accounts for small screens. The default transition now animates only opacity, while nested dialog animations maintain their scaling effects alongside the new viewport-aware positioning. The starting and ending animation states for nested dialogs are updated to combine the viewport-aware translation with a scale transformation.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, providing detailed context about the positioning changes, implementation approach, and affected components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: dialog positioning anchored at 160px from top with responsive fallback to center on small viewports.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohanchkrabrty rohanchkrabrty changed the title fix(dialog): anchor 160px from top, center on small viewports fix: anchor 160px from top, center on small viewports May 15, 2026
@rohanchkrabrty rohanchkrabrty merged commit 0a4ce97 into main May 15, 2026
5 checks passed
@rohanchkrabrty rohanchkrabrty deleted the worktree-fix-dialog branch May 15, 2026 08:23
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.

2 participants