fix(mobile): merge-time fixes for the prompt composer (#444)

- styles.css: restate the composer overlay's own bottom gutter after the fold rules
  (the generic .paste-overlay longhand erased it: 0px flat, hinge strip replacing it
  folded) and subtract the fold strip from the dialog's max-height
- test/foldable-layout.test.ts: simulate the cascade for
  .paste-overlay.prompt-composer-overlay (fails without the CSS fix); pin the palette
  anchor by name instead of ELEMENTS.at(-1)
- keyboard-accessory.js: guard the app global in refreshForActiveSession() like the
  rest of the file
- keyboard-accessory.js: a whitespace-only draft is empty (Send no longer submits
  blank lines); the text still goes out untrimmed
- keyboard-accessory.js: derive _composerMaxLength and the frame refusal from one
  64 KiB frame limit minus both bracketed-paste markers so they cannot drift
- keyboard-accessory.js: translate the textarea placeholder and label at build time,
  since the DOM translator skips <textarea> subtrees
- i18n.js: zh-CN entries for the composer dialog copy
- docs/wiki/Mobile-Guide.md: describe the Compose key instead of a clipboard key
- CLAUDE.md: a "Mobile prompt composer" paragraph after the accessory bar one
- test/mobile-prompt-composer.test.ts: pin the whitespace rule and the derived budget

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit f6725ba52da17b0bdbee8be3b5011e7cae514f69)
This commit is contained in:
Codeman maintainer
2026-09-21 04:39:28 +02:00
parent 0f955327b2
commit d8e85285c9
7 changed files with 102 additions and 17 deletions
+17 -1
View File
@@ -13809,7 +13809,10 @@ body.touch-device.cjk-input-visible .main {
.prompt-composer-dialog {
max-width: 560px;
max-height: calc(100dvh - min(15dvh, 72px) - 12px - env(safe-area-inset-bottom));
/* The overlay's top inset and bottom gutter, plus the strip a folding device
reserves below the dialog (0px everywhere else; see the fold rules at the
end of this file). */
max-height: calc(100dvh - min(15dvh, 72px) - 12px - env(safe-area-inset-bottom) - var(--fold-block-end));
overflow-y: auto;
}
@@ -18683,6 +18686,19 @@ html[data-session-list="sidebar"][data-sidebar="collapsed"] .btn-sidebar-toggle
padding-bottom: var(--fold-block-end);
}
/* The mobile prompt composer is a .paste-overlay with a gutter of its own: a
three-value `padding` shorthand whose bottom is 12px plus the safe area. The
generic rule above is a later longhand at the same specificity, so it ERASED
that gutter (measured at 393x852: padding-bottom 0 instead of 12px, and with
the fold variables set the hinge strip stood in for the gutter instead of
adding to it). Restate the composer's bottom gutter on top of the strip; the
side has no gutter of its own. The dialog's height cap subtracts the same
strip where it is declared (.prompt-composer-dialog). */
.prompt-composer-overlay {
padding-right: var(--fold-inline-end);
padding-bottom: calc(12px + env(safe-area-inset-bottom) + var(--fold-block-end));
}
/* The response viewer is a bottom sheet, so a vertical hinge running through it
is fine, since it is a wide surface like the terminal and inset dialogs are what
the fold guidance is about. A horizontal hinge is not: in tabletop pose the