Skip to content

fix: add portal toggle to Popover and i18n for Combobox remove - #1131

Open
kittyyueli wants to merge 2 commits into
mainfrom
claude/lib-ui-registry-compliance-clcr1r
Open

fix: add portal toggle to Popover and i18n for Combobox remove#1131
kittyyueli wants to merge 2 commits into
mainfrom
claude/lib-ui-registry-compliance-clcr1r

Conversation

@kittyyueli

Copy link
Copy Markdown
Member

Summary

This PR makes two targeted improvements to the component library:

  1. Popover: Adds optional control over portal behavior to support nested inputs within dialogs
  2. Combobox: Internationalizes the "Remove" button label using i18n

Changes

  • Popover (popover.tsx)

    • Added portal prop (defaults to true) to PopoverContent to conditionally wrap content in PopoverPrimitive.Portal
    • Includes explanatory comment: portaled content sits outside an enclosing dialog's focus scope, which can reclaim focus; portal={false} keeps it inside so nested inputs remain usable
    • Uses React.Fragment as wrapper when portal={false}
  • Combobox (combobox.tsx)

    • Imported useTranslation from react-i18next
    • Updated ComboboxBadge to use t("remove") instead of hardcoded "Remove" string
    • Maintains sr-only class for screen reader accessibility
  • Localization (en.json)

    • Added "remove": "Remove" entry to English locale file

Implementation Details

The Popover change is backward-compatible—the default portal={true} preserves existing behavior. The conditional wrapper pattern allows consumers to opt into keeping popover content within a dialog's focus scope when needed.

The Combobox i18n change follows the existing translation pattern in the codebase and enables multi-language support for the remove button label.

https://claude.ai/code/session_01SnmiT3edq81s2qTDqoE8zP

The badge's remove button hard-coded "Remove" for screen readers while the item
already declared react-i18next as a dependency. Route it through t(), the same
way sheet.tsx handles its close label, and add the key to en.json.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnmiT3edq81s2qTDqoE8zP
Portaled content sits outside an enclosing dialog's focus scope, which then
reclaims focus from it and leaves nested inputs untypeable. portal={false}
keeps the content in the tree; the default is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnmiT3edq81s2qTDqoE8zP
Copilot AI lite review requested due to automatic review settings September 8, 2026 04:41
@kittyyueli
kittyyueli requested a review from a team as a code owner September 8, 2026 04:41
@kittyyueli kittyyueli changed the title Add portal toggle to Popover and i18n for Combobox remove fix: add portal toggle to Popover and i18n for Combobox remove Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Sep 07, 2026, 09:49:14 PM
apollo-docs Ready Preview · Logs Sep 07, 2026, 09:49:14 PM
apollo-landing Ready Preview · Logs Sep 07, 2026, 09:49:14 PM
apollo-vertex Ready Preview · Logs Sep 07, 2026, 09:49:14 PM

@github-actions github-actions Bot added the size:S 10-29 changed lines. label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1937 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1708
ISC 88
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.2 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copy link
Copy Markdown
Member Author

enable-auto-merge is red, and it is not this PR's failure.

GraphQL: Resource not accessible by integration (enablePullRequestAutoMerge)

The RELEASER app token generated by apollo-vertex-auto-merge.yml cannot enable auto-merge, so gh pr merge --auto --rebase exits 1. The job runs only on PRs scoped entirely to apps/apollo-vertex/, which is why this one hits it — nothing in the diff (a portal prop on PopoverContent, t("remove") in ComboboxBadge, one en.json key) is reachable from it.

It reproduces across unrelated PRs: runs 1120, 1121, 1122, 1123, 1124, 1125, 11261130, 1131 and 1132 all failed the same way, on five different branches and four authors. The only recent pass is 1133, the localization sync bot. That evidence is stronger than a re-run would be, so I have not spent one — a re-run fails identically while the permission is missing.

No fix exists that belongs in this PR. The two real fixes are both outside it:

  • grant the RELEASER app installation permission to enable auto-merge, and confirm Allow auto-merge is on in repository settings; or
  • make the step tolerant of the missing permission in .github/workflows/apollo-vertex-auto-merge.yml.

I have deliberately not done the second: editing anything outside apps/apollo-vertex/ flips the workflow's own vertex_only check to false, which changes this PR's auto-merge scope, and it widens a three-file registry change into a CI change. Happy to open a separate PR for it if that is the preferred route.

Every other check is green or still running; this is the only failure on a251690.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new remove i18n key is only added to en.json, leaving other supported locale files out of sync and potentially untranslated in non-English locales.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Apollo Vertex registry UI components to (1) allow Popover content to render without a Radix Portal when needed (e.g., inside dialogs with focus management), and (2) internationalize the Combobox badge “Remove” screen-reader label via react-i18next.

Changes:

  • Added an optional portal?: boolean prop to PopoverContent (default true) to conditionally wrap content in PopoverPrimitive.Portal.
  • Replaced the hardcoded "Remove" sr-only label in ComboboxBadge with t("remove").
  • Added an English remove translation key.
File summaries
File Description
apps/apollo-vertex/registry/popover/popover.tsx Adds a portal toggle to render popover content in-place when needed for focus-scoped containers (e.g., dialogs).
apps/apollo-vertex/registry/combobox/combobox.tsx Uses i18n (useTranslation) for the Combobox badge remove button sr-only label.
apps/apollo-vertex/locales/en.json Adds the remove translation key in English.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 217 to 222
"projects": "Projects",
"recent_activity": "Recent Activity",
"recent_invoices": "Recent Invoices",
"remove": "Remove",
"remove_file": "Remove {{name}}",
"remove_from_expected_result": "Remove from baseline",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this, and I'm leaving it as-is — English-only is the required state for a new key in this repo.

apps/apollo-vertex/AGENTS.md:

Only edit locales/en.json. Add new keys there in alphabetical order. Do not touch the other locale files — the localization team syncs translations into them as a separate workflow. PRs that modify non-English locales will be sent back.

On the two predicted outcomes: lib/i18n.ts sets fallbackLng: DEFAULT_LOCALE with DEFAULT_LOCALE = "en", so a missing key renders the English string. The raw key is never shown.

There is precedent in the tree too — 13 keys in en.json are absent from de.json right now, the 12 confidence_signal_* keys plus this one, all waiting on the same sync. #1126 is an example of that sync landing.

"remove" was inserted alphabetically, immediately before "remove_file".


Generated by Claude Code

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package bundle size on this PR (no JS/TS source changes detected under packages/* or web-packages/*).

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core
@uipath/apollo-react
@uipath/apollo-ui-icons
@uipath/apollo-wind
@uipath/ap-chat

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Storybook visual diff

✅ No stories are affected by this PR's changes; nothing to compare. Logs

Updated (PT): Sep 07, 2026, 09:50:22 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:apollo-vertex size:S 10-29 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants