feat(nav): open starred issue views in a new tab on modifier-click#117879
Conversation
db6ce43 to
0415a03
Compare
| // The browser fires a click after a drag's pointerup that would navigate the | ||
| // dragged link. react-router's navigation can't be cancelled from React's | ||
| // synthetic handlers here, so swallow that click natively in the capture phase. | ||
| function suppressNextClick() { |
There was a problem hiding this comment.
there was a consistent bug where dragging a starred view to a new location, then back, caused a reload. i tried a number of approaches here to prevent it and this was the only one that worked, but i couldn't figure out a way to make this less hacky
|
Codex AI comment: I think we can avoid the global click suppression by changing the structure slightly. The hack exists because the drag handle is nested inside a real Instead, we could render the link and drag handle as siblings inside the sortable
Rough shape: <Container as="li" ref={setNodeRef} ...>
<StyledReorderableLink to={to} ...>
<IconSlot>{icon}</IconSlot>
{children}
{trailingItems}
</StyledReorderableLink>
<GrabHandle />
</Container>That way a drag starts from a non-anchor element, so there is no anchor default navigation to suppress after pointerup. The global The tradeoff is a little more positioning/CSS around the handle and icon slot, but the event model becomes much cleaner: links navigate, handles drag. |
0415a03 to
f9f9f8f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f9f9f8f. Configure here.
| data-drag-icon | ||
| ref={setActivatorNodeRef} | ||
| style={{cursor: isDragging ? 'grabbing' : 'grab'}} | ||
| onClick={e => e.stopPropagation()} |
There was a problem hiding this comment.
Handle wrapper blocks icon clicks
Medium Severity
Moving GrabHandle outside the anchor leaves an absolutely positioned Flex over the project icon. Only the inner GrabHandleAnimation uses pointer-events: none; the wrapper still receives clicks, so taps on the icon no longer reach the Link and the starred view does not open.
Reviewed by Cursor Bugbot for commit f9f9f8f. Configure here.
| transform ${p => p.theme.motion.smooth.moderate}; | ||
| /* Center over the 18px project icon, which sits at the link's left padding. */ | ||
| left: calc(${p => p.theme.space.lg} + 9px); | ||
| transition: opacity ${p => p.theme.motion.smooth.moderate}; |
There was a problem hiding this comment.
Handle offset without positioning
Low Severity
GrabHandleAnimation sets left: calc(...) and transform: translate(-50%, -50%) to center over the project icon, but the styled div is not positioned (position: absolute with a vertical anchor). The left offset is ignored, so the drag activator may not sit on the icon the comment describes.
Reviewed by Cursor Bugbot for commit f9f9f8f. Configure here.
These reorderable nav items (the starred issue views) were fake div links navigated in JS, so cmd/ctrl/middle-click could not open them in a new tab the way real links do. Render them as anchor links instead. Because the items are also drag-to-reorder, the grab handle is rendered as a sibling of the link rather than a child of it, so a drag (which always starts on the handle) can never produce a click whose event path includes the anchor — and therefore never triggers navigation. Co-authored-by: Claude <noreply@anthropic.com>
f9f9f8f to
9e98be6
Compare
…117879) Support ctrl/cmd click to open a starred view in a new tab. Co-authored-by: Claude <noreply@anthropic.com>


Support ctrl/cmd click to open a starred view in a new tab.