Skip to content

Consolidate scroll buttons#112

Open
iamnoksio wants to merge 1 commit into
macnev2013:mainfrom
iamnoksio:ui/chevron-at-the-same-place
Open

Consolidate scroll buttons#112
iamnoksio wants to merge 1 commit into
macnev2013:mainfrom
iamnoksio:ui/chevron-at-the-same-place

Conversation

@iamnoksio

@iamnoksio iamnoksio commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR consolidates the two tab-scroll chevron buttons — previously one on each side of the tab strip — into a single grouped container placed on the left of the tab bar. It also reformats several multi-line expressions and function signatures for readability.

  • Both ChevronLeft and ChevronRight buttons are now rendered together in a flex wrapper on the left side of the tab bar, with the right-scroll button no longer occupying its own slot at the far right of the strip.
  • Code style improvements include expanding inline ternaries and one-liner try/catch blocks into multi-line form, and reformatting long import statements.

Confidence Score: 4/5

Safe to merge — changes are limited to button layout and code formatting with no logic mutations.

The functional logic for scrolling, overflow detection, and tab management is untouched. The only behavioral change is moving the right-scroll chevron from the far right of the tab strip to a consolidated group on the left. This removes the right-side visual affordance that signalled more tabs exist in that direction — a UX trade-off worth team discussion before merging. A stale comment also remains that describes the old two-slot layout.

Files Needing Attention: src/components/layout/UnifiedTabBar.tsx — specifically the consolidated button group and the now-inaccurate comment block around line 79.

Important Files Changed

Filename Overview
src/components/layout/UnifiedTabBar.tsx Both scroll-chevron buttons consolidated into a left-side group; remaining changes are code-style reformatting. One stale comment and a UX affordance question worth addressing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[UnifiedTabBar renders] --> B{overflow?}
    B -- No --> C[Tab strip fills full width\nNo scroll buttons shown]
    B -- Yes --> D["Render consolidated button group on LEFT side\nChevronLeft + ChevronRight"]
    D --> E{canLeft?}
    D --> F{canRight?}
    E -- No --> G[Left button disabled]
    E -- Yes --> H[Left button enabled]
    F -- No --> I[Right button disabled]
    F -- Yes --> J[Right button enabled]
    D --> K[Tab strip fills remaining right-side width]
    H --> L["scrollTabs scroll left"]
    J --> M["scrollTabs scroll right"]
Loading

Comments Outside Diff (1)

  1. src/components/layout/UnifiedTabBar.tsx, line 79-82 (link)

    P2 Stale comment after consolidation

    The comment still says "Both slots render whenever there's overflow", but the new layout has a single consolidated group rather than two separate slots. The comment should be updated to describe the new structure, e.g. noting that both buttons are grouped together on the left and individually disabled when their respective edge is reached.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/components/layout/UnifiedTabBar.tsx
    Line: 79-82
    
    Comment:
    **Stale comment after consolidation**
    
    The comment still says *"Both slots render whenever there's overflow"*, but the new layout has a single consolidated group rather than two separate slots. The comment should be updated to describe the new structure, e.g. noting that both buttons are grouped together on the left and individually disabled when their respective edge is reached.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Claude Code

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
src/components/layout/UnifiedTabBar.tsx:79-82
**Stale comment after consolidation**

The comment still says *"Both slots render whenever there's overflow"*, but the new layout has a single consolidated group rather than two separate slots. The comment should be updated to describe the new structure, e.g. noting that both buttons are grouped together on the left and individually disabled when their respective edge is reached.

### Issue 2 of 2
src/components/layout/UnifiedTabBar.tsx:174-195
**Right-scroll affordance removed from right side**

Placing both chevrons on the left removes the visual cue on the right side of the tab strip that additional tabs exist in that direction. With the previous layout, a visible (or disabled) right-arrow at the far right was the natural signal that there was more content. Users who scroll to the far right may not realise there's a `ChevronRight` button available, since it is now hidden behind the visible tabs on the left. Consider whether the consolidated placement still communicates intent sufficiently — adding a right-side fade/gradient mask is one common alternative used by browser UIs.

Reviews (1): Last reviewed commit: "Consolidate scroll buttons" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Comment on lines 174 to 195
{overflow && (
<button
type="button"
onClick={() => scrollTabs(-1)}
disabled={!canLeft}
aria-label="Scroll tabs left"
className={`${CHEVRON_BTN} mr-1`}
>
<ChevronLeft size={16} strokeWidth={2} aria-hidden="true" />
</button>
<div className="flex items-center gap-0.5 mr-1 shrink-0">
<button
type="button"
onClick={() => scrollTabs(-1)}
disabled={!canLeft}
aria-label="Scroll tabs left"
className={CHEVRON_BTN}
>
<ChevronLeft size={16} strokeWidth={2} aria-hidden="true" />
</button>
<button
type="button"
onClick={() => scrollTabs(1)}
disabled={!canRight}
aria-label="Scroll tabs right"
className={CHEVRON_BTN}
>
<ChevronRight size={16} strokeWidth={2} aria-hidden="true" />
</button>
</div>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Right-scroll affordance removed from right side

Placing both chevrons on the left removes the visual cue on the right side of the tab strip that additional tabs exist in that direction. With the previous layout, a visible (or disabled) right-arrow at the far right was the natural signal that there was more content. Users who scroll to the far right may not realise there's a ChevronRight button available, since it is now hidden behind the visible tabs on the left. Consider whether the consolidated placement still communicates intent sufficiently — adding a right-side fade/gradient mask is one common alternative used by browser UIs.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/layout/UnifiedTabBar.tsx
Line: 174-195

Comment:
**Right-scroll affordance removed from right side**

Placing both chevrons on the left removes the visual cue on the right side of the tab strip that additional tabs exist in that direction. With the previous layout, a visible (or disabled) right-arrow at the far right was the natural signal that there was more content. Users who scroll to the far right may not realise there's a `ChevronRight` button available, since it is now hidden behind the visible tabs on the left. Consider whether the consolidated placement still communicates intent sufficiently — adding a right-side fade/gradient mask is one common alternative used by browser UIs.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

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