Fix keyboard search when left pane is narrow #6303
Merged
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.
First time contributor checklist:
Contributor checklist:
main
branchyarn ready
run passes successfully (more about tests here)Description
Fixes #6281
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.
I made an assumption that when a user searches globally, the behavior of the left pane should be similar to when a user searches within a single conversation.
To do so, I chose to create a new value in state called
globalSearch
. I'm not super happy with the name, but I don't have any better ideas. Another approach that seems to work and avoids adding a new value in state would be to assign any string tosearchConversationId
that doesn't match a real conversation, e.g.searchConversationId: 'global'
, but that seemed less clear than having a dedicated variable.keyboard.search.mov
Other thoughts/bugs related to search
Although these are out-of-scope for this PR, I noticed a few things while working on this issue that I wanted to capture. I'll break these out into new issues later, assuming none of the Signal maintainers have strong feelings against the proposals.
LeftPaneInboxHelper
SEARCH_CLEAR
is getting called twice in a row when the user stops searching. I think it's getting called in both theonBlur
and theonClear
handlers inLeftPaneSearchInput.tsx
(lines 101 and 118), but that should be validated.