Skip to content

Commit ddf5e8f

Browse files
committed
feat: Improved folders tab search suggestions and UI, b=no-bug, c=common, folders
1 parent 3bb8686 commit ddf5e8f

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

src/zen/common/styles/zen-panel-ui.css

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
55
*/
6-
panel[type='arrow'][animate='open'] {
6+
panel[type='arrow'] {
77
@media (-moz-platform: macos) and (-moz-panel-animations) {
88
-moz-window-transform: scale(0.3);
9-
animation: zen-jello-animation-macos 0.4s ease-out forwards;
10-
&[side='bottom'] {
11-
/* Animate from the bottom */
12-
-zen-window-transform-origin: 0 100%;
13-
}
14-
:root[zen-right-side='true'] & {
15-
/* Animate from the right */
16-
-zen-window-transform-origin: 100% 0;
179

10+
&[animate='open'] {
11+
animation: zen-jello-animation-macos 0.4s ease-out forwards;
1812
&[side='bottom'] {
19-
/* Animate from the bottom right */
20-
-zen-window-transform-origin: 100% 100%;
13+
/* Animate from the bottom */
14+
-zen-window-transform-origin: 0 100%;
15+
}
16+
:root[zen-right-side='true'] & {
17+
/* Animate from the right */
18+
-zen-window-transform-origin: 100% 0;
19+
20+
&[side='bottom'] {
21+
/* Animate from the bottom right */
22+
-zen-window-transform-origin: 100% 100%;
23+
}
2124
}
2225
}
2326
}

src/zen/folders/ZenFolders.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@
698698
items.forEach((item) => item.removeAttribute('selected'));
699699
const targetItem = items[index];
700700
targetItem.setAttribute('selected', 'true');
701-
targetItem.scrollIntoView({ block: 'nearest' });
701+
targetItem.scrollIntoView({ block: 'start', behavior: 'smooth' });
702702
} else if (event.key === 'Enter') {
703703
// Enter to select the currently highlighted item
704704
const highlightedItem = tabsList.querySelector('.folders-tabs-list-item[selected]');
@@ -801,6 +801,13 @@
801801
this.#popup.hidePopup();
802802
});
803803

804+
item.addEventListener('mouseenter', () => {
805+
for (const sibling of tabsList.children) {
806+
sibling.removeAttribute('selected');
807+
}
808+
item.setAttribute('selected', 'true');
809+
});
810+
804811
tabsList.appendChild(item);
805812
}
806813
}

src/zen/folders/zen-folders.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,10 @@ zen-folder {
360360
outline: none !important;
361361
}
362362

363-
#zen-folder-tabs-popup #zen-folder-tabs-list {
364-
padding: 4px;
363+
#zen-folder-tabs-list {
364+
padding: 0 4px;
365+
max-height: 248px;
366+
overflow-y: auto;
365367
}
366368

367369
#zen-folder-tabs-popup .zen-folder-tabs-list-search-icon {
@@ -424,8 +426,8 @@ zen-folder {
424426
direction: ltr;
425427
padding: 0 var(--tab-inline-padding);
426428
border-radius: 4px;
429+
margin: 2px 0;
427430

428-
&:hover,
429431
.folders-tabs-list-item[selected] & {
430432
background-color: color-mix(in srgb, currentColor, transparent 90%);
431433
}

0 commit comments

Comments
 (0)