 Your NameandClaude Opus 5
|
505a6d7d56
|
补齐第3-4章composer功能缺口:跨话题草稿/@提醒/表情面板/附件面板/名片/收藏发送/按住说话/语音未读红点
第3-4章复测确认这批原型图要求的功能之前完全没做(真实聊天引擎 messages-view.jsx/
send-message.jsx 从Ch1开始一直是最基础的版本:两个附件图标+文本框+发送/麦克风,
没有@、没有表情面板、没有7宫格附件面板、没有名片/收藏发送、语音是点一下进入录音模式
不是按住说话)。这次一次性把8项都接上,除了新功能外,过程中顺带发现并修了4个真bug。
**跨话题草稿**(im-api.js 新增 getTopicDraft/updateTopicDraft,messages-view.jsx)
话题切换时拉取 GET /topics/{topic}/draft(真实验证过P2P用原生话题名——对方user_id——
可以正常读写,接口内部自己会查Subs.Get校验,不需要额外归一化),输入框内容600ms防抖
PUT回去;真正发送成功后立即清空服务端草稿,不等下一次防抖。真实验证:输入文字→切走
再切回→草稿还在;刷新整个页面(新WS会话)→草稿依然从服务端正确恢复。
**@提醒**(send-message.jsx 新增 mention 相关状态和UI,messages-view.jsx 新增
mentionSearch/mentionedUsers/applyMentionResolution)
只在群聊开放,检测"光标前最近一个未闭合的@"触发面板,调 getGroupMembers(topic,
{mentionable:true, query}) 做实时搜索。协议层面:Tinode原生Drafty.parse本来就会把
纯文本里的"@word"自动识别成MN实体,但data.val存的是匹配到的原始文字,不是uid——
真正的uid只有用户从选择器里点选时才知道,记在 messages-view.jsx 的
this.mentionedUsers,发送前重新parse一遍把匹配上的占位符换成真uid。真实验证:选
"kcg051307"发送后直接查后端存储,MN实体的data.val确认是真实uid
"usrYVeV0yZs8tw",不是原始文字。
**表情面板**(send-message.jsx)
2个tab(😊表情/♡常用),常用表情本地localStorage维护。图片没有拍到第二个tab具体
内容,判断"常用"是这类两tab设计里最常见、也是本项目里唯一有本地存储依据能撑起来的
语义。真实验证:点表情正确插入文本框,用过的表情正确出现在"常用"tab。
**7宫格附件面板**(send-message.jsx,替换原来常驻的照片/文件两个图标)
照片/拍摄/语音通话/名片/文件/收藏/视频通话。语音通话、视频通话复用第8章已有的
handleStartAudioCall/handleStartVideoCall(从 tinode-web.jsx 新抽出 canStartCall()
方法,同时替换掉"..."菜单里原来的内联判断,避免同一个判断逻辑两处维护),仅P2P且
真实通话功能可用时才不置灰——真实验证过群聊里这两项正确显示为禁用状态。
**名片消息**(send-message.jsx openCardPicker/sendCard,复用原生TheCard/
Drafty.appendTheCard)
选好友生成名片,uid必须用TheCard.setTinodeID写进vCard的comm数组(不是随便塞进某个
字段——widgets/the-card-mini.jsx渲染时用TheCard.getFirstTinodeID读这个协议项来判断
"发消息"按钮指向谁)。真实验证:选中好友后发出的名片消息真实带"聊天"按钮,点击可用。
**收藏发送到当前会话**(send-message.jsx openFavPicker/sendFavorite,复用Ch7的
forwardFavorites接口)
真实联调中发现并修复一个新bug:这个接口和其它几个批量接口一样,HTTP层恒定200,
真实成败要看items[].status——原来的写法完全没检查这个字段,等于假装总是成功。已改成
检查失败项并报错。同时真实测试还发现该接口对P2P目标会返回200+items[0].status:
"failed", reason:"PERMISSION_DENIED"(哪怕是真实好友、这个会话本身发消息完全正常),
看起来是后端这个接口自己的写权限判断有问题,不是前端能修的,已记录。
**按住说话+上滑取消录音**(send-message.jsx新增手势处理,audio-recorder.jsx新增
holdMode展示态)
mousedown/touchstart直接挂载AudioRecorder(挂载即开始录音,复用原有机制不动),
移动超过80px判定为"松开取消",松手时通过ref直接调组件内部的handleDone/handleDelete。
过程中发现并修复3个真bug:① injectIntl包裹AudioRecorder默认不支持ref转发
("Function components cannot be given refs"警告,ref静默失效),加
{forwardRef:true}修好;② handleDelete从来没有像handleDone那样判空mediaRecorder,
录音还没真正开始(getUserMedia尚未resolve)就点删除会直接抛TypeError,这是原有代码
一直存在的问题,这次因为按住松手可能在录音刚开始的瞬间发生而被真实触发;③
cleanUp()同理没判空this.stream。补上判空后,"从未真正开始录音就结束"这个场景会
直接当作取消处理并正确调用onDeleted,不会再把UI卡在录音态出不来(真实验证:这个
环境的浏览器面板本身会拦截麦克风访问,用这个"getUserMedia永远拒绝"的真实场景反而
完整测出了正常/取消两条路径在录音真正开始前结束时都不再卡死或报错)。
**语音消息未读红点**(chat-message.jsx/audio-player.jsx/formatters.js)
纯客户端概念,原生Tinode的recv/read只到"消息本身有没有被看到",跟"这条语音有没有
真的被点开听过"是两回事。audio-player.jsx的播放按钮新增可选onPlay回调(不传不影响
现有调用方),formatters.js的AU分支透传给它,chat-message.jsx按话题维护一份
localStorage"已播放seq集合",对收到的(非自己发的)语音消息,没播放过就在气泡右上角
显示红点。真实验证:用原生SDK的_routeData往话题本地缓存注入一条真实结构的语音消息
(浏览器面板拦截麦克风,没有真实语音消息可用,用这个方式验证渲染/播放回调/持久化
三段逻辑),红点正确出现;直接触发播放回调后红点消失且localStorage正确写入对应seq。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
2026-09-04 21:59:09 +08:00 |
|
or-else
|
7bf3fa71d6
|
partially dependencies updated
|
2026-07-04 15:19:03 +03:00 |
|
or-else
|
dea781b423
|
adding TheCard preview
|
2026-01-17 12:55:45 +03:00 |
|
or-else
|
930f4f0656
|
TheCard handling in messages
|
2026-01-16 20:51:57 +03:00 |
|
or-else
|
56790262f3
|
rename drafty form response content type to text/x-drafy-fr
|
2025-08-10 10:30:47 +03:00 |
|
or-else
|
290571f305
|
transition to application/json+drafty as mime type for form responses
|
2025-08-07 15:39:43 +03:00 |
|
or-else
|
6c1c8cf336
|
removed incomplete video conferences
|
2025-02-14 21:40:44 +03:00 |
|
or-else
|
02e8bd2f74
|
merge devel
|
2025-02-08 19:50:34 +03:00 |
|
or-else
|
de32da49f3
|
make sure only safe schemes are clickable in URLs
|
2023-12-15 14:27:05 -08:00 |
|
or-else
|
a86d07f854
|
merge next
|
2023-06-10 12:14:59 -07:00 |
|
or-else
|
414129d968
|
comments corrected
|
2023-06-10 12:00:16 -07:00 |
|
aforge
|
0425bd4348
|
Video conferencing skeleton.
|
2023-05-03 22:50:51 -07:00 |
|
or-else
|
fc2ff79329
|
fix display of broken videos
|
2023-02-05 13:46:08 -08:00 |
|
or-else
|
768edd744d
|
fallback to fixed size when video has no size info
|
2023-01-02 13:18:26 -08:00 |
|
or-else
|
9fbc601870
|
fix preview of received videos
|
2022-12-30 10:20:13 -08:00 |
|
or-else
|
13036da36b
|
more cleanup of video attachments
|
2022-12-14 21:05:40 -08:00 |
|
or-else
|
5673d82b33
|
replies to video recordings work
|
2022-12-14 19:24:59 -08:00 |
|
or-else
|
8c3287941a
|
video works although may have bugs
|
2022-12-14 16:50:00 -08:00 |
|
or-else
|
4e42d96d66
|
fix video message previews
|
2022-12-14 14:27:33 -08:00 |
|
or-else
|
bccf0d3b6b
|
video uploading + preview in bubbles works
|
2022-12-13 17:37:04 -08:00 |
|
or-else
|
6360708255
|
working on display of images
|
2022-12-12 22:05:08 -08:00 |
|
or-else
|
24a87f3deb
|
videos work but with bugs
|
2022-12-12 18:37:59 -08:00 |
|
or-else
|
983de97d7f
|
removed StrictMode due to issues with double mounting of components
|
2022-11-20 16:20:53 -08:00 |
|
or-else
|
e287755f13
|
more idimatic VC formatting, better presentation of preview
|
2022-05-30 19:51:58 -07:00 |
|
or-else
|
eef880c448
|
consistent naming or properties
|
2022-05-30 15:19:52 -07:00 |
|
aforge
|
3c87341280
|
Move video call message state and duration to head.
'webrtc' header for state.
'webrtc-duration' header for duration.
Content is now Drafty.videoCall() / VC.
|
2022-05-29 15:29:13 +03:00 |
|
or-else
|
e121b1645f
|
putting it all together
|
2022-03-15 18:20:24 -07:00 |
|
or-else
|
589b46a8c2
|
audio messages are fully functional but buggy and ugly
|
2022-03-14 20:50:24 -07:00 |
|
or-else
|
025d4cfadb
|
adding audio playback
|
2022-03-12 18:41:10 -08:00 |
|
or-else
|
539a37e5ee
|
Unsupported is correctly displayed
|
2022-03-11 18:39:52 -08:00 |
|
or-else
|
e42a7ca6de
|
corrected display of unsupported drafty entities
|
2022-03-11 16:43:19 -08:00 |
|
or-else
|
e87a36421c
|
fix crash on image with no data
|
2022-01-12 17:27:39 -08:00 |
|
or-else
|
c2d95725e4
|
fix missing context
|
2021-12-21 11:04:18 -08:00 |
|
or-else
|
bd2def7882
|
formatting of forwarded messages previews
|
2021-12-20 12:27:02 -08:00 |
|
or-else
|
b201f019ef
|
reply formatting works correctly
|
2021-12-19 17:42:19 -08:00 |
|
or-else
|
9582a9f2cd
|
simplify a bit and remove debug logging
|
2021-12-19 10:59:08 -08:00 |
|
or-else
|
363104755e
|
completely remove quotes in previews
|
2021-12-19 10:51:16 -08:00 |
|
or-else
|
ab7160170d
|
refactoring split formatters - transformers
|
2021-12-19 10:05:16 -08:00 |
|
or-else
|
3feca32d13
|
strip mentioned name from the forwarded preview
|
2021-11-24 18:55:44 -08:00 |
|
aforge
|
4f1c9e161a
|
Merge branch 'next' into features
|
2021-09-28 11:25:18 +03:00 |
|
or-else
|
a223d910c1
|
make LazyImage promise cancellable (otheriwse errors in the log)
|
2021-09-27 15:56:11 -07:00 |
|
aforge
|
338e42dd2a
|
Merge branch 'next' into features
|
2021-09-27 11:21:14 +03:00 |
|
or-else
|
a1e3cfb577
|
shorten image annotation
|
2021-09-26 15:19:43 -07:00 |
|
aforge
|
b6abc76f3f
|
More code review suggestions.
|
2021-09-25 20:33:26 +03:00 |
|
aforge
|
fb3fae8c9b
|
Replace "Forwarded from" with an icon.
|
2021-09-23 20:07:21 +03:00 |
|
or-else
|
4175cffa4d
|
everything seems to work as expected
|
2021-09-18 15:02:27 -07:00 |
|
or-else
|
c2c3b743b3
|
refactoring formatters for lazy display of scaled image previews (WIP)
|
2021-09-17 22:10:41 -07:00 |
|
or-else
|
8de413c5b5
|
refactored blob helpers to use promises instead of callbacks
|
2021-09-17 12:38:35 -07:00 |
|
or-else
|
e72dc20192
|
everything works
|
2021-09-16 17:07:05 -07:00 |
|
or-else
|
f51ba69fa7
|
everything seems to work now
|
2021-09-15 17:57:34 -07:00 |
|