Repository navigation
2457: pinned tabs in one line setting, scrollable pinned tabs in all display modes - #2469
Open
the-nelsonator wants to merge 2 commits into
Open
the-nelsonator wants to merge 2 commits into
the-nelsonator wants to merge 2 commits into
Conversation
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.
Closes #2457
Summary
Adds a
Keep pinned tabs on a single linesetting that, whenin panel - toporin panel - globalis selected forPinned tabs position, keeps the pinned tabs bar on one line instead of wrapping, with scroll support so every pin stays reachable regardless of sidebar width.Adds scrolling to left/right pinned tabs position instead of overflowing.
Adds an optional (
none, 1, 2, ... , 10, default 5) sub-setting ofShow titles of pinned tabscalledVisible rows before scrollingwhich controls how many pinned tabs with titles to show before overflowing and adds scrolling.Settings:
Keep pinned tabs on a single line:Disabled when pinned tabs position is right/left:
Disabled when
Show titles of pinned tabsis enabled:Visible rows before scrolling:Videos
Pinned tabs on top in scrollable single line:
top.mp4
Pinned tabs on top with show titles turned on now scrollable vertically:
titles.mp4
Scrolling with pinned tabs on left:
left.mp4
Scrolling with pinned tabs on right:
right.mp4
Changes
src/types/settings.ts/src/defaults/settings.tspinnedTabsSingleLine: boolean(defaultfalse)pinnedTabsListMaxRowsoption (1,2,3,4,5,6,8,10,'none', default5)src/services/settings.tspinnedTabsListCapped(panel/top position + titles on + a numeric row limit)pinnedTabsListMaxRows(coerced to a number,0when disabled)pinnedTabsBarVertical— single shared "is this bar's scroll axis vertical" flag, used by both the component and the scroll service so they can't drift out of syncsrc/sidebar/components/bar.pinned-tabs.vuedata-overflowattributerecalcOverflow()viaResizeObserver+ a watcher on pin countonWheelscrolls the bar while it overflows, else falls back to the existing tab-switch debounceronDragOveredge-autoscroll, edge size clamped to the bar's own dimensionsonMountedscrolls the active pin into viewsrc/styles/sidebar/bar.pinned-tabs.stylnowrap+ horizontal scroll for single-line modeleft/rightpositionsmax-heightrule for titled lists:calc(rows * (min-height + margin))mask-imageaffordance on whichever side overflowsflex-shrink: 0fixes on both single-line and capped rules (border-box sizing made them shrinkable flex children, coming out a few px short)src/styles/sidebar/tab.styl--tabs-min-height/--tabs-title-padding-vertfrom.Tabto#root, since titled pinned tabs need that var toosrc/services/tabs.fg.scroll.tsscrollToPinnedTab(), resolving the bar from the DOM (#tab<id>→.tab-wrapper→.PinnedTabsBar)scrollToTab()now delegates to it for pinned ids, fixing several call sites that silently no-op'd beforesrc/services/tabs.fg.handlers.ts!tab.pinnedguards (autoScrollToNewTab,scrollPanelAfterSwitchingTab)src/services/tabs.fg.edit-title.tsfocus()→focus({ preventScroll: true })so that scroll isn't cut offsrc/sidebar/sidebar.vuedata-pinned-tabs-single-line,data-pinned-tabs-list-capped--pinned-list-max-rowsto the existing:stylebindingsrc/page.setup/components/settings.tabs.vueToggleFieldfor single-lineSelectFieldfor the row cap, nested under "Show titles of pinned tabs"src/_locales/dict.setup-page.tstabsTreeLimitconvention)noneoption