Skip to content

Comments

Fix account tabs overflow with wrapping pill-style tabs#225

Merged
patcapulong merged 5 commits intomainfrom
fix/account-tabs-scroll
Feb 24, 2026
Merged

Fix account tabs overflow with wrapping pill-style tabs#225
patcapulong merged 5 commits intomainfrom
fix/account-tabs-scroll

Conversation

@patcapulong
Copy link
Contributor

@patcapulong patcapulong commented Feb 24, 2026

Summary

  • Replace horizontal scroll behavior on API reference tab lists (oneOf schema variants) with flex-wrap pill-style buttons that handle 20+ account types gracefully across viewports
  • Remove dead scroll-fade.js (117-line drag-to-scroll + fade gradient script) and its <script> tag from docs.json that was loading on every page for zero benefit

Test plan

  • Verify API reference pages with many tabs (e.g. External Accounts) wrap correctly
  • Verify no console errors from missing scroll-fade.js
  • Check light and dark mode tab styling
  • Check mobile viewport wrapping behavior

🤖 Generated with Claude Code

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

Replaced horizontal scroll behavior with wrapping pill-style tabs for API reference pages, handling 20+ account type tabs gracefully across all viewports. Also removed dead code (scroll-fade.js and its script tag from docs.json).

Major changes:

  • Added CSS for flex-wrap pill-style tabs scoped to #api-playground-2-operation-page
  • Complete styling for inactive/hover/active states in both light and dark modes
  • Removed 117-line scroll-fade.js that was loading on every page
  • Updated CLAUDE.md to clarify that React hooks work in MDX (parser issues are from JS expressions, not hooks)

Confidence Score: 5/5

  • Safe to merge - well-scoped CSS changes with proper fallbacks and dead code removal
  • All CSS selectors are properly scoped to #api-playground-2-operation-page, all CSS variables used are already defined in the file, proper dark mode support included, and dead code removal is complete (both JS file and script tag)
  • No files require special attention

Important Files Changed

Filename Overview
mintlify/style.css Added wrapping pill-style tabs with complete hover/active states for light and dark modes
CLAUDE.md Corrected documentation about React hooks in MDX - they work, parser issues are from JS expressions

Last reviewed commit: fc0f0bb

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 63 to 70
el.addEventListener(
"click",
function (e) {
e.stopPropagation();
e.preventDefault();
},
{ once: true, capture: true }
);
Copy link
Contributor

Choose a reason for hiding this comment

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

click listener added synchronously in mouseup may miss the click event if the click fires before the listener is attached (browsers typically fire click after mouseup on the same tick). Consider adding the listener during mousedown instead and using a flag to determine whether to suppress it.

Suggested change
el.addEventListener(
"click",
function (e) {
e.stopPropagation();
e.preventDefault();
},
{ once: true, capture: true }
);
el.addEventListener("mousedown", function (e) {
if (e.button !== 0) return;
isDown = true;
hasDragged = false;
startX = e.pageX;
startScrollLeft = el.scrollLeft;
// Pre-register click suppression handler
var clickHandler = function (clickEvent) {
if (hasDragged) {
clickEvent.stopPropagation();
clickEvent.preventDefault();
}
};
el.addEventListener("click", clickHandler, { once: true, capture: true });
});
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/scroll-fade.js
Line: 63-70

Comment:
click listener added synchronously in `mouseup` may miss the click event if the click fires before the listener is attached (browsers typically fire click after mouseup on the same tick). Consider adding the listener during `mousedown` instead and using a flag to determine whether to suppress it.

```suggestion
    el.addEventListener("mousedown", function (e) {
      if (e.button !== 0) return;
      isDown = true;
      hasDragged = false;
      startX = e.pageX;
      startScrollLeft = el.scrollLeft;
      
      // Pre-register click suppression handler
      var clickHandler = function (clickEvent) {
        if (hasDragged) {
          clickEvent.stopPropagation();
          clickEvent.preventDefault();
        }
      };
      el.addEventListener("click", clickHandler, { once: true, capture: true });
    });
```

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

@@ -0,0 +1,116 @@
(function () {

Choose a reason for hiding this comment

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

whoa this seems super hacky, they don't have any way of natively scrolling already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops. i changed the approach. great point, thank you brian

@patcapulong patcapulong marked this pull request as draft February 24, 2026 18:04
@patcapulong patcapulong force-pushed the fix/account-tabs-scroll branch from 73dc4d4 to aa9a688 Compare February 24, 2026 18:09
@patcapulong patcapulong changed the title Add scroll affordance to horizontal tab lists Fix account tabs overflow with wrapping pill-style tabs Feb 24, 2026
patcapulong and others added 4 commits February 24, 2026 10:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Horizontal tab lists (e.g. account type tabs on API reference pages)
overflow but give no visual hint with scrollbars hidden. This adds
gradient fade masks on the edges that appear/disappear based on scroll
position, drag-to-scroll support for mouse users, and a grab cursor
to signal the interaction.

Co-authored-by: Cursor <cursoragent@cursor.com>
Switch from scroll affordance (fade gradients + drag-to-scroll) to
flex-wrap with pill-shaped tab buttons for oneOf schema variants.
Handles 20+ account types gracefully across viewports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The scroll-fade approach (drag-to-scroll + fade gradients) was superseded
by flex-wrap pill-style tabs. The JS file was dead code loading on every page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Scope pill-style tabs to API reference pages only
- Add general tab hover/active states for light and dark mode
- Bump hover backgrounds for visibility (5% black / 8% white)
- Active pill: white bg with 0.5px border at 10% alpha
- Add transparent border baseline to prevent layout shift
- Add 150ms ease transition on bg, border, and color
- Bump pill gap from 4px to 6px

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@patcapulong
Copy link
Contributor Author

@greptile rereview

@patcapulong patcapulong marked this pull request as ready for review February 24, 2026 20:26
@patcapulong patcapulong merged commit c848e22 into main Feb 24, 2026
8 checks passed
@patcapulong patcapulong deleted the fix/account-tabs-scroll branch February 24, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants