Fix keyboard search when left pane is narrow
This PR fixes Cmd+f/Ctrl+f functionality in the left pane. Using a keyboard to search across all conversations should now automatically change the left pane width to accommodate the search input component. Resolves: #6281
This commit is contained in:
parent
3d735acdec
commit
0100866d0a
7 changed files with 99 additions and 23 deletions
|
@ -14,6 +14,8 @@ import type { MessageSearchResultType } from '../../../state/ducks/search';
|
|||
import { getEmptyState as getEmptySearchState } from '../../../state/ducks/search';
|
||||
import { getEmptyState as getEmptyUserState } from '../../../state/ducks/user';
|
||||
import {
|
||||
getIsSearching,
|
||||
getIsSearchingGlobally,
|
||||
getIsSearchingInAConversation,
|
||||
getMessageSearchResultSelector,
|
||||
getSearchResults,
|
||||
|
@ -93,6 +95,61 @@ describe('both/state/selectors/search', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('#getIsSearchingGlobally', () => {
|
||||
it('returns false if not searching', () => {
|
||||
const state = getEmptyRootState();
|
||||
|
||||
assert.isFalse(getIsSearchingGlobally(state));
|
||||
});
|
||||
|
||||
it('returns true if searching globally', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
search: {
|
||||
...getEmptySearchState(),
|
||||
globalSearch: true,
|
||||
},
|
||||
};
|
||||
|
||||
assert.isTrue(getIsSearchingGlobally(state));
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getIsSearching', () => {
|
||||
it('returns false if not searching in any manner', () => {
|
||||
const state = getEmptyRootState();
|
||||
|
||||
assert.isFalse(getIsSearching(state));
|
||||
});
|
||||
|
||||
it('returns true if searching in a conversation', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
search: {
|
||||
...getEmptySearchState(),
|
||||
searchConversationId: 'abc123',
|
||||
searchConversationName: 'Test Conversation',
|
||||
globalSearch: false,
|
||||
},
|
||||
};
|
||||
|
||||
assert.isTrue(getIsSearching(state));
|
||||
});
|
||||
|
||||
it('returns true if searching globally', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
search: {
|
||||
...getEmptySearchState(),
|
||||
searchConversationId: undefined,
|
||||
globalSearch: true,
|
||||
},
|
||||
};
|
||||
|
||||
assert.isTrue(getIsSearchingGlobally(state));
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getMessageSearchResultSelector', () => {
|
||||
it('returns undefined if message not found in lookup', () => {
|
||||
const state = getEmptyRootState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue