Falco
(Falco)
11월 12, 2022, 5:44오후
1
오늘부터 Discourse Chat 알림에서 사용자가 알림 자체에 인라인으로 답글을 보낼 수 있습니다
이 기능의 UI는 OS마다 다르며, 네이티브 알림 시스템에 통합되기 때문입니다.
스마트워치 Android Wear OS
Android
Windows
모든 것이 순조롭게 진행되면, 이 기능에 대한 가능한 다음 단계는 다음과 같습니다:
27개의 좋아요
정말 훌륭한 추가 기능입니다. 처음에는 "와, 내 사용자 이름이 표시되는 동적 예시 이미지구나"라고 생각했는데, 알고 보니 그냥 내 사용자 이름의 스크린샷이라는 걸 깨닫고 너무 혼란스러웠어요.
이 채팅 기능이 얼마나 빠르게 성장하고 있는지 정말 좋습니다. 우리 커뮤니티에 이 기능을 추가할 적절한 시기가 오기를 기다려요. 디스코드를 정말 좋아하지만, 비즈니스 관점에서는 또 다른 플랫폼을 관리해야 하고, 사용자들이 여러 곳으로 분산되는 상황을 원하지 않거든요.
하나의 메시지나 여러 메시지를 선택해 해당 내용을 별도 주제로 분리할 수 있는 기능이 있다면 좋겠어요.
9개의 좋아요
iOS 지원은 언제 이루어질 예정인가요? 현재도 콘텐츠가 포함된 즉시 푸시 알림을 받으려면 제3자 앱을 사용해야 합니다.
2개의 좋아요
Falco
(Falco)
11월 12, 2022, 11:02오후
7
Pyx :
iOS 지원은 언제 이루어질까요?
잘 모르겠습니다. 그건 Apple 쪽에 달려 있습니다. 우리는 오픈 웹 표준에 맞춰 구현하며, 해당 스펙을 구현하는 모든 OS(Windows, Android, Chrome OS 등)에서 정상적으로 작동합니다. Apple이 2023년에 WebPush를 구현할 때(만약 그렇게 한다면) 제대로 구현하길 바랄 뿐, 우리가 할 수 있는 일은 그저 바라는 것뿐입니다.
15개의 좋아요
Falco
(Falco)
5월 11, 2026, 8:12오후
8
이 기능이 한동안 오류가 있었는데, 이제 더 견고한 방식으로 지원을 다시 추가했습니다.
main ← chat-push-quick-reply
merged 03:36PM - 29 Apr 26 UTC
**Previously**, the "Reply" action on chat web push notifications was silently b… roken — the service worker's chat URL regex stopped matching when chat routes moved to `/chat/c/:slug/:id`, and the chat-specific code lived in core with no thread support, URL encoding, or error handling.
**In this update**, generalize the core service worker into a plugin-extensible action registry, move chat reply handling into the chat plugin with proper thread/encoding/fallback support, and convert single-emoji replies into reactions on the source message (falling back to a regular message post on any failure).
## Architecture
Core (`app/views/static/service-worker.js.erb`) now exposes:
```js
self.registerNotificationActionHandler(action, handler);
```
Push payloads can carry `actions` (Web Notifications API format) and `action_data` (an arbitrary object surfaced to the handler at `event.notification.data.actionData`). The click handler dispatches by `event.action` name and falls back to the existing focus-or-open behavior when no handler matches or a handler throws.
`PushNotificationPusher` forwards `actions` / `action_data` when present.
The chat plugin owns its own service worker (`plugins/chat/assets/javascripts/service-worker.js`), registered via `register_service_worker`. It registers a `chat-reply` handler that:
1. Fetches a CSRF token.
2. If the reply is a single emoji grapheme (detected via `Intl.Segmenter`, with a `\p{Extended_Pictographic}` regex fallback), `PUT`s to `/chat/:channel_id/react/:message_id`.
3. Otherwise — or if the reaction request fails — `POST`s to `/chat/:channel_id` with proper `URLSearchParams` encoding and the source `thread_id` if present.
4. If everything fails, opens the channel so the user can retype.
`Chat::Notifier.push_notification_reply_action(chat_message, user)` builds the payload in the user's locale with `channel_id`, `message_id`, and optional `thread_id`.
`Chat::MessageReactor#react!` resolves raw Unicode via `Emoji.unicode_replacements[emoji] || emoji` before validation, so smartwatch quick-reply chips (which send raw Unicode like `👍🏽` or ZWJ sequences) just work. Existing shortcode callers are unaffected.
## Why this matters
Smartwatch notification UIs expose a single "reply" affordance with canned chips that include short text and emoji. The user can't choose between "send as message" and "react"; they tap a chip and a string comes through. Treating a single-grapheme pictographic reply as a reaction matches user intent on the watch UX without any new product surface.
## Test plan
- [ ] On a chat-enabled site, subscribe to web push notifications.
- [ ] Have another user post a message that mentions you, or a watched channel message.
- [ ] On the resulting OS notification, confirm a "Reply" action button appears.
- [ ] Type a text reply and submit — verify it posts as a message in the right channel/thread.
- [ ] Submit a single emoji (e.g. 👍 or 👍🏽 with skin tone) — verify it lands as a reaction on the source message instead of posting a message.
- [ ] Submit a ZWJ sequence (e.g. 👨👩👧) — verify it lands as a reaction (or falls back to message post if not in the emoji DB).
- [ ] Sign out / let session expire and submit a reply — verify the channel opens as a fallback rather than silently failing.
- [ ] Watch via Wear OS / watchOS quick-reply chips and confirm the same behavior end-to-end.
이제 단일 이모지로만 구성된 답글도 리액션으로 처리하며, 채팅 스레드 도 지원합니다.
5개의 좋아요
와! 정말 멋지네요! 토픽도 같은 방식으로 처리할 계획이 있나요?
1개의 좋아요
Falco
(Falco)
이 글을 에 분리
5월 16, 2026, 4:02오후
11