-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Add config to support more than 12 essential tabs #8441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
blakegearin
wants to merge
9
commits into
zen-browser:dev
from
blakegearin:configurable-essentials-max
Closed
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cd9ba2e
feat: Add config to support more than 12 essential tabs
blakegearin 6a8c7f9
Merge branch 'dev' into configurable-essentials-max
blakegearin 144d55e
Add dynamic getter
blakegearin 4a38fd8
Add overflow handling
blakegearin 6a280bd
Merge branch 'dev' into configurable-essentials-max
mr-cheffy 3126321
Merge branch 'dev' into configurable-essentials-max
blakegearin 8df6c41
Merge branch 'dev' into configurable-essentials-max
blakegearin 3137447
Merge branch 'dev' into configurable-essentials-max
blakegearin 98a2fc6
Fix merge conflict
blakegearin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1253,19 +1253,31 @@ | |
|
||
#zen-essentials { | ||
z-index: 1; | ||
overflow: hidden; | ||
|
||
&:not([data-essentials-height="0"]) { | ||
max-height: var(--zen-essentials-height); | ||
} | ||
} | ||
|
||
/* Container for essential items (often pinned/favorite tabs) */ | ||
.zen-essentials-container { | ||
will-change: transform; | ||
|
||
padding-bottom: var(--zen-toolbox-padding); | ||
overflow: hidden; | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
gap: 4px; | ||
transition: | ||
max-height 0.3s ease-out, | ||
grid-template-columns 0.3s ease-out; | ||
opacity: 1; | ||
|
||
#zen-essentials:not([data-essentials-height="0"]) & { | ||
height: 100%; | ||
max-height: var(--zen-essentials-height); | ||
} | ||
|
||
grid-template-columns: repeat(auto-fit, minmax(max(23.7%, 48px), 1fr)); | ||
&[data-hack-type='1'] { | ||
grid-template-columns: repeat(auto-fit, minmax(max(30%, 48px), auto)); | ||
|
@@ -1303,6 +1315,48 @@ | |
&[cloned] { | ||
pointer-events: none; | ||
} | ||
|
||
&[overflowing] { | ||
--zen-scrollbar-overflow-background: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.08)); | ||
|
||
&::before { | ||
content: ''; | ||
position: sticky; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
width: 100%; | ||
height: 1px; | ||
opacity: 0; | ||
pointer-events: none; | ||
transition: opacity 0.1s; | ||
background-color: var(--zen-scrollbar-overflow-background); | ||
grid-column: 1 / -1; | ||
} | ||
|
||
&::after { | ||
content: ''; | ||
position: sticky; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
width: 100%; | ||
height: 1px; | ||
opacity: 0; | ||
pointer-events: none; | ||
transition: opacity 0.1s; | ||
background-color: var(--zen-scrollbar-overflow-background); | ||
grid-column: 1 / -1; | ||
} | ||
} | ||
|
||
&[overflowing]:not([scrolledtostart])::before { | ||
opacity: 1; | ||
} | ||
|
||
&[overflowing]:not([scrolledtoend])::after { | ||
opacity: 1; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nearly identical to |
||
} | ||
|
||
/* Style tabs within the Essentials container (and a related welcome sidebar) */ | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
zen.tabs.essentials.height
, let's try to keep PRs centralized on fixing a specific problemThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addresses the problem identified...
Did you have something else in mind for handling overflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just add a max height for the essentials container and make it overflowable with CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we encounter the same issue. There's no specific magic number for the height that makes sense for all users. It's highly dependent on the number of essentials, rows/width, and screen size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if make it overflow, it can have a "random" number specified until we put this
zen.tabs.essentials.height
back, no?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PauloDaniel1993 I'm not sure I understand your question.
By default
zen.tabs.essentials.height
is not active. Essentials are added normally, and the height and rows adjust based on the width chosen by the user. Once it's changed to something other than0
, you get either expansion or scrolling depending on how many essentials there are and the screen height (since the number isvh
units). There are screenshots in the description.Because of this behavior, I don't think it makes sense to pick an arbitrary number. This would cause the code change from being passive and opt-in to something that will visually change how the essentials look for many users.