Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of narrows (views) with no messages #1506

Open
neiljp opened this issue May 29, 2024 · 1 comment
Open

Improve handling of narrows (views) with no messages #1506

neiljp opened this issue May 29, 2024 · 1 comment
Labels
area: event handling How events from the server are responded to area: UI General user interface update bug Something isn't working help wanted This issue should be clear enough to work on high priority should be done as soon as possible
Milestone

Comments

@neiljp
Copy link
Collaborator

neiljp commented May 29, 2024

Bug description

When selecting a new narrow (view) to show, via a hotkey, a button in either side panel, or using the message search (via /), the message focus changes to a message in the resulting view.

When the message list for that narrow/view is empty, ie. no messages are found, there is no visible message to gain focus, and the UI behaves strangely.

This can occur for many narrows/views, including:

This results in

It is possible to navigate out of this state by moving sideways and down (#580), or using one of the 'global' hotkeys such as w or q, P/#/f (though not a). However, these are workarounds.

This has been discussed variously in #zulip-terminal, and in at least the above linked issues, as well as early work on it in #278.

What did you expect to happen?

Certainly:

  • Empty the current message recipients content, or hide that section entirely (as per another issue)
  • Ensure the narrow title is properly updated (eg. starred, etc.)

In addition:

  1. Unlike the web app, we expect the focus to move somewhere after a new narrow is requested, so a placeholder in the message list may be the easiest short-term solution to use.

This was worked on historically in #278 as a fix for #259, where a 'fake message' was used as a placeholder. However, as demonstrated by the more complex logic we now support for searching/filtering the side panels, it should be reasonable to support a custom element for 'no results found' to be shown instead.

Even so, that solution would need to support various cases where messages 'arrive' in that empty narrow, and the placeholder is replaced by them.

  1. Alternatively, focus could be retained in the previous location, if the resulting narrow is found to be empty. This would be convenient for message searches, where an empty set of results might be reasonably expected by a user to leave the focus in the search box to adjust the search.

  2. Some combination of (1) and (2), since

  • a placeholder shows that the narrow is empty (no messages)
  • a placeholder can be focused, allowing easy movement horizontally across the app (left/right), such as from left panel to right panel.

Notes

  • I'm closing many of the linked issues, since they are essentially duplicates, ie. examples of the symptoms from the underlying problem.
  • This could unblock other features, such as Globally refocus after search #1049
@neiljp neiljp added bug Something isn't working help wanted This issue should be clear enough to work on area: UI General user interface update high priority should be done as soon as possible area: event handling How events from the server are responded to labels May 29, 2024
@neiljp neiljp added this to the Next Release milestone May 29, 2024
@Niloth-p
Copy link
Collaborator

Niloth-p commented Aug 5, 2024

Adding a few more related aspects.

  • Currently, it doesn't seem to be possible to open ZT with new bots (bots without any prior messages).
    Error message: IndexError: Can't set focus, ListBox is empty
    This must be because they have no messages and all their narrows are empty (A user would get a message from Welcome Bot and may be subscribed to some channels by default, a bot would not be).

  • I've noticed that the recipient bar shows "DONT HIDE" when ZT launches, for some users and bots (mostly just new accounts?), but not in every case.

Edit: The bot issue is filed as #895.

@Niloth-p Niloth-p mentioned this issue Aug 5, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: event handling How events from the server are responded to area: UI General user interface update bug Something isn't working help wanted This issue should be clear enough to work on high priority should be done as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants