Skip to content

Handle alert words (pre-"watched phrases") #663

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

Open
gnprice opened this issue May 13, 2024 · 0 comments
Open

Handle alert words (pre-"watched phrases") #663

gnprice opened this issue May 13, 2024 · 0 comments
Labels
a-api Implementing specific parts of the Zulip server API a-content Parsing and rendering Zulip HTML content, notably message contents a-model Implementing our data model (PerAccountStore, etc.)

Comments

@gnprice
Copy link
Member

gnprice commented May 13, 2024

I.e., this Zulip feature:
https://zulip.com/help/dm-mention-alert-notifications#alert-words

The feature is in the midst of API changes that will also involve a rename. The old/existing API will still be present in Zulip Server 9, though, so we'll need to support it in any case. This issue is for supporting the existing API, which we can go ahead and merge as soon as the implementation is ready; supporting the new/future API will be a separate followup issue.

There are two parts to implementing this:

  • Store and maintain the user's list of alert words. This means taking the data from the initial snapshot, adding it to PerAccountStore, and keeping it up to date with events.
  • Using the alert words in the UI, by highlighting them in messages.

For the second part, see the corresponding code in zulip-mobile, in src/webview/html/processAlertWords.js. Also see the current corresponding code in Zulip web — the zulip-mobile code was copied from there but there may have been changes since then.

We'll want to copy the web and zulip-mobile behavior as closely as possible from a user perspective. That code operates by munging the message's HTML, with regexes. We could probably accomplish something bug-compatible by munging the HTML in the same way, before parsing it… but since we're parsing the HTML anyway, let's do better than that:

  • We'll look for alert words only in the parts that truly are text, where treating a match as an alert word would be appropriate. This means the strings that are held by TextNode, CodeBlockSpanNode, and possibly others.
@gnprice gnprice added a-content Parsing and rendering Zulip HTML content, notably message contents a-api Implementing specific parts of the Zulip server API a-model Implementing our data model (PerAccountStore, etc.) labels May 13, 2024
@gnprice gnprice added this to the Beta 3: Summer 2024 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-api Implementing specific parts of the Zulip server API a-content Parsing and rendering Zulip HTML content, notably message contents a-model Implementing our data model (PerAccountStore, etc.)
Projects
Status: No status
Development

No branches or pull requests

1 participant