Skip to content

fix: issue #482 (Ashigaru)#486

Draft
fatherlinux wants to merge 1 commit into
masterfrom
refactor/issue-482
Draft

fix: issue #482 (Ashigaru)#486
fatherlinux wants to merge 1 commit into
masterfrom
refactor/issue-482

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

Fixes #482.

Autonomous Ashigaru run — Claude Code (claude-sonnet-4-6, tier 1) in a sealed, unprivileged sandbox. Worked from an airlock-filtered brief. Draft, pending CI + human review. run_id: rotv-482-1781734890

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request simplifies the Sidebar component by removing the mobilePhotosVisible state and streamlining the conditional rendering of media elements. The review feedback identifies a usability issue where the POI navigation buttons are unresponsive to mouse clicks on mobile-width screens because the navigation logic is bound to onTouchEnd while onClick is a no-op. It is recommended to move the navigation logic directly into the onClick handler to ensure compatibility across all input devices.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +755 to 792
{isMobile && !isEditing && !permalinkInfo && onNavigate && poiNavigationList && poiNavigationList.length > 1 && media.length > 0 && (
<>
{isEditing && linearFeature?.id ? (
<ImageUploader
destinationId={linearFeature.id}
hasImage={!!linearFeature.has_primary_image}
pendingImage={pendingImage}
onPendingImageChange={setPendingImage}
updatedAt={linearFeature.updated_at}
disabled={saving}
isVirtualPoi={false}
user={user}
poiId={linearFeature.id}
onMediaUpdate={handleMediaUpdate}
/>
) : media.length > 0 ? (
<Mosaic media={media} allMedia={allMedia} poiId={linearFeature?.id} user={user} onMediaUpdate={handleMediaUpdate} />
) : user && linearFeature?.id && !mediaLoading ? (
<div className="sidebar-no-media">
<button
className="btn-add-first-media"
onClick={() => setUploadModalOpen(true)}
>
+ Add Photo/Video
</button>
</div>
) : null}

{isMobile && !isEditing && !permalinkInfo && onNavigate && poiNavigationList && poiNavigationList.length > 1 && media.length > 0 && (
<>
{currentIndex > 0 && (
<button
className="image-nav-btn image-nav-prev"
onTouchEnd={(e) => {
e.preventDefault();
e.stopPropagation();
debouncedNavigate('prev');
}}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
aria-label="Previous POI"
>
<span className="image-nav-chevron">‹</span>
</button>
)}
{currentIndex < poiNavigationList.length - 1 && (
<button
className="image-nav-btn image-nav-next"
onTouchEnd={(e) => {
e.preventDefault();
e.stopPropagation();
debouncedNavigate('next');
}}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
aria-label="Next POI"
>
<span className="image-nav-chevron">›</span>
</button>
)}
</>
{currentIndex > 0 && (
<button
className="image-nav-btn image-nav-prev"
onTouchEnd={(e) => {
e.preventDefault();
e.stopPropagation();
debouncedNavigate('prev');
}}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
aria-label="Previous POI"
>
<span className="image-nav-chevron">‹</span>
</button>
)}
{currentIndex < poiNavigationList.length - 1 && (
<button
className="image-nav-btn image-nav-next"
onTouchEnd={(e) => {
e.preventDefault();
e.stopPropagation();
debouncedNavigate('next');
}}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
aria-label="Next POI"
>
<span className="image-nav-chevron">›</span>
</button>
)}
</>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

On mobile-width screens (such as desktop browsers resized for testing, or mobile devices using pointing devices like a mouse or trackpad), these navigation buttons are completely unresponsive to clicks. This happens because pointing devices do not trigger onTouchEnd, and the onClick handler is a no-op that only prevents default behavior and propagation.

Since debouncedNavigate already implements a 300ms debounce mechanism to prevent rapid/double triggering, we can safely remove the onTouchEnd handler and perform the navigation directly inside the onClick handler. This simplifies the code and ensures pointing devices work correctly on mobile-width screens.

          {isMobile && !isEditing && !permalinkInfo && onNavigate && poiNavigationList && poiNavigationList.length > 1 && media.length > 0 && (
            <>
              {currentIndex > 0 && (
                <button
                  className="image-nav-btn image-nav-prev"
                  onClick={(e) => {
                    e.preventDefault();
                    e.stopPropagation();
                    debouncedNavigate('prev');
                  }}
                  aria-label="Previous POI"
                >
                  <span className="image-nav-chevron"></span>
                </button>
              )}
              {currentIndex < poiNavigationList.length - 1 && (
                <button
                  className="image-nav-btn image-nav-next"
                  onClick={(e) => {
                    e.preventDefault();
                    e.stopPropagation();
                    debouncedNavigate('next');
                  }}
                  aria-label="Next POI"
                >
                  <span className="image-nav-chevron"></span>
                </button>
              )}
            </>
          )}

Comment on lines +1078 to 1115
{isMobile && !isEditing && !permalinkInfo && onNavigate && poiNavigationList && poiNavigationList.length > 1 && media.length > 0 && (
<>
{currentIndex > 0 && (
<button
className="image-nav-btn image-nav-prev"
onTouchEnd={(e) => {
e.preventDefault();
e.stopPropagation();
debouncedNavigate('prev');
}}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
aria-label="Previous POI"
>
<span className="image-nav-chevron">‹</span>
</button>
)}
{currentIndex < poiNavigationList.length - 1 && (
<button
className="image-nav-btn image-nav-next"
onTouchEnd={(e) => {
e.preventDefault();
e.stopPropagation();
debouncedNavigate('next');
}}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
aria-label="Next POI"
>
<span className="image-nav-chevron">›</span>
</button>
)}
</>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

On mobile-width screens (such as desktop browsers resized for testing, or mobile devices using pointing devices like a mouse or trackpad), these navigation buttons are completely unresponsive to clicks. This happens because pointing devices do not trigger onTouchEnd, and the onClick handler is a no-op that only prevents default behavior and propagation.

Since debouncedNavigate already implements a 300ms debounce mechanism to prevent rapid/double triggering, we can safely remove the onTouchEnd handler and perform the navigation directly inside the onClick handler. This simplifies the code and ensures pointing devices work correctly on mobile-width screens.

        {isMobile && !isEditing && !permalinkInfo && onNavigate && poiNavigationList && poiNavigationList.length > 1 && media.length > 0 && (
          <>
            {currentIndex > 0 && (
              <button
                className="image-nav-btn image-nav-prev"
                onClick={(e) => {
                  e.preventDefault();
                  e.stopPropagation();
                  debouncedNavigate('prev');
                }}
                aria-label="Previous POI"
              >
                <span className="image-nav-chevron"></span>
              </button>
            )}
            {currentIndex < poiNavigationList.length - 1 && (
              <button
                className="image-nav-btn image-nav-next"
                onClick={(e) => {
                  e.preventDefault();
                  e.stopPropagation();
                  debouncedNavigate('next');
                }}
                aria-label="Next POI"
              >
                <span className="image-nav-chevron"></span>
              </button>
            )}
          </>
        )}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant