Fix v5 separate new tab position for tabs opened with new tab button#2008
Closed
Fix v5 separate new tab position for tabs opened with new tab button#2008
Conversation
…according to setting Fixes mbnuqw#1096
if setting value is related to active tab
use moveNewTabActivePin if new tab created natively and moveNewTabButtonActivePin if created from New Tab button
danielbodnar
pushed a commit
to bodnar-dev/sidebery
that referenced
this pull request
Oct 18, 2025
Supersedes mbnuqw#2008. Changes: Updated setting's name to clarify what New Tab button is meant (native or sidebery). Use the setting only when interacting with the Sidebery new tab button. Refactoring. (resolves mbnuqw#2008) (resolves mbnuqw#1096) Co-authored-by: capi1O <[email protected]>
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.
This adds a dedicated setting for new tab position when Sidebery New Tab (+) button is clicked as requested in issue #1096
How it works
New Tab button calls function
createTabInPanel. AFAIK this function is not called when native tab creation (for instance Ctrl+T) is used.createTabInPanelcallsgetIndexForNewTabandgetParentForNewTab(also latergetPanelForNewTabmight be called). For these functions I added the flagfromNewTabButtonin their object argument, so they have a way to determine how the tab was created (natively or from the New Tab button).By checking the flag they can choose the correct setting (
moveNewTabormoveNewTabButton) from which the logic of tab placement is based.Remarks
dict.setup-page.tsfor keysettings.move_new_tab_buttonsince I used Google Translate.moveNewTabButtonreuses the possible values for settingmoveNewTab(new tab position (general rule), that is['start', 'end', 'before', 'after', 'first_child', 'last_child', 'none']. If dedicated options are needed, please ask.In order to DRY I used functions that I namedlast commit 5d3fdf3 avoids this.getIndexForNewTabOtherCases,getParentForNewTabOtherCasesandgetPanelForNewTabOtherCasesbecause the logic is the same for settingsmoveNewTabandmoveNewTabButton. Let me know if I should name them otherwise but I could not think of something else.fromNewTabButtonis passed to the 3 functionsgetIndexForNewTab,getParentForNewTabandgetPanelForNewTabin the same way, that is in a an object.Last but not least I did not test all the configurations for the different settings of new tab position since I did not understand them all.I tested all of the 7 options and when needed with/without active tab being pinned, for bothmoveNewTabandmoveNewTabButton.