zulip-terminal
zulip-terminal copied to clipboard
Panel Search Box UI Enhancements
This PR deals UI enhancements related to display and reattempting search. While reattempting search:
- The caption sets to empty string
- The previous edit_text does not get erased so that users can edit typos.
Display:
- Aligns the text inside search box with the rest of the panel
- Displays edit text on new line, which reads clearer and helps render long searches properly

The last commit fixes a bug caused by mouse clicking on search, but I'm not entirely sure about the solution.
@preetmishra @neiljp I have split the PR as discussed and also dropped the mouse-fix commit as I think it would automatically get resolved with the keypress refactor. This PR only contains the Panel Search UI improvement features. (3 commits)
The rest of the commits can be found at #1072.
Heads up @Rohitth007, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main
branch and resolve your pull request's merge conflicts accordingly.
@Rohitth007 I just merged the first two of these separately since they are a definite improvement :tada:
However, there's been little feedback or testing of the other change, which could possibly be more convincing accompanied by other changes - such as adding hotkey hints, using a horizontal bar of color to indicate results, and whether we want a search 'prompt' (the >
).
There is also scope for unifying some parts of the message search UI, at least in terms of how it is presented, after this change.
I'm marking this as a PR completion candidate, but this will likely need some rounds of iteration to generate a consistent design, or perhaps a proposal and discussion beforehand to eg. consider how hotkeys currently work and how to represent that.
The main hotkey hinting issue here is how once we enter a search state then users get no hints (at a minimum of) how to
- exit the search
- edit the search
So, dynamically showing the appropriate keys would be useful for that.
For the multi-line layout, my previous concern was re the search UI jumping; I'm not sure there's a way around that.
Re a 'prompt' (like the >
), at this point I'd be mostly concerned whether it looks like part of the search text. Styling that, or having a indent with a space or two, may be sufficient and clean.
Note that some of the original PR here has been merged already, but was discussed at #zulip-terminal>Panel search box UI.