fix(next): prefer below placement for location pickers

Merged
TE
8d ago
+45-11

Location pickers now prefer opening below their trigger whenever the full menu fits, flipping above only when below has no room or less available space. The chosen side remains fixed while rows filter or refresh.

Adds a gallery regression for both sides fitting, while retaining the existing no-room-above side-stability coverage.

Changelog

Changed

  • Prefer below placement for composer and New Tab location menus.

Validation: git diff --check passed. Managed Chromium gallery execution completed for the exact head; local Chromium was not run.

Lawrence: “context menus should show below if possible”.

Managed Chromium capture (exact head)

Receipt: gallery advisory run 40795863363, artifact gallery-advisory-27146-efcb2d1533e146e1866f26c37a15295e7119390c. The artifact contains the exact light/dark before/after paths below (Chromium, narrow component width):

  • Light before: base/agent-pane.composer-context-side--filter-keeps-side--en--Apple_System_Colors_Light--w400-chromium.png; light after: head/agent-pane.composer-context-side--filter-keeps-side--en--Apple_System_Colors_Light--w400-chromium.png.
  • Dark before: base/agent-pane.composer-context-side--filter-keeps-side--en--Apple_System_Colors--w400-chromium.png; dark after: head/agent-pane.composer-context-side--filter-keeps-side--en--Apple_System_Colors--w400-chromium.png.
  • New below-when-room light: head/agent-pane.composer-context-side--below-when-room--en--Apple_System_Colors_Light--w400-chromium.png; dark: head/agent-pane.composer-context-side--below-when-room--en--Apple_System_Colors--w400-chromium.png.

Agent session: agent session


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Location pickers in the composer and New Tab now prefer opening below their trigger whenever the full menu fits, flipping above only when below has no room or less available space. The chosen side stays fixed while rows filter or refresh.

  • Adds a gallery regression case for when both sides fit, alongside the existing no-room-above side-stability coverage.
  • Updates the browser test to cover the below-when-room variant.