fix: mobile goal UX — bottom-sheet dialog, keyboard-safe target button, capacitor safe-top for overlays

- the goal dialog renders as the shared MobileOverlayPanel bottom sheet
  on mobile instead of a centered dialog
- tapping the target button to ARM keeps the soft keyboard open (the next
  message is the objective; same guard as the attachment/mic buttons),
  while opening the manage sheet lets the keyboard close as usual
- capacitor: bottom-sheet overlays cap their height by the keyboard inset
  AND the top safe area — with the keyboard raised while typing inside a
  sheet, 100dvh does not shrink (native resize is off) and the panel could
  slide under the notch/status bar; applies to every MobileOverlayPanel
This commit is contained in:
Bohdan Triapitsyn
2026-07-12 17:01:40 +03:00
parent 8d956f5f9c
commit 22d5ad3814
3 changed files with 52 additions and 6 deletions
@@ -76,6 +76,20 @@ export const SessionGoalButton: React.FC<SessionGoalButtonProps> = React.memo(({
type="button"
className={cn(footerIconButtonClass, colorClass)}
onClick={handleClick}
// Same guard as PermissionAutoAcceptButton, but only for the ARM
// toggle: arming happens mid-typing (the next message IS the
// objective), so that tap must not dismiss the soft keyboard or
// trigger the Android keyboard-close relayout that moves the button
// before the click lands. Opening the manage sheet (goal exists) is a
// context switch — there the keyboard should close as usual.
onMouseDown={(event) => {
if (!goal) event.preventDefault();
}}
onPointerDownCapture={(event) => {
if (!goal && event.pointerType === 'touch') {
event.preventDefault();
}
}}
aria-label={label}
aria-pressed={isEngaged}
{...(withTooltip ? {} : { title: label })}