Skip to content

Commit 9cf54e0

Browse files
committed
Fix animating to search by peer when collapsed sidebar Improve search
messages flickering
1 parent 8d662a2 commit 9cf54e0

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

src/components/appSearchSuper..ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ import {MyStarGift} from '../lib/appManagers/appGiftsManager';
109109
import wrapSticker from './wrappers/sticker';
110110
import {unwrap} from 'solid-js/store';
111111
import {AutonomousSavedDialogList} from './autonomousDialogList/savedDialogs';
112+
import SetTransition from './singleTransition';
113+
import liteMode from '../helpers/liteMode';
112114

113115
// const testScroll = false;
114116

@@ -1120,6 +1122,21 @@ export default class AppSearchSuper {
11201122
searchGroup = this.searchGroups.messages;
11211123
}
11221124

1125+
if(liteMode.isAvailable('animations')) {
1126+
searchGroup.container.classList.add('is-hidden');
1127+
1128+
setTimeout(() => SetTransition({
1129+
element: searchGroup.container,
1130+
className: 'is-visible',
1131+
forwards: true,
1132+
duration: 250,
1133+
onTransitionEnd: () => {
1134+
searchGroup.container.classList.remove('is-hidden');
1135+
searchGroup.container.classList.remove('is-visible');
1136+
}
1137+
}), 100); // doesn't properly animate without it, even useRafs don't really help
1138+
}
1139+
11231140
const options: ProcessSearchSuperResult = {
11241141
elemsToAppend,
11251142
inputFilter,

src/components/forumTab/forumTab.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import IS_TOUCH_SUPPORTED from '../../environment/touchSupport';
22
import {attachClickEvent} from '../../helpers/dom/clickEvent';
33
import handleTabSwipe from '../../helpers/dom/handleTabSwipe';
4+
import liteMode from '../../helpers/liteMode';
45
import safeAssign from '../../helpers/object/safeAssign';
6+
import pause from '../../helpers/schedulers/pause';
57
import appDialogsManager from '../../lib/appManagers/appDialogsManager';
68
import {AppManagers} from '../../lib/appManagers/managers';
79
import {logger} from '../../lib/logger';
@@ -99,8 +101,9 @@ export class ForumTab extends SliderSuperTabEventable {
99101
}
100102

101103
const searchButton = ButtonIcon('search');
102-
attachClickEvent(searchButton, () => {
104+
attachClickEvent(searchButton, async() => {
103105
appSidebarLeft.closeEverythingInside();
106+
if(liteMode.isAvailable('animations')) await pause(400);
104107
appSidebarLeft.initSearch().openWithPeerId(this.peerId);
105108
});
106109

src/scss/partials/_chatlist.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@
8888
margin-bottom: 0;
8989
}
9090

91+
&.is-hidden {
92+
opacity: 0;
93+
}
94+
95+
&.is-visible {
96+
&:not(.backwards) {
97+
opacity: 1;
98+
}
99+
100+
&.animating {
101+
transition: opacity var(--transition-standard-in);
102+
103+
&.backwards {
104+
transition: opacity var(--transition-standard-out);
105+
}
106+
}
107+
}
108+
91109
&__name {
92110
color: var(--secondary-text-color);
93111
padding: 0 23px;

0 commit comments

Comments
 (0)