Commit Graph

29 Commits

Author SHA1 Message Date
Aman Agrawal
548afc2f1a topic_summary: Add button to generate narrow summary.
This remains only enabled in the development environment.
2025-01-28 13:13:20 -08:00
Aman Agrawal
673281aae8 message_fetch: Extract function to modify narrow before server query. 2025-01-23 16:29:42 -08:00
Prakhar Pratyush
fd67e31163 web: Add parameters to API requests for empty topic name support.
This commit adds `allow_empty_name: true` to the following
endpoints to receive empty strings as topic name when such
topics are available:
* `GET /messages`
* `GET /messages/{message_id}`
* `GET /messages/{message_id}/history`

Also, it adds `empty_topic_name` client capability for spectators.

These changes are part of the broader effort to enable
support for empty string as a topic name.
2025-01-10 14:32:55 -08:00
Aman Agrawal
864a2a067e recent_view: Fetch significant message history per Load more click.
Increase required messages significantly before stopping the backfill
every time `Load more` is clicked.
2025-01-08 10:56:14 -08:00
Aman Agrawal
c2df278f6d recent_view: Fix Load more not working after fetching 50k messages.
We do another fetch for `recent_view_fetch_more_batch_size` after
reaching 50k limit each time `Load more` is pressed.
2025-01-07 09:46:58 -08:00
Aman Agrawal
c5feccaa34 message_list: Rename variable for caller clarity. 2025-01-02 17:27:02 -08:00
Aman Agrawal
525ae3aaff message_list: Fix message list missing messages.
Since we allow calling `add_messages` without checking fetch status,
it can lead to non-contiguous message history due to latest message
being added to a message list without previous messages being
fetched.

To fix it, we only allow adding new messages via message_fetch
which properly sets `anchor` to the last message in the list
before fetching and adding messages to the list.
2024-12-18 10:21:48 -08:00
Aman Agrawal
9e519f8c18 message_fetch: Fix incorrectly set fetch status.
We update the fetch status before reaching here, so it was
incorrect to return before adding messages to the message
list data since it is always cached.
2024-12-18 10:21:48 -08:00
Aman Agrawal
a95f419650 message_fetch: Improve check for if message list is cached.
Combined feed is no longer cached by default, so this is the
correct check for if the message list is cached or not.
2024-12-18 10:21:48 -08:00
Aman Agrawal
0af738269a stream_list: Ignore left sidebar scroll until initial fetch is complete.
Since the initial fetch has a lot of messages, it can add many topics
to the left sidebar which can move the selected topic out of the view.

Note that `has_scrolled` is triggered even for the scrolls not triggered
by user since it is not easy to differentiate between the two events.
So, it is okay to ignore it initially.
2024-12-12 18:40:19 -08:00
Anders Kaseorg
77f97762c6 eslint: Fix unicorn/explicit-length-check. (#32666)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 09:19:46 -08:00
Aman Agrawal
a6aef4f41b message_fetch: Check for empty narrow to show empty narrow banner. 2024-12-04 16:16:25 -08:00
Aman Agrawal
40eda337f9 message_fetch: Populate rendered message lists with all_messages_data.
This will help us provide more messages in the current narrow for the
user after a reload without any extra server queries.
2024-12-04 16:16:25 -08:00
Aman Agrawal
107559b1bb message_fetch: Fetch again if the view is not scrollable.
If the initial fetch for the narrow didn't return enough data for
the view to becomes scrollable, we should try to populate the narrow
with more messages.
2024-12-04 16:16:25 -08:00
Aman Agrawal
dc63415c9d message_fetch: Allow fetching more messages for combined feed.
Since `all_messages_data` is no longer the data for combined feed,
we need to treat combined feed like any other view and continue
fetching messages if required.
2024-12-04 16:16:25 -08:00
Aman Agrawal
5ee62e599b message_fetch: Extract function to standardize API parameters.
There some common checks we need to perform before requesting
messages from the server. We extract it to be used elsewhere.
2024-12-02 16:41:36 -08:00
Aman Agrawal
1954855b6a message_fetch: Remove no longer needed check for home filter.
`Filter.public_terms` will return the same result even if the
narrow is combined feed. Since we are no longer passing
empty narrow parameters for combined feed, this condition is
not required.
2024-12-02 16:41:36 -08:00
Aman Agrawal
09c9db7b18 message_fetch: Remove inaccurate comment.
This comment became inaccurate as we made combined feed to no longer
be a special view.
2024-12-02 16:41:36 -08:00
Aman Agrawal
3fef305557 message_fetch: Extract part of post message fetch process.
This will be useful to separately call when restoring msg list
from cached msg list data.
2024-12-02 16:41:36 -08:00
Anders Kaseorg
ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Lauryn Menard
93c172ee3f message-fetch: Add spectator term when building narrow parameter.
Again, since the spectator term is added to the narrow parameter
for all views, then we consolidate that logic when building the
initial narrow data.
2024-10-14 15:11:41 -07:00
Lauryn Menard
7289d43f74 message_fetch: Simplify building narrow data.
If page_params.narrow is defined, then it is added to the narrow
parameter (whether it is the home view or not), so here we
consolidate that logic.
2024-10-14 15:11:41 -07:00
Lauryn Menard
09bce62d98 messsage-fetch: Convert channel operator's operand to integer ID.
The operand for the canoncial "channel" operator can be an ID, but
it must be an integer and not a string, so we take care of that
directly in handle_operators_supporting_id_based_api.
2024-10-14 15:11:41 -07:00
Lauryn Menard
3405e95b6b message-fetch: Use canonical operator for ID based API updates.
Updates handle_operators_supporting_id_based_api to use the
canonical operator when updating the narrow parameter to use
object IDs.
2024-10-14 15:11:41 -07:00
Lauryn Menard
62c2f35995 message-fetch: Refactor handle_operators_supporting_id_based_api.
Instead of updating the object with all of the parameters for the
message fetch, we only update the narrow parameter.
2024-10-14 15:11:41 -07:00
evykassirer
b2e1c5aec4 message_fetch: Don't allow undefined narrow term operands. 2024-09-24 14:34:07 -07:00
evykassirer
deb5d90941 message_list: Convert module to typescript. 2024-09-19 15:31:16 -07:00
evykassirer
dba1af84e0 filter: Use stream id instead of stream name. 2024-09-18 13:08:14 -07:00
afeefuddin
f013eb1037 message_fetch: Convert module to TypeScript. 2024-08-23 13:34:13 -07:00