Add per-rule "hide subtitle" option#128
Merged
Merged
Conversation
Contributor
Code Coverage
|
4744339 to
3d6243a
Compare
Adds a per-rule toggle that drops the notification subtitle before sending to the watch. For messaging notifications the useful "who said what" lives in the body, so the subtitle (e.g. a group chat's participant list) is just noise. A conversation/group title longer than MAX_TITLE_LENGTH is merged into the body by the parser, so blanking the subtitle field alone left the title in the body for group chats. ParsedNotification now carries the raw conversationTitle (parseSubtitleAndBody returns a Triple), and NotificationProcessor.removeConversationTitle strips that "title\n" prefix (or the whole body when body == title) when the option is enabled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EbihJgxUPzinTBi3WThhUv
3d6243a to
e6dd747
Compare
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm back with another one trying to make my NC2 experience even better!
What
Adds a per-rule Hide subtitle option (in a rule's Settings). When enabled, the notification subtitle is dropped before the notification is sent to the watch.
The motivating case is that sometimes the subtitle is long and unhelpful and clutters the notification.
How
RuleOption.hideSubtitle(hide_subtitle, defaultfalse), surfaced as aSwitchPreferencein the rule Settings screen.NotificationProcessorblanks the subtitle field.MAX_TITLE_LENGTHis merged by the parser into the body (prepended as"title\n…"), so blanking the subtitle field alone wouldn't hide it for group chats. To handle that,ParsedNotificationnow carries the rawconversationTitle(the parser'sparseSubtitleAndBodyreturns aTriple), andNotificationProcessor.removeConversationTitle()strips that"title\n"prefix (or the whole body when the body is just the title) when the option is on.Testing