feat(tabs): relocate new tab button and implement overflow handling#153
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying markdown-viewer with
|
| 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 |
Deploying markdownviewer with
|
| 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 |
There was a problem hiding this comment.
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 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 on lines
+1889
to
+1893
| /* ======================================== | ||
| TAB OVERFLOW — Scroll Buttons & Fade Indicators | ||
| ======================================== */ | ||
|
|
||
| .tab-scroll-btn { |
Comment on lines
+1931
to
+1936
| content: ''; | ||
| position: sticky; | ||
| top: 0; | ||
| bottom: 0; | ||
| width: 0; | ||
| flex-shrink: 0; |
Comment on lines
+1215
to
+1223
| // ======================================== | ||
| // TAB OVERFLOW — Scroll Buttons, Wheel, Indicators | ||
| // ======================================== | ||
|
|
||
| var _tabOverflowInitialized = false; | ||
|
|
||
| function setupTabOverflow() { | ||
| if (_tabOverflowInitialized) return; | ||
| _tabOverflowInitialized = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances the tab bar system's usability and layout accessibility when working with multiple open documents.
Key Changes:
+ New Tabbutton from the end of the scrollable tab list to a fixed position next to theResetbutton on the right toolbar. This makes it globally accessible at all times without requiring users to scroll through open tabs.‹) and right (›) scroll arrow buttons flanking the tab list that dynamically appear when content overflows the viewport.@pointer: coarse).