Repository navigation
fix(mobile): sources name their environment, no toggle flash, one back button - #1017
Conversation
…k button A persona's Source row and a playbook's source line now name the environment they live on. Toggling a persona no longer greys the name or dims every switch while the save runs; the switch alone shows the new value, and the name follows once the change is saved. The persona form keeps iOS's native back button instead of swapping to a custom one when it becomes dirty. Native stack cancels the native Back and swipe while the removal guard holds, so the guard still asks first. Closes #1012 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined panel review (reviewer-opus + reviewer-sol) at 7403b79
Verdict: no source findings, and the panel approves the source. Approval is conditional on the iOS device check of the Back flows (below), which this PR's design depends on, plus captures and J5 CI.
-
Environments are named. The persona sheet's Source row adds "on " through
personaDetailRows' optionalenvironmentLabel, with the Personas page's selected environment label passed in. Playbook lines read "Library on …", "From source folder on …" or "From on …". -
No toggle flash. The name's colour follows the saved
persona.enabled, and the switch shows the pending value. Switches are disabled only when the session can't operate, so no switch dims during a save. A second tap on a row with a pending value is ignored inonValueChange. On iOS, RN'sSwitchthen restores the pending value. Note for the tester: a tap on a different row while one is saving hitstoggleAgent'sbusyreturn (false), so that row quietly snaps back. That's acceptable, but worth seeing. -
One Back button.
SettingsFormScreendrops the iOS header swap and keeps the native Back button. The guard comes fromusePreventRemoveinuseSettingsFormExit. On iOS this app uses J5'screateV5StackNavigator.ioswith react-native-screens v5'sStack.Screen(the T3 fork5.0.0-t3.48), and on that path:- The navigator sets
preventNativeDismissfrompreventedRoutes[key]?.preventRemoveand routesonNativeDismissPreventedtogoBack()(createV5StackNavigator.ios.tsx:168–175). RNSStackNavigationController.mmchecksshouldPreventNativePopToControllerboth in the swipe'sgestureRecognizerShouldBegin(:28–34) and in its overriddenpopViewControllerAnimated(:173–181), which the native Back button reaches. Each emitsonNativeDismissPrevented, so both run the guard.- The JS pop after a save is let through by
_performingReactUpdate.
Upstream's scheduled-task editor comment ("native Back pops before removal guards") may predate this fork's support, so the source favours the design, but the device decides. If it fails, the fallback is upstream's always-custom back item without swipe back.
- The navigator sets
For the iOS device run: native Back and swipe with unsaved changes ask "Discard changes?". "Keep editing" stays on the form, "Discard" leaves, and both are blocked while saving. After a save, the form leaves. A clean form leaves at once.
Reviewer-run checks
- mobile
src/j5/agentsandreactCompilerCoverage.test.ts: 1114 passed (reviewer-opus). reviewer-sol: 14 persona and compiler checks. - mobile
vp run typecheck: exit 0 - lint: clean on
src/j5/agentsandsrc/j5/playbooks;git diff --check: clean
Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.
A refused swipe dropped and restored the keyboard under the Discard dialog, so a guarded form turns the gesture off, as trunk did. The gesture flag doesn't change the header, so the back button stays put. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On iOS, the V5 stack navigator uses gestureEnabled only to set preventNativeDismiss, which the unsaved-changes guard already sets, so the flag never turned swipe off. Trunk's swipe was off because of the custom back item, which this PR removes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Jacksondr5
left a comment
There was a problem hiding this comment.
Panel delta check (reviewer-opus + reviewer-sol) at 3919a0c
Verdict: one should-fix. The new gestureEnabled: !guarded is a no-op on this app's iOS stack, so the delta doesn't change the swipe behaviour it sets out to change. (Raised by reviewer-sol, confirmed by reviewer-opus.)
Why it's a no-op:
- In J5's iOS navigator (
createV5StackNavigator.ios.tsx), the only use ofgestureEnabledis line 169:preventNativeDismiss = preventedRoutes[key]?.preventRemove || options.gestureEnabled === false. No separate gesture prop reaches the v5Stack.Screen; its native props have none. - A guarded form already sets
preventRemove, sopreventNativeDismissistrueeither way. The native props are identical before and after. - In
RNSStackNavigationController.mm, the swipe'sgestureRecognizerShouldBegin(:28–37) refuses the pop and emitsonNativeDismissPrevented. The navigator turns that intogoBack()(:173–175), which opens the guard's dialog.
So a dirty swipe still opens "Discard changes?", and the keyboard drops under the native alert, which is iOS's usual behaviour for an alert over an active text field. That's what the tester measured, and it was also trunk's behaviour, since trunk's custom back item set the same flag on the same path.
Ways forward (the Captain's call):
- (a) Accept the measured behaviour, a dirty swipe asking "Discard changes?" the way native Back does, and drop the no-op wiring (
guardedprop andNativeStackScreenOptions) so the code doesn't claim a swipe-off it doesn't do. - (b) Make a dirty swipe truly inert. That needs the navigator to tell a swipe apart from the Back button, which is an edit to upstream's
createV5StackNavigator.ios.tsx(a zone-3 product change), so it isn't recommended for this.
The rest of #1017 is unchanged and still approved. Reviewer-run: mobile vp run typecheck exits 0 and reactCompilerCoverage.test.ts passes (1093).
Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.
Jacksondr5
left a comment
There was a problem hiding this comment.
Panel note (reviewer-opus + reviewer-sol) at 6c38493: the revert's tree is identical to the approved 7403b79 (tree bb0fcc9678; git diff is empty). The panel's source approval is restored. The dirty-swipe keyboard bounce under the "Discard changes?" alert is recorded in the PR as a known limit, accepted by the Captain, for Checkpoint 5. Android evidence and J5 CI remain the gates.
Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.
|
Warning Review limit reached
This review includes 7 billable files and costs up to $1.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 5 minutes for your next included review. View limit details
|
Problem
Jackson's Checkpoint 4 on his iPhone found three issues in mobile Agent Setup. A persona's or playbook's source didn't say which server it lives on. Toggling a persona looked like a redraw. In the persona editor, the back button "pulsed" on the first change. Closes #1012.
What changed
toggleAgentalready refused it.usePreventRemoveactive, native stack setspreventNativeDismiss, and react-native-screens' stack cancels a native Back and sends it through the guard. Swipe back on a form with unsaved changes now asks too, where trunk's custom item turned swipe off.UI changes
Dirty Edit: native Back asks before discarding:
Dirty Create: native Back asks before discarding:
Persona details: Source names its environment:
Before: the first keystroke crossfades the back button, then a dirty Back:
ios-edit-first-key-back-before.mp4
After: the back button stays put, and a dirty Back asks first:
ios-edit-first-key-back-after.mp4
After: dirty edge and content swipes ask first:
ios-edit-dirty-swipes-after.mp4
After: toggling a persona off and on, with no grey flash:
ios-toggle-after.mp4
Android:
A refused toggle reverts and explains why (after only):
Android before: six toggles and a held pending double tap; the switches dim while saving:
toggles-and-held-bed54-before-published.mp4
Android after: the same sequence, with switches undimmed and the name colour changing only once saved:
toggles-and-held-3919-after-published.mp4
Live testing
iOS: PASS at
7403b795b0against basebed54fa2fc, on iOS 26.5 (crew tester, reporttest-reports/pr-1017/ios-7403b795b0.md).7403b795b0.Known limit for Checkpoint 5: with the keyboard up, a refused swipe drops and restores the keyboard under the Discard dialog (the dirty-swipe video above). On this app's iOS stack navigator,
gestureEnabledonly feedspreventNativeDismiss, so it can't turn the swipe off separately. The only way to stop it is the custom back item, which brings back the pulse.3919a0c1a2tried the flag, and6c38493737reverts it; the head's tree matches the tested7403b795b0.Android: PASS at
3919a0c1a2against basebed54fa2fc, on Android 16, light theme (crew tester, reporttest-reports/pr-1017/3919a0c1a2.md). The head6c38493737has the same tree as7403b795b0; the only difference from3919a0c1a2is an iOS-only option, so the run stands.Not exercised: dark theme, a second connected environment, relay or tunnel, and Back during an in-flight save.
Checklist
Claude Opus 5.5 in J5 Code (Claude Code harness).
🤖 Generated with Claude Code