Anchor menus inside size containers to their button #519
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.48) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 556 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.378
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #519"
general
weight: 0.35
jaysbeekay
Closes jaysbeekay/sure#505.
Upstream PR: we-promise/sure#4370 (draft), on upstream issue we-promise/sure#4366. Same branch, same commit: this pre-flight runs the fork's CI and Gatekeeper reviews on
up/floating-ui-container-menusagainstmirror/upstream-main. It ports jaysbeekay/sure#514 (forkmain) onto upstreammain.Problem
A
DS::Menuwhose button sits inside an element withcontainer-type(Tailwind@container) opens away from its button. It is offset up and left by that element's distance from the viewport's top-left corner. Onmainthis affects every row "..." menu on Bills > All bills, in both the list and the table layout. On a wide window the menu lands over unrelated content, and on a phone the full-width menu can open above the page header.The cause is in the vendored
@floating-ui/utils0.2.9. ItsisContainingBlockcounts anycontainerTypeother thannormalas the containing block of aposition: fixedelement. Browsers do not, so floating-ui returns coordinates relative to the container while the browser applies them to the viewport.Change
@floating-ui/utilsfrom 0.2.9 to 0.2.12. 0.2.12 removes thecontainerTypeclause fromisContainingBlock. No other file changes.vendor/javascript/@floating-ui--utils.jsand@floating-ui--utils--dom.jsare replaced withdist/floating-ui.utils.mjsanddist/floating-ui.utils.dom.mjsfrom the npm 0.2.12 tarball. Below a two-line source header, each file is byte-identical to the tarball file, and the tarball matches the registry's published sha512 integrity.config/importmap.rbare updated.@floating-ui/domand@floating-ui/core1.7.0 both declare@floating-ui/utils: ^0.2.9. Every name they import or re-export fromutilsandutils/domis still exported by 0.2.12, and the export lists of the two versions are identical. Apart from thecontainerTyperemoval, the diff from 0.2.9 to 0.2.12 is refactoring: regexes in place of array lookups, a cachedisWebKit, hoisted constants. So floating-ui elements outside a size container behave as before. That coversDS::Menu,DS::Popover,DS::Tooltip, and theselect,merchant_select,tag_selectandtooltipcontrollers.Left out on purpose: bumping
domandcore, and per-view workarounds such as moving menus out of containers or a customplatformper controller.Screenshots
Captured by a system test against the test fixtures: before on
mainat7917bc1e4, after on this branch. Bills > All bills with the first row's "..." menu open.| Before (
@floating-ui/utils0.2.9) | After (0.2.12) ||---|---|
| !Before: the menu opens at the top left of the page, away from its button | !After: the menu opens under its button |
Before, the menu opens at the top left of the page, a container's width away from its button. After, it opens under the button.
Tests
New
test/system/bill_menu_position_test.rbopens the first row menu inside the@containeron Bills > All bills and measures the menu against its own button:placement: "bottom-end"), and the menu sits beside the button.flip()placed the menu on top. A legitimate flip therefore cannot fail the test.On this branch, against remote Chromium (selenium/standalone-chromium), both tests pass. With both vendored utils files restored to
main's 0.2.9 they fail: desktopExpected |936 - 475| (461) to be <= 1; phonemenu is 128px from its button. A node check ofisContainingBlockgivestrueforcontainer-type: inline-sizeandsizeon 0.2.9 andfalseon 0.2.12.transform,filter,will-change: transformandcontain: paintstaytrueon both.bin/rails test: 12474 runs, 0 failures, 0 errors, 36 skips.test/system/bill_menu_position_test.rb: 2 runs, 0 failures (remote Chromium). The full system suite runs in CI.bin/rubocop: no offenses.bin/brakeman --no-pager: no warnings. Biome coversapp/javascript/**only, and no file there changed.