Skip to content

feat(tabs): relocate new tab button and implement overflow handling#153

Merged
ThisIs-Developer merged 2 commits into
mainfrom
feature/global-new-tab-and-overflow
Jun 3, 2026
Merged

feat(tabs): relocate new tab button and implement overflow handling#153
ThisIs-Developer merged 2 commits into
mainfrom
feature/global-new-tab-and-overflow

Conversation

@ThisIs-Developer
Copy link
Copy Markdown
Owner

Description

This PR enhances the tab bar system's usability and layout accessibility when working with multiple open documents.

Key Changes:

  1. Relocated New Tab Action: Moved the + New Tab button from the end of the scrollable tab list to a fixed position next to the Reset button on the right toolbar. This makes it globally accessible at all times without requiring users to scroll through open tabs.
  2. Tab Overflow Controls: Added left () and right () scroll arrow buttons flanking the tab list that dynamically appear when content overflows the viewport.
  3. Mouse Wheel Integration: Added a scroll wheel listener on the tab bar to translate vertical scrolling into horizontal scrolling.
  4. Visual Polish: Added subtle box-shadow fade indicators at clipped edges and ensured the new tab button aligns vertically centered in the tab bar. Centered buttons automatically scale for touch-optimized displays (@pointer: coarse).

Copilot AI review requested due to automatic review settings June 3, 2026 07:06
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment Jun 3, 2026 7:09am

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 3, 2026

Deploying markdown-viewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: e379725
Status: ✅  Deploy successful!
Preview URL: https://fd37952c.markdown-viewer.pages.dev
Branch Preview URL: https://feature-global-new-tab-and-o.markdown-viewer.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: e379725
Status: ✅  Deploy successful!
Preview URL: https://16909588.markdownviewer.pages.dev
Branch Preview URL: https://feature-global-new-tab-and-o.markdownviewer.pages.dev

View logs

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the tab bar UX when many documents are open by making the “New Tab” action always accessible and adding overflow navigation/indicators for horizontally scrolling tabs.

Changes:

  • Moves “New Tab” from being dynamically inserted into the scrollable tab list to a fixed button in the tab bar markup.
  • Implements tab overflow handling (left/right scroll buttons, wheel-to-horizontal scrolling, overflow state detection).
  • Adds styling for the new tab button, overflow buttons, and edge fade indicators (including coarse-pointer sizing).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

File Description
index.html Adds a fixed #tab-new-btn button next to Reset in the tab bar.
script.js Adds setupTabOverflow() and wires up the static new-tab button click handler.
styles.css Updates .tab-new-btn styling and introduces .tab-scroll-btn + overflow fade indicator styles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread index.html
Comment on lines 298 to +302
<div class="tab-bar" id="tab-bar">
<div class="tab-list" id="tab-list" role="tablist" aria-label="Document tabs"></div>
<button class="tab-new-btn" id="tab-new-btn" title="New Tab (Ctrl+T)" aria-label="Open new tab">
<i class="bi bi-plus-lg"></i> New Tab
</button>
Comment thread styles.css
Comment on lines +1889 to +1893
/* ========================================
TAB OVERFLOW — Scroll Buttons & Fade Indicators
======================================== */

.tab-scroll-btn {
Comment thread styles.css
Comment on lines +1931 to +1936
content: '';
position: sticky;
top: 0;
bottom: 0;
width: 0;
flex-shrink: 0;
Comment thread script.js
Comment on lines +1215 to +1223
// ========================================
// TAB OVERFLOW — Scroll Buttons, Wheel, Indicators
// ========================================

var _tabOverflowInitialized = false;

function setupTabOverflow() {
if (_tabOverflowInitialized) return;
_tabOverflowInitialized = true;
@ThisIs-Developer ThisIs-Developer merged commit 4a9cc6a into main Jun 3, 2026
6 checks passed
@ThisIs-Developer ThisIs-Developer deleted the feature/global-new-tab-and-overflow branch June 3, 2026 07:14
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.

2 participants