unbridled-41 opened a new pull request, #4267:
URL: https://github.com/apache/rocketmq-dashboard/pull/4267

   Fixes #4266.
   
   ## Source
   
   - 父项目(master 
经典版)消息详情弹窗展示存储位置:`frontend-new/src/components/MessageDetailViewDialog.jsx` 
L114-L116 —— `Queue ID`、`Queue Offset`(`git show origin/master:` 亲验)。
   - 成熟同类项目佐证(不构成维护者认可):kafka-ui 消息表固定展示 `Offset`、`Partition` 
列(provectus/kafka-ui 
`kafka-ui-react-app/src/components/Topics/Topic/Messages/MessagesTable.tsx` 
L71-L72);AKHQ 按 partition/offset 定位单条消息(tchiotludo/akhq 
`client/src/containers/Topic/Topic/TopicData/TopicData.jsx` L384-L391 
`_getSingleMessage(partition, offset)`)。
   - 仓库内先例:DLQ 详情抽屉已展示同源存储元数据(`web/src/pages/instance/dlq.tsx` 详情列 
`Queue`、`Offset`)。
   
   ## Current gap
   
   Studio 消息详情弹窗只渲染 Message ID/Topic/Tag/Key/大小/Born Host/Store 
Host/存储时间。存储位置字段后端已返回(`MessageRecordVO` 的 
`brokerName`/`queueId`/`queueOffset`,Apache provider `toRecordVO` 填充;主查询路径 
`queryByTopic` 逐消息传 `queue.getBrokerName()`),前端 TS 类型 
`MessageRecord`(web/src/api/message.ts L9-L11)也已声明这三个字段,但 UI 从不引用(grep 0 命中)。
   
   ## Project fit
   
   纯前端展示补齐:不加端点、不改接口、不加依赖;字段语义与 QueueBrowser(Broker/Queue)、DLQ 
抽屉(Queue/Offset)一致,标签沿用父项目命名(Broker / Queue ID / Queue Offset)。
   
   ## Scope
   
   - 仅消息详情弹窗(消息内容 Tab)的 Descriptions 新增三项;空值显示 `-`(与既有空值语义一致)。
   - 不包含:消息列表加列、properties 展示(开放 PR #3290 认领)、消息体截断/编码提示(无充分外部依据,另行评估)、DLQ 变更。
   
   ## Implementation
   
   `web/src/pages/instance/message.tsx`:在详情 Descriptions 的"存储时间"项后追加 
`Broker`、`Queue ID`、`Queue Offset` 三项,nullish 用 `??` 回退 `-`(falsy 的 
queueId=0/queueOffset=0 正常渲染)。
   
   ## Tests
   
   - 新增 2 
个行为测试(`web/src/pages/instance/__tests__/MessagePage.test.tsx`):完整字段展示(断言 
broker-a / 0 / 0,同时锁定 falsy 值渲染);未知位置显示 `-` 占位。
   - 红灯:修复前 `npx vitest run src/pages/instance/__tests__/MessagePage.test.tsx` 
→ `Tests 2 failed | 10 passed (12)`(两用例均因找不到 Broker/Queue ID/Queue Offset 行失败)。
   - 绿灯:修复后同命令 → `Tests 12 passed (12)`;提交后(lint-staged)复跑 12 passed。
   - 全量:`npx vitest run` → `983 tests, 2 failed | 981 passed`(982 文件中 AclPage 1 
+ ConsumerPage 1 失败,均为未触碰文件;pristine 基线 6c24d2ed 实测 981 
tests、脆弱失败集逐轮轮换。两失败文件隔离复跑 54/54 全过,证明负载脆弱)。
   - `npx tsc -b` 干净;`npx eslint`(两改动文件)0 问题;`npm run build` ✓(8.77s)。
   
   ## Compatibility & Risk
   
   - 无 API/schema 变更,云实例(Aliyun/Tencent)路径 queueId=0/brokerName=null 时显示 
`-`/`0`,与既有数据如实一致。
   - 风险极低:纯展示追加,不影响任何查询逻辑。
   
   ## Diff
   
   2 files, +59/−0(numstat:MessagePage.test.tsx +50/−0,message.tsx +9/−0)。head: 
e19cdc56。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to