Skip to content

Dismiss mobile terminal keyboard before tab actions - #6671

Merged
AmethystLiang merged 1 commit into
mainfrom
mobile-close-terminal-should-dismiss-keyboard
Jun 29, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
mobile-close-terminal-should-dismiss-keyboard

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

  • dismiss pending terminal live-input focus before opening session tab actions
  • wait for the keyboard hide signal before opening the action sheet when the keyboard is visible
  • guard pending keyboard-dismiss fallback callbacks so stale long-presses cannot reopen old sheets

Validation

  • pnpm exec oxlint mobile/app/h/[hostId]/session/[worktreeId].tsx
  • pnpm exec oxfmt --check mobile/app/h/[hostId]/session/[worktreeId].tsx
  • git diff --check -- mobile/app/h/[hostId]/session/[worktreeId].tsx
  • pnpm typecheck

Note: pnpm --dir mobile lint still cannot run because mobile/node_modules is missing and the local oxlint binary is unavailable.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds a keyboard-dismiss gate for session tab long-press action sheets. A new constant defines the fallback delay. Two refs track a Keyboard.addListener subscription and a monotonically increasing request sequence. A new openSessionTabActionSheetAfterKeyboardDismiss function blurs input, waits for keyboardDidHide (or falls back via setTimeout), validates the sequence to discard stale requests, then calls the refactored openSessionTabActionSheet switch. Tab long-press now routes through this function. Unmount cleanup bumps the sequence and removes the listener.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and validation, but it omits required Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections. Add the missing template sections and fill in the testing checklist, review report, security audit, and notes; include screenshots or say no visual change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: dismissing the mobile terminal keyboard before opening tab actions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
mobile/app/h/[hostId]/session/[worktreeId].tsx (1)

232-232: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a short reason for the fallback duration.

450 is a non-obvious timing guard; document why this value exists so future tuning does not regress keyboard/action-sheet ordering.

Suggested change
+// Why: bounds the wait if keyboardDidHide is missed, while allowing the native
+// hide animation to finish before the action sheet opens.
 const TERMINAL_KEYBOARD_DISMISS_ACTION_SHEET_FALLBACK_MS = 450

As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3ed5299a-700a-49eb-bfe5-d52896421f07

📥 Commits

Reviewing files that changed from the base of the PR and between 7c6f88b and e68a2d1.

📒 Files selected for processing (1)
  • mobile/app/h/[hostId]/session/[worktreeId].tsx

@AmethystLiang
AmethystLiang merged commit 93867ba into main Jun 29, 2026
3 checks passed
@AmethystLiang
AmethystLiang deleted the mobile-close-terminal-should-dismiss-keyboard branch June 29, 2026 00:32
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant