diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f53a1..afa27d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and ### Added +- Debug-level tracing of AstrBot SSE frame shapes: frame type, which identity fields are present, and the key names inside `data`. No payload text is recorded. Enable with `RUST_LOG`. - Q10-Q15 chat experience increment: lightweight Markdown rendering, message actions, generation controls, session actions, connection controls, and responsive chat layout. - AstrBot OpenAPI adapter foundation: SSE mapper, dual-slot runtime skeleton, credential enrollment IPC, transport-aware profiles (ADR-0005). - Authoritative architecture, implementation, and repository workflow documents. @@ -40,6 +41,13 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and ### Fixed +- Message action buttons render as borderless icons again. Their labels were being laid out inside + a 32px button, which wrapped them into vertical strips of single characters. +- The avatar sits beside its message bubble again instead of below it. +- Message actions can now be reached with the keyboard. They were hidden with `visibility`, which + removed them from the tab order, so the focus rule that reveals them could never fire. +- A failure to open the desktop pet's context menu is now reported instead of silently doing + nothing. - One unreachable connection no longer freezes the whole application. The reachability probe now runs outside the runtime lock, so a slot that is connecting cannot block status, sending, cancelling or disconnecting on the other slot, and the attempt itself can be interrupted. diff --git a/docs/progress.md b/docs/progress.md index d4f0c44..37b138a 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -606,3 +606,47 @@ Real-hardware acceptance for R3 has not been performed; the steps are listed in Next: batch R4 (data and credential boundaries) or R5 (protocol hardening). Neither depends on R3, so they can be dispatched in parallel. + +## 2026-07-27: batch R3.5, first real-machine feedback + +First real use of the application surfaced five defects, none of them in the 2026-07-26 audit. +Three had provable root causes and are fixed; two depend on what the server actually sends and are +deliberately left open rather than guessed at. Full detail in `docs/reports/fix-queue-2026-07-26.md` +under "R3.5". + +### Fixed + +- Message action buttons rendered their labels inside a 32px box, wrapping them into vertical + strips. `styles.css` already contained `.message-action-label`, a screen-reader-only class written + for exactly this, that no component ever used. The buttons were also defined five times across the + stylesheet, three of those as bordered pills. +- The avatar rendered below its bubble because the row aligned to `flex-end` while the content + column is taller than the bubble by the reserved action bar. +- Removing `visibility: hidden` from the hidden action bar closes **F-40** (audit P2-24) early: it + had removed the buttons from the tab order, so the focus rule that reveals them could never fire. +- The pet's context-menu handler was a bare `void invoke(...)` with no catch, so a failure was + indistinguishable from the native menu winning. The error is now visible; the root cause is not + yet established. + +Verified against the real stylesheet in a browser rather than by inspection: avatar and bubble tops +differ by 0px, the button computes to 34x34 with a 0px border, the label box measures 1x1, and +focusing a button takes the bar from opacity 0 to 1. + +### Open, pending a frame capture + +A reply sometimes renders as two bubbles during generation, and images sent by plugins never +appear. Each has two plausible root causes in our own code, and choosing wrong would produce a fix +that appears to work until a different conversation path hits the other cause. Added +`trace_frame_shape` to record the structure of every SSE frame — type, presence of `message_id` and +`session_id`, and the key names inside `data`, with no payload text — behind +`RUST_LOG=astrbot_desktop=debug`. + +Note that the two bubbles collapsing to one at the end is not self-healing: `activeMessages` filters +by session id and merely hides the orphan, which remains in React state and in SQLite. + +### Test status + +Rust 107 passed / 2 ignored. Frontend 24 passed / 5 files. Playwright 5 passed. Build passes. + +Next: capture the frames, then batch R3.6 (message identity, pulling F-34 forward) and R3.7 +(attachment chain, pulling F-33 forward). diff --git a/docs/reports/fix-queue-2026-07-26.md b/docs/reports/fix-queue-2026-07-26.md index 9027525..6a470c6 100644 --- a/docs/reports/fix-queue-2026-07-26.md +++ b/docs/reports/fix-queue-2026-07-26.md @@ -214,6 +214,36 @@ * * * +## R3.5 · 真机反馈批(2026-07-27 追加) + +2026-07-27 首次真机使用暴露 5 个问题,编号 `N-*`(新发现,不在 2026-07-26 审计中)。 +其中 3 项根因确凿并已修复;2 项的根因取决于服务端实际发的帧,**不猜**,待抓帧后再定。 + +### 已完成 + +| ID | 位置 | 根因 | 状态 | +| --- | --- | --- | --- | +| **N-1** | `styles.css:2183/2456/2655/2735/3134`;`ChatPanel.tsx:822,834,846` | `.message-action-label`(`clip-rect` 屏幕阅读器类)**定义了却从未被任何组件使用**,组件用的是裸 ``;同时按钮被 5 处重复定义中的 3 处当作胶囊按钮,与最终块冲突。文字塞进 2rem 方框后竖排折行 | 已修 | +| **N-2** | `styles.css:509` + `:3106` | `.chat-message-row{align-items:flex-end}` 把头像对齐到 `.chat-message-content` 底边,而该盒子因操作条占位比气泡高一行 → 头像掉到气泡下方 | 已修 | +| **F-40** | `styles.css:3113` | 顺带关闭:`visibility:hidden` 把按钮移出 tab 序,`:focus-within` 永远无法触发。改为仅 `opacity` | 已修(原属 R6) | +| **N-3** | `DesktopPetView.tsx:222-225` | 右键处理是裸 `void invoke(...)`,**无 `.catch`**,Rust 侧任何失败都不可见,与「原生菜单赢了」无法区分 | 已让错误可见;根因待定 | + +**验证**:在真实样式表下用浏览器实测——头像与气泡顶部差 0px,按钮 34×34 / `border-width: 0px`, +标签盒 1×1(已裁剪),聚焦后操作条 opacity 由 0 变 1。 + +### 待抓帧定论 + +已加 `trace_frame_shape()`(`astrbot_client.rs`,`RUST_LOG=astrbot_desktop=debug` 开启,只记结构不记内容)。 + +| ID | 问题 | 候选根因 | 判据 | +| --- | --- | --- | --- | +| **N-4** | 生成中概率出现两个回复气泡,结束后恢复成一个 | **候选 A = F-34(P2-13)**:`ChatPanel.tsx:976` 与 `commands.rs:412` 同用 `messageId \|\| eventId` 回退,`event_id` 每事件唯一,任一 delta 缺 `message_id` 即自成一条消息。**候选 B**:`ChatPanel.tsx:74-75` 的 `historySessionId` 回退到 `storedSessions[0]`,会加载**另一个会话**的历史并合并 | 日志中 `plain` 帧的 `has_message_id` 是否恒为 true | +| **N-5** | 「恢复成一个」不是自愈 | `activeMessages`(`ChatPanel.tsx:116`)按 sessionId 过滤,只是**遮住**孤儿气泡;React state 与 SQLite 中它仍在 | 需随 N-4 一并清理 | +| **N-6** | 插件发的图片不显示 | `map_media()`(`astrbot.rs:339`)只记 `pending_media` 不产出事件,必须等后续 `attachment_saved` 配对;**若插件的 image 帧自带 id/URL 且无该后续帧,图片被静默丢弃**。另:非图片媒体全丢(F-33)、`pending_media` 单槽位(F-33)、id 字符集限 `[A-Za-z0-9._-]` 挡掉 URL 形态 | 日志中 image 帧的 `data_keys`,以及其后是否出现 `attachment_saved` | +| **N-7** | 图片即便拿到也可能被 CSP 拦 | `tauri.conf.json:45` 的 `img-src 'self' asset: http://asset.localhost data: blob:` 不含任意 http 源 | 若插件走 URL,**倾向代理下载转 blob**,不放宽 `img-src`——放宽等于让渲染层直连任意外部主机 | + +* * * + ## R4 · 数据与凭据安全批 | ID | 来源 | 位置 | 动作 | 验证 |