Repository navigation
fix(mobile): keep typed commit messages, drop stale GitHub task pages, name icon-only buttons - #29068
Arnobrizwan wants to merge 5 commits into
Conversation
…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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d1baecae-d687-456c-8c19-d27b79568f05
📒 Files selected for processing: 18
mobile/app/h/[hostId]/accounts.tsxmobile/app/pair-confirm.tsxmobile/app/pair-scan.tsxmobile/app/terminal-settings.tsxmobile/src/components/TerminalShortcutSettings.tsxmobile/src/home/MobileHomeTopBar.tsxmobile/src/session/MobileNativeChatView.tsxmobile/src/session/use-mobile-session-keyboard-state.test.tsxmobile/src/session/use-mobile-session-keyboard-state.tsmobile/src/source-control/MobileSourceControlContent.test.tsxmobile/src/source-control/MobileSourceControlContent.tsxmobile/src/source-control/mobile-source-control-primary-action.test.tsmobile/src/source-control/mobile-source-control-primary-action.tsmobile/src/source-control/use-mobile-source-control-primary-action.tsmobile/src/source-control/use-mobile-source-control-state.tsmobile/src/tasks/mobile-tasks-screen-chrome.tsxmobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.tsmobile/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.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Disable the action-sheet opener during message… · MobileSourceControlContent.tsx:152-159
mobile/src/source-control/MobileSourceControlContent.tsx:152-159
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDisable the action-sheet opener during message generation.
ioBusydoes not includegeneratingMessage, 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 callsetCommitMessage(result.message)and refill the field.Include
generatingMessagein the content-levelioBusyvalue.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
📒 Files selected for processing: 6
mobile/src/components/CustomShortcutRemoveButton.tsxmobile/src/components/TerminalShortcutSettings.tsxmobile/src/tasks/use-mobile-tasks-jira-direct-entry.test.tsmobile/src/tasks/use-mobile-tasks-task-list-loading.tsxmobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.tsmobile/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).
|
@coderabbitai re the outside-diff note on |
|
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.tsxLength of output: 9947
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. |
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:
generatingMessagenow feedseditableand the primary action's busy check. The primary-action memo moved intouse-mobile-source-control-primary-action.tssouse-mobile-source-control-state.tsstays under max-lines.2. Stale GitHub task pages (Tasks). Before:
handleGitHubPageChangeawaited 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(andhitSlop={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 exposesexpandedstate. 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/disabledchange). I don't have a device or simulator build available, so behaviour is covered by the regression tests below.Testing
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 --noEmitreports no errors in changed files (remaining errors are pre-existing missing.generatedmodules). 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
mobile/), no desktop or path changes. Props used are standard React Native and work on iOS, Android and the web shell.Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author X: @arnob55806542