hermes - 💡(How to fix) Fix [Bug]: Profile color picker flickers and closes immediately on right-click → Color… (ContextMenu + Popover nesting conflict)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

On the Hermes Desktop app, right-clicking a profile square and selecting "Color…" from the context menu causes the color picker to briefly flicker and close immediately. The color swatches never remain visible, making the feature unusable.

Same behavior occurs with the long-press gesture (hold the profile square) — the picker flashes and disappears.

Root Cause

The ProfileSquare component nests Radix UI's Popover and ContextMenu primitives as siblings sharing the same trigger element through asChild prop chains:

<Popover onOpenChange={setPickerOpen} open={pickerOpen}>
  <ContextMenu>
    <PopoverAnchor asChild>
      <ContextMenuTrigger asChild>
        <TooltipTrigger asChild>
          <button />

When the ContextMenu closes (after selecting an item), Radix triggers onOpenChange(false) on the Popover, which overrides the programmatic setPickerOpen(true) called from the ContextMenu item handler. The Popover opens and immediately closes in the same frame.

Fix Action

Fix

PR #[TBD] decouples the two primitives entirely. The ContextMenu handles right-click independently. The color picker is rendered via createPortal as an independent floating panel with a backdrop overlay, positioned at the button's coordinates. No shared Radix state to conflict.

Code Example

<Popover onOpenChange={setPickerOpen} open={pickerOpen}>
  <ContextMenu>
    <PopoverAnchor asChild>
      <ContextMenuTrigger asChild>
        <TooltipTrigger asChild>
          <button />
RAW_BUFFERClick to expand / collapse

Description

On the Hermes Desktop app, right-clicking a profile square and selecting "Color…" from the context menu causes the color picker to briefly flicker and close immediately. The color swatches never remain visible, making the feature unusable.

Same behavior occurs with the long-press gesture (hold the profile square) — the picker flashes and disappears.

Root Cause

The ProfileSquare component nests Radix UI's Popover and ContextMenu primitives as siblings sharing the same trigger element through asChild prop chains:

<Popover onOpenChange={setPickerOpen} open={pickerOpen}>
  <ContextMenu>
    <PopoverAnchor asChild>
      <ContextMenuTrigger asChild>
        <TooltipTrigger asChild>
          <button />

When the ContextMenu closes (after selecting an item), Radix triggers onOpenChange(false) on the Popover, which overrides the programmatic setPickerOpen(true) called from the ContextMenu item handler. The Popover opens and immediately closes in the same frame.

Fix

PR #[TBD] decouples the two primitives entirely. The ContextMenu handles right-click independently. The color picker is rendered via createPortal as an independent floating panel with a backdrop overlay, positioned at the button's coordinates. No shared Radix state to conflict.

Environment

  • Hermes Desktop (any build with the profile rail, ~v0.15.1+)
  • macOS (likely all platforms)

Related

  • The profile color feature was introduced in recent commits (profile-rail, profile-switcher)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING