fix(web): related PRs menu no longer crashes in production builds - #57
Conversation
Base UI's MenuGroupLabel throws when it has no Menu.Group ancestor. The "Related PRs" menu rendered its heading, notices, and status labels directly under the popup, so opening it in a production build surfaced Base UI error pingdotgg#31 as an app crash. Wrap those labels in MenuGroup like the rest of the file. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
@coderabbitai review Please review this one-file fix at head a1bff13. Base UI's |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git status --short
git show --no-ext-diff --format=fuller --stat a1bff13a5a7ff70989e4e64384200d8f6cf4fc5e
git diff --no-ext-diff a1bff13a5a7ff70989e4e64384200d8f6cf4fc5e^ a1bff13a5a7ff70989e4e64384200d8f6cf4fc5e --
changed_files=$(git diff-tree --no-commit-id --name-only -r a1bff13a5a7ff70989e4e64384200d8f6cf4fc5e)
printf '\n--- Changed file outlines ---\n'
while IFS= read -r file; do
[ -n "$file" ] || continue
printf '\n### %s\n' "$file"
ast-grep outline "$file" --items all || true
done <<< "$changed_files"Length of output: 6334 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- PullRequestBranchMenu.tsx ---'
sed -n '1,220p' apps/web/src/components/pullRequest/PullRequestBranchMenu.tsx
printf '%s\n' '--- Menu component candidates ---'
fd -t f . apps/web/src/components/ui | rg '/menu(\.|/|$)' || true
printf '%s\n' '--- Menu exports and group implementations ---'
rg -n -C 5 '\b(MenuGroup|MenuGroupLabel|MenuPopup)\b' apps/web/src/components/ui --glob '*.{ts,tsx}'Length of output: 10260 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- apps/web/src/components/ui/menu.tsx: popup, group, and label wrappers ---'
sed -n '1,90p' apps/web/src/components/ui/menu.tsx
sed -n '185,220p' apps/web/src/components/ui/menu.tsx
printf '%s\n' '--- Base UI dependency declarations ---'
rg -n -C 2 '"`@base-ui/react`"|`@base-ui/react`@' --glob 'package.json' --glob 'pnpm-lock.yaml' --glob 'yarn.lock' --glob 'package-lock.json' .
printf '%s\n' '--- All MenuGroupLabel elements in the changed component, with enclosing line context ---'
rg -n -C 3 '<MenuGroupLabel\b' apps/web/src/components/pullRequest/PullRequestBranchMenu.tsxLength of output: 6816
You are interacting with an AI system. |
|
@coderabbitai approve All CI checks passed on a1bff13 (Check, Test, Test Server 1-3, Rust, Release Smoke) and your review found no defects. |
|
🐇 ✅ ✅ Action performedComments resolved and changes approved. |
Problem
Opening the Related PRs menu on a pull request without a native stack crashed the desktop app in 0.0.53 with
Base UI error #31. That is the minified form of "MenuGroupContext is missing. Menu group parts must be used within Menu.Group or Menu.RadioGroup". The menu rendered its heading, notices, and status labels directly under the popup with no group ancestor, and the heading is unconditional, so the menu crashed every time it was opened in a production build.Fix
Wrap the loose labels in
MenuGroup, matching how the rest of the file and the stack menus already do it. The header, notice, and retry item share one group. Each standalone status note gets its own group via a small helper.No behavior change beyond the crash going away. Web typecheck passes.
Written by Claude Fable 5.1 through Claude Code in T3 Code.
🤖 Generated with Claude Code