Anchor menus inside size containers to their button #514
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.57) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #514"
general
weight: 0.35
jaysbeekay
<!-- claude-projects-attribution: {"github_login":"jaysbeekay"} -->
_Requested by Jonathan · project thread_
Summary
Closes #505.
Before: a "..." menu inside an
@containeropened far from its button. On Bills › All bills it landed 445px left of the button, which is the container's offset. On a phone it landed above the page header. The Portfolio page's menu did the same, and so did the old inline bill pane in the report.After: the menu opens against its button. On desktop the right edges align, below the button or flipped above it. On a phone it spans the screen directly under the button.
@floating-ui/utils0.2.9 counted anycontainer-typeancestor as the containing block of aposition: fixedelement. Browsers don't, so the menu's coordinates were measured from the container while the browser applied them to the window. 0.2.12 drops that check.How: only
@floating-ui/utilsmoves, from 0.2.9 to 0.2.12. Both vendored utils files are replaced from the npm tarball, and the importmap version comments are updated.domandcore1.7.0 accept^0.2.9, and every name they import is still exported. Apart from thecontainerTyperemoval, the utils diff is refactoring.Scope and dependencies
@floating-ui/dom/coreto 1.8.0; per-view workarounds that move menus out of containers. The files are vendored from npm because jspm is unreachable from the build sandbox;bin/importmap pinwould fetch the same 0.2.12 dist, minified.Evidence checklist
BillMenuPositionTest.)BigDecimaland documented rounding points. (N/A: presentation only.)Files:
vendor/javascript/@floating-ui--utils.js,vendor/javascript/@floating-ui--utils--dom.js,config/importmap.rb,test/system/bill_menu_position_test.rb(new).Validation
Commands and results (local, Ruby 3.3.6, Chromium 141):
bin/rails test test/system/bill_menu_position_test.rbon 0.2.12: 2 runs, 0 failures.@floating-ui--utils--dom.jsrestored to 0.2.9 (mutation):bin/rails test:system: 215 runs, 0 failures, 0 errors.bin/rails test: 12444 runs, 1 failure. The failure isProvider::OpenaiTest#test_extra_headers_stringifies_nested_values_Ruby-style, which expects Ruby 3.4'sHash#inspectformat. It fails only because the sandbox runs Ruby 3.3.6 and is unrelated to this change.bin/brakeman --no-pager: 0 warnings.bin/rubocopon the new test: no offenses. Biome only coversapp/javascript/*, and no file there changed.AGENTS.md: Minitest system test, no new dependency (version bump of an existing pin), commit subjects under 72 characters, no UI or design-token changes.Risks, blockers, and follow-up
DS::Menu,DS::Popover,DS::Tooltip, theselect,merchant_select,tag_selectandtooltipcontrollers) picks up the new utils. Behaviour changes only for elements with acontainer-typeancestor, which is the fix. The full system suite is green.<!-- This is an auto-generated description by cubic. -->
<a href="https://cubic.dev/pr/jaysbeekay/sure/pull/514?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture>`
<source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/jaysbeekay/sure/514?returnTo=https%3A%2F%2Fgithub.com%2Fjaysbeekay%2Fsure%2Fpull%2F514&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture>``<source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg">```</picture></a><!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Improved bill menu positioning across desktop and mobile layouts, keeping menus aligned with their controls and positioned nearby on smaller screens.
Tests
Added coverage for bill menu placement across desktop and phone-sized viewports.
Chores
* Updated positioning utilities to support more consistent layout behavior across browsers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->