Skip to content

Commit 2a4dd72

Browse files
dylanjeffersclaude
andauthored
fix(mobile): comment kebab menu desyncs after close (#14342)
## Summary The kebab handler on mobile comments toggled `isOpen` and `isVisible` together, but those two pieces of state intentionally serve different roles: - `isOpen` drives the open/close **animation** - `isVisible` controls whether the drawer is **mounted** (kept true during the close animation, set to false in `onClosed`) Because `onClose` and `onClosed` flip them on separate ticks, there is a brief window during the close animation where `isOpen=false` but `isVisible=true`. A tap on the kebab during that window inverts both via the toggle, leaving the drawer **unmounted while state thinks it's open**. The next tap then has to dig itself out of the broken state, so the kebab appears not to respond. The fix is to make `handlePress` explicitly **open** the menu. Closing is already fully owned by the drawer's `onClose` / `onClosed` callbacks (row tap, backdrop tap, or swipe-down). ## Test plan - [ ] Tap kebab on your own comment → drawer appears with Edit / Delete options - [ ] Tap kebab on another user's comment → drawer appears with Flag, Mute User, etc. - [ ] Tap a row → drawer closes; tap kebab again → drawer reopens on the first tap - [ ] Tap backdrop to dismiss; tap kebab → drawer reopens on the first tap - [ ] Tap kebab rapidly while drawer is animating closed → drawer always opens cleanly, never stuck 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 18a1aab commit 2a4dd72

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/mobile/src/components/comments/CommentOverflowMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,16 @@ export const CommentOverflowMenu = (props: CommentOverflowMenuProps) => {
238238
}, [deleteComment, id, parentCommentId, toast])
239239

240240
const handlePress = useCallback(() => {
241-
setIsOpen(!isOpen)
242-
setIsVisible(!isVisible)
241+
setIsOpen(true)
242+
setIsVisible(true)
243243

244244
trackEvent(
245245
make({
246246
eventName: Name.COMMENTS_OPEN_COMMENT_OVERFLOW_MENU,
247247
commentId: id
248248
})
249249
)
250-
}, [isOpen, isVisible, id])
250+
}, [id])
251251

252252
return (
253253
<>

0 commit comments

Comments
 (0)