Skip to content

fix(mobile): keep typed commit messages, drop stale GitHub task pages, name icon-only buttons - #29068

Closed
Arnobrizwan wants to merge 5 commits into
stablyai:mainfrom
Arnobrizwan:fix/mobile-ux-a11y-races
Closed

Arnobrizwan wants to merge 5 commits into
stablyai:mainfrom
Arnobrizwan:fix/mobile-ux-a11y-races

Conversation

@Arnobrizwan

Copy link
Copy Markdown
Contributor

ELI5

On the phone app: (1) asking the AI to write a commit message could wipe out what you were typing, (2) flipping repos while a GitHub task page was loading could show the old repo's tasks, (3) removing a terminal shortcut could look done when it wasn't saved, and (4) several icon buttons were silent for screen-reader users. This fixes all four.

What Changed

1. AI commit message vs. typing (Source Control). Before: while "Generate commit message" ran, the box stayed editable and Commit stayed enabled, so typing was overwritten by the AI reply, and a commit made mid-generation let the late reply refill the cleared box. After: the box is read-only and the primary action is disabled while generating (Cancel on the sparkle button still works). Mechanism: generatingMessage now feeds editable and the primary action's busy check. The primary-action memo moved into use-mobile-source-control-primary-action.ts so use-mobile-source-control-state.ts stays under max-lines.

2. Stale GitHub task pages (Tasks). Before: handleGitHubPageChange awaited the next page and appended it without checking whether the selection changed meanwhile. After: it reuses the list loader's existing guard (loadGenerationRef + clientRef), so a page fetched for an old repo/filter/provider is dropped.

3. Removing a custom shortcut. Before: the key was hidden, then saved; a failed save left it hidden until the next load brought it back. After: save first, hide on success, warn on failure (same as the add path in CustomKeyModal).

4. Accessibility. Added accessibilityRole/accessibilityLabel (and hitSlop={8} where the target was 32-36pt) to: home Settings gear, Back on pair-scan / pair-confirm / terminal-settings / accounts, Tasks refresh and new-issue (+), Accounts refresh, and the remove (X) button in terminal shortcut settings. The chat Tools toggle now exposes expanded state. Labels follow the existing convention ("Back", hitSlop={8}).

Why

Each fix reuses an existing mechanism instead of adding a new one: the loader's generation guard, the add path's save-then-update order, the existing a11y prop convention. For (1), I considered applying the AI reply only if the text was unchanged, but locking input during a short generation is simpler and matches how Commit already locks the box during a commit.

Linked Issue

Fixes #29067

Visual Proof

N/A: no layout or styling change. Labels and roles are screen-reader-only, and the commit box keeps its look (only editable/disabled change). I don't have a device or simulator build available, so behaviour is covered by the regression tests below.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

New tests, each confirmed to fail on main and pass with the fix:

  • mobile-source-control-primary-action.test.ts: Commit is disabled while a message generates.
  • MobileSourceControlContent.test.tsx: commit box is not editable while generating.
  • use-mobile-tasks-task-pagination-actions.test.ts (new): a page resolving after the list generation changes is dropped; the unchanged case still appends.
  • use-mobile-session-keyboard-state.test.tsx: a refused removal keeps the shortcut; an accepted one removes it.

Locally (mobile/): vitest on src/source-control, src/tasks, src/components, src/home, src/settings, the session keyboard + native chat view tests and the pair/accounts/terminal-settings route tests all pass (1,700+ tests). A few suites could not load locally because generated bundles and root deps weren't built; they don't touch these files. tsc --noEmit reports no errors in changed files (remaining errors are pre-existing missing .generated modules). I couldn't run oxlint/oxfmt (native binaries blocked on my machine), so I checked formatting with the same Prettier-compatible settings and max-lines with ESLint's identical rule: all files are within limits, so no disables or bumps. CI will confirm.

AI Disclosure

Found, fixed and tested with an AI agent (Claude, Anthropic) via the Aside browser, then reviewed by me.

Review

  • Cross-platform: mobile-only (mobile/), no desktop or path changes. Props used are standard React Native and work on iOS, Android and the web shell.
  • SSH/remote/local: no transport or host changes. The pagination guard uses the same client identity check as the list loader.
  • Agents/integrations: GitHub tasks pagination only. Linear/GitLab/Jira untouched.
  • Performance: one extra memo dependency and a ref comparison per page fetch.
  • Security: none (no new inputs, storage or network calls).
  • UI: no visual change; the commit box was already locked during commit, now also during generation.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Author X: @arnob55806542

…ates

Typing during generation was overwritten by the AI reply, and a commit
started mid-generation let the late reply refill the cleared box.
Moves the primary-action memo into its own hook to stay under max-lines.
Next-page loads now reuse the list loader's generation/client guard, so a
page fetched for the previous repo/filter/provider is no longer appended
to and shown over the new list.
…trols

- Persist before hiding a removed custom shortcut (matches the add path).
- Label and role the home Settings gear, Back on pair/accounts/terminal
  screens, Tasks refresh and new-issue, Accounts refresh and the
  shortcut-settings remove button; expose the chat Tools toggle's
  expanded state; widen their hit area with hitSlop.
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3db43765-36ce-48bd-95b8-939e788ea959
📥 Commits

Reviewing files that changed from the base of the PR and between 9f79b7f and 6d5ccf4.

📒 Files selected for processing: 2
  • mobile/src/source-control/MobileSourceControlContent.test.tsx
  • mobile/src/source-control/MobileSourceControlContent.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

