From a8f9fd7a56f7dd02a2a8e762267dc2dccbfbb2de Mon Sep 17 00:00:00 2001 From: bincxz <16399091+binaricat@users.noreply.github.com> Date: Wed, 3 Jun 2026 10:34:54 +0800 Subject: [PATCH] fix(autocomplete): make popup panels border-box for exact width clamp Codex P2: the panel maxWidth constants used by the horizontal clamp's totalWidth excluded each panel's padding + border (inline styles default to content-box), so a padded detail tooltip at its 280px max could still render wider than reserved and spill off-screen. Set box-sizing: border-box on the shared panel style so every maxWidth is the true outer width and totalWidth is exact. Co-Authored-By: Claude Opus 4.8 --- components/terminal/autocomplete/AutocompletePopup.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/terminal/autocomplete/AutocompletePopup.tsx b/components/terminal/autocomplete/AutocompletePopup.tsx index 0edf74e83..40bcbdff1 100644 --- a/components/terminal/autocomplete/AutocompletePopup.tsx +++ b/components/terminal/autocomplete/AutocompletePopup.tsx @@ -273,6 +273,10 @@ const AutocompletePopup: React.FC = ({ const clampedLeft = placement.left; const sharedBoxStyle = { + // border-box so each panel's maxWidth is its true outer width (padding + + // border included). The horizontal clamp's totalWidth sums these maxWidths, + // so this keeps the off-screen math exact even for the padded detail panel. + boxSizing: "border-box" as const, backgroundColor: popupBg, border: `1px solid ${popupBorder}`, borderRadius: "6px",