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
user_settings: Add settings to configure sending typing notifications and read receipts #19200
Conversation
static/js/settings.js
Outdated
send_stream_typing_notifications: $t({ | ||
defaultMessage: "Display whether I'm typing messages in streams to other users", | ||
}), | ||
send_private_typing_notifications: $t({ | ||
defaultMessage: "Display whether I'm typing private messages to recipients", | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worthwhile to rephrase these but I'm unsure what would be nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s easy to misparse “to” as “messages to” rather than “display to”. I propose
- Let subscribers see when I’m typing messages in streams
- Let recipients see when I’m typing private messages
- Let senders see when I’ve read private messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those sound good to me. Changed.
Let senders see when I’ve read private messages
Made this 'Let other users see when I've read messages' as we are allowing everyone who has access to the message to see read receipts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to drop the “private”? And I think we need to be more specific than “other users”—maybe “participants”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as we show read receipts in streams too. (#18935 is the PR for that, and there's some discussion at czo here)
Changed 'other users' to 'participants'. It is more specific but sounds a bit odd to me (probably it's just me. I think we can stick to it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one minor comment, otherwise LGTM.
61553e9
to
54f6814
Compare
@timabbott I think we can make the |
f691f0d
to
220b748
Compare
220b748
to
eac2c74
Compare
eac2c74
to
2e7930d
Compare
Rebased as the settings endpoints merge is done. Asked the above question at https://chat.zulip.org/#narrow/stream/101-design/topic/privacy.2Fsecurity.20settings/near/1234961 to allow more discussion. |
2e7930d
to
6501673
Compare
@timabbott This is ready for review. Could you have a look?
Did both. I think reducing the number of requests sent to the server would definitely help a bit. |
zerver/views/typing.py
Outdated
if not user_profile.send_stream_typing_notifications: | ||
return json_success( | ||
{ | ||
"msg": "Sharing stream typing notifications turned off. This request will be ignored." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to do it this way? The other option of raising an error might break things in other clients.
Also, this string might benefit a bit from rephrasing it to be more concise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you ask about this question in the "api design" stream?
I would probably prefer to raise an error if the client sent one of these notices in violation of the configuration; we should just make sure to check with client developers that doing so will not break anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to raise errors.
(for later reference: link to the discussion: https://chat.zulip.org/#narrow/stream/378-api-design/topic/typing.20notifications.20endpoint
zerver/openapi/zulip.yaml
Outdated
description: | | ||
Present if `update_display_settings` is present in `fetch_event_types`. | ||
|
||
Whether the user has chosen to send typing notifications in private messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should have API changelog entries, **Changes**
notes, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we should have "typing notifications" link to the /help/ docs for the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't seem to have a /help page for typing notifications. I think we only have API docs and developer docs (We'll probably have to tweak this once we merge stream typing notifications PR)
I guess we should add one soon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! we actually have /help page for typing notifications but it is hidden as a subsection in status-and-availability.
Linked "typing notifications" to those docs and rebased the PR to match to bump latest API_FEATURE_LEVEL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added links to that in all of the places we talk about them, for clarity.
I think this will be mergeable with the API documentation changes I suggested, some copy-editing, and doing something to hide the settings UI checkboxes where the feature itself isn't merged yet when not in a development environment. E.g. an |
845f77c
to
a99190a
Compare
Thanks for the review! Made the changes. Added an |
cefbd1d
to
4a82ce8
Compare
zerver/openapi/zulip.yaml
Outdated
send_private_typing_notifications: | ||
type: boolean | ||
description: | | ||
Present if `update_display_settings` is present in `fetch_event_types`. | ||
|
||
Whether the user has chosen to send [typing notifications](/help/status-and-availability#typing-notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be moved to user_settings
object above? Do we want to keep a copy here too with text like the following?
**Changes**: Deprecated in Zulip 5.0 (feature level 89). Clients
connecting to newer servers should declare the `user_settings_object`
client capability and access the `user_settings` object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, but I don't think it's necessary -- we already make clear in the top-level description that clients will need the user_settings_object
capability.
4a82ce8
to
ad3b185
Compare
This isn't necessary as `settings_checkbox.hbs` template used for presence enabled setting in `account_settings.hbs` takes care of checking/unchecking this checkbox.
From 430c5cb, we do not send events for settings added after introduction of `user_settings` event. This test wasn't considering that and started failing on adding new user_settings.
From 430c5cb, in `fetch_initial_state_data`, we only include legacy settings in the top level of `state` and the newer ones are stored in `state['user_settings']`. That should've had a corresponding change in apply_event(). Also, fixed a test related to this logic.
Note: These are not functional in enabling/disabling sending of typing notifications with this commit. Refactored the privacy settings update to keep the code less duplicated along with making the addition of new settings easier.
Changes the view code to skip sending typing events when these settings are disabled. Returns a json success response with a msg.
This will be useful to let users enable/disable sharing read receipts once we add that feature. Note: Added "I've" to IGNORED_PHRASES in tools/lib/capitalization.py to avoid capitalization errors for the label text of this setting.
ad3b185
to
58184c2
Compare
Merged, after a somewhat extended pass of:
I don't think I made any functional changes. Thanks for doing this! Now we just need to finish implementing the "Read receipts" and "stream typing notifications" features. For the typing notifications one, I'd really appreciate your doing a bit of a writeup on the strategy for how you managed the issues around potential for duplicated code, since that's the thing I've been stuck on in thinking about that PR. |
Currently added only typing notifications settings.
Will add a commit for read receipts soon.(added)Testing plan:
Verified through UI.
GIFs or screenshots:
image