Mobile controls gain accessibility labels, roles, state, and hit-area changes. Custom shortcut deletion now saves before updating in-memory state and leaves state unchanged if saving fails. Source Control disables commit-message editing and the primary action during AI message generation. GitHub pagination discards results when the client or load generation changes. Current task-list loading also clears pagination state and resets the target page.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 6d5cc

The reviewed changes leave no identified merge-blocking behavior; the generation guard prevents the supported action-sheet commit path during generation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 8.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise, specific, and accurately summarizes the four main mobile fixes: preserving typed commit messages, dropping stale GitHub task pages, and improving icon-only button accessibility.
Description check Passed The description follows the required template and clearly explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI disclosure, compatibility considerations, and che…
Linked Issues check Passed The PR meets the coding requirements in [#29067]. Source Control blocks editing, primary commit, and action-sheet operations during AI message generation. Tests cover the generation lock. GitHub pagin…
Out of Scope Changes check Passed The changes stay within [#29067]. The primary-action hook extraction supports the Source Control fix. The task loading state updates support stale-page handling. The shared remove-button component sup…
  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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: 3


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d1baecae-d687-456c-8c19-d27b79568f05
📥 Commits

Reviewing files that changed from the base of the PR and between caa4155 and b066970.

📒 Files selected for processing: 18
  • mobile/app/h/[hostId]/accounts.tsx
  • mobile/app/pair-confirm.tsx
  • mobile/app/pair-scan.tsx
  • mobile/app/terminal-settings.tsx
  • mobile/src/components/TerminalShortcutSettings.tsx
  • mobile/src/home/MobileHomeTopBar.tsx
  • mobile/src/session/MobileNativeChatView.tsx
  • mobile/src/session/use-mobile-session-keyboard-state.test.tsx
  • mobile/src/session/use-mobile-session-keyboard-state.ts
  • mobile/src/source-control/MobileSourceControlContent.test.tsx
  • mobile/src/source-control/MobileSourceControlContent.tsx
  • mobile/src/source-control/mobile-source-control-primary-action.test.ts
  • mobile/src/source-control/mobile-source-control-primary-action.ts
  • mobile/src/source-control/use-mobile-source-control-primary-action.ts
  • mobile/src/source-control/use-mobile-source-control-state.ts
  • mobile/src/tasks/mobile-tasks-screen-chrome.tsx
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.ts
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…lock

- Extract the custom shortcut remove (X) button so it can carry a button
  role and hitSlop without pushing TerminalShortcutSettings past max-lines.
- A superseded GitHub page no longer clears the pagination lock; the
  reloading list releases it, so no page can start against the old list.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Disable the action-sheet opener during message… · MobileSourceControlContent.tsx:152-159

mobile/src/source-control/MobileSourceControlContent.tsx:152-159
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Disable the action-sheet opener during message generation.

ioBusy does not include generatingMessage, so the action sheet can open while generation is pending. Its commit actions remain enabled when a message and the required upstream state exist. A successful commit clears the message, but the pending generation can then call setCommitMessage(result.message) and refill the field.

Include generatingMessage in the content-level ioBusy value.

Suggested fix
-  const ioBusy = busyAction !== null || openingPath !== null || openingBranchPath !== null
+  const ioBusy =
+    generatingMessage ||
+    busyAction !== null ||
+    openingPath !== null ||
+    openingBranchPath !== null

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2764daa-fe04-4a5f-bba0-2b3f2b3086ca
📥 Commits

Reviewing files that changed from the base of the PR and between b066970 and 9f79b7f.

📒 Files selected for processing: 6
  • mobile/src/components/CustomShortcutRemoveButton.tsx
  • mobile/src/components/TerminalShortcutSettings.tsx
  • mobile/src/tasks/use-mobile-tasks-jira-direct-entry.test.ts
  • mobile/src/tasks/use-mobile-tasks-task-list-loading.tsx
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.ts
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

The action sheet can commit too, so a commit from it mid-generation let the
late AI reply refill the cleared box. Content-level ioBusy now includes
generatingMessage (also pausing Stage All / Unstage All).
@Arnobrizwan

Copy link
Copy Markdown
Contributor Author

@coderabbitai re the outside-diff note on MobileSourceControlContent.tsx (action sheet during message generation): fixed in 6d5ccf4. Content-level ioBusy now includes generatingMessage, so the actions menu (and Stage All / Unstage All) is disabled until the AI message finishes. MobileSourceControlContent.test.tsx now asserts the menu button is disabled while generating and re-enabled after.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
ast-grep outline mobile/src/source-control/MobileSourceControlContent.tsx
ast-grep outline mobile/src/source-control/MobileSourceControlContent.test.tsx
rg -n -C 5 'ioBusy|generatingMessage|Stage All|Unstage All|disabled=' mobile/src/source-control/MobileSourceControlContent.tsx
rg -n -C 8 'generatingMessage|disabled|generating|editable' mobile/src/source-control/MobileSourceControlContent.test.tsx

Length of output: 9947


@Arnobrizwan, confirmed by code inspection. ioBusy now includes generatingMessage, which disables the actions menu, Stage All, and Unstage All during generation.

The regression test checks that the actions menu and message input are disabled during generation and re-enabled afterward. This addresses the outside-diff finding. I did not run the tests.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#29067) has been resolved on main by #30140 (d4dfcf2694), #30142 (b0a7d2eb48). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 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.

[Bug]: Mobile: AI commit message overwrites typing, stale GitHub task pages, and unlabeled icon buttons

2 participants