Skip to content

Commit da9f101

Browse files
Hongzhi Wenclaude
andcommitted
fix(compact): 处理 Codex/CodeRabbit review 三处
- [P1] chatWindowPropsSchema 增补 onCompactMinimizeRequest:之前只加了 App.tsx 的 TS 类型,hosted path 走 parseChatWindowProps(zod)会 strip 掉它,真实 Electron 里毛绒球点击拿到 undefined。 - [P2] loadCompactSurfaceStoredWidth desktop 下限 COMPACT_SURFACE_MAX_WIDTH(430)→COMPACT_SURFACE_DESKTOP_MIN_WIDTH:之前改 metrics/clampForSide 漏了这个 loader,导致拖到 280~429 的存量宽度复原时被顶回 430。 - [P2] CSS .compact-export-history-anchor max-height 去掉 width*1.46、改 78vh,与 JS getCompactHistorySlotMaxHeight(只受屏高)对齐,避免窄宽+高屏时 hit region 被 anchor 裁出死区。 build + vitest 168 + python 44 全绿。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2cb390e commit da9f101

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

frontend/react-neko-chat/src/message-schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ export const chatWindowPropsSchema = z.object({
226226
.args(compactChatStateSchema)
227227
.returns(z.void())
228228
.optional(),
229+
onCompactMinimizeRequest: z.function()
230+
.args()
231+
.returns(z.void())
232+
.optional(),
229233
translateEnabled: z.boolean().optional(),
230234
translateButtonLabel: z.string().optional(),
231235
translateButtonAriaLabel: z.string().optional(),

frontend/react-neko-chat/src/styles.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,9 @@ body.electron-chat-window.subtitle-web-host .compact-chat-surface-shell {
23402340
--compact-export-preview-bubble-max-ratio: 90%;
23412341
--compact-export-preview-system-bubble-max-ratio: 95%;
23422342
width: var(--compact-export-history-inline-size);
2343-
max-height: min(calc(var(--compact-export-surface-width) * 1.46), 78vh);
2343+
/* 与 JS getCompactHistorySlotMaxHeight 对齐:高度上限只受屏幕(78vh)约束、不再挂对话条宽度,
2344+
否则窄宽+高屏时 JS 允许的 slot 高 > CSS anchor 高,hit region 会被裁出死区(Codex P2)。 */
2345+
max-height: 78vh;
23442346
transform: translateX(-50%);
23452347
z-index: 100001;
23462348
pointer-events: none;

static/app-react-chat-window.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@
620620
var maxWidth = getCompactSurfaceResizeMaxWidth();
621621
var minWidth = isMobileWidth()
622622
? getCompactSurfaceMobileWidthBounds().minWidth
623-
: COMPACT_SURFACE_MAX_WIDTH;
623+
: COMPACT_SURFACE_DESKTOP_MIN_WIDTH;
624624
return Math.round(Math.max(minWidth, Math.min(width, maxWidth)));
625625
} catch (_) {
626626
return null;

0 commit comments

Comments
 (0)