Skip to content

fix(git): stop Production branch dropdown shifting the create-deployment modal - #3180

Merged
ChiragAgg5k merged 3 commits into
mainfrom
fix-2790-branch-selector-dialog-wiggle
Aug 24, 2026
Merged

fix(git): stop Production branch dropdown shifting the create-deployment modal#3180
ChiragAgg5k merged 3 commits into
mainfrom
fix-2790-branch-selector-dialog-wiggle

Conversation

@cursor

@cursor cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the layout wiggle when opening the Production branch dropdown inside Create Git deployment (and other dialogs that use BranchSelector).

Cause: The dropdown used position: fixed but was portaled into the open <dialog>. Dialogs commonly establish a containing block (transform/filter), so fixed behaved like absolute inside the dialog and the menu participated in dialog layout — shifting modal contents on open (#2790).

Fix: Always portal to document.body, and stopPropagation on mousedown/click so modal outside-click dismiss does not fire when interacting with the menu.

Test Plan

  1. Open a function → Create deployment → Git.
  2. Click the Production branch dropdown.
  3. Confirm the modal contents (function name, cards, etc.) no longer shift/wiggle.
  4. Confirm selecting a branch still works and clicking outside still closes the menu/modal appropriately.

Related PRs and Issues

Fixes #2790

Have you read the Contributing Guidelines on issues?

Yes

Open in Web View Automation 

Portaling the fixed-position dropdown into <dialog> made it resolve
against the dialog containing block, so opening Production branch
shifted modal contents (#2790). Append to document.body instead and
stopPropagation so outside-click dismiss still works.

Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
@appwrite

appwrite Bot commented Aug 24, 2026

Copy link
Copy Markdown

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Environment variables can be scoped per function or shared across your project

@cursor
cursor Bot requested a review from ChiragAgg5k August 24, 2026 03:37
@cursor
cursor Bot marked this pull request as ready for review August 24, 2026 03:37
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR updates BranchSelector to portal dropdowns into their owning dialog, calculate dialog-local positioning, and prevent dropdown interactions from reaching modal outside-click handlers.

  • Replaces context-based portal selection with DOM-based dialog discovery.
  • Keeps dropdowns in the native dialog top-layer subtree.
  • Adjusts coordinates for dialog-local fixed positioning.
  • Stops mouse and click propagation from dropdown content.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/lib/components/git/branchSelector.svelte The revised portal target resolves both previously reported dialog-stacking issues, and no additional concrete blocking failure was established.

Reviews (3): Last reviewed commit: "fix(git): detect owning dialog via close..." | Re-trigger Greptile

Comment thread src/lib/components/git/branchSelector.svelte
Body portals sit under showModal() top layer, so the dropdown was
unreachable. Keep portaling into the open dialog for stacking, but
convert getBoundingClientRect() to dialog-local coordinates — fixed
positioning inside the dialog is relative to that box, and viewport
coords were what shifted the modal (#2790).

Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
Comment thread src/lib/components/git/branchSelector.svelte Outdated
Svelte slot projection means BranchSelector never sees pink Modal's
dialog-group context, so the dialog portal path never ran. Use
containerEl.closest('dialog') instead so create-deployment menus
still join the showModal() top layer with dialog-local coordinates.

Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
@ChiragAgg5k
ChiragAgg5k merged commit 5ed1b66 into main Aug 24, 2026
4 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix-2790-branch-selector-dialog-wiggle branch August 24, 2026 04:24
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.

Ui wiggling when clicking on production branch dropdown in functions create deployment option

2 participants