Skip to content

fix(j5): toggling a persona leaves the rest of Agent Setup alone - #1029

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-1027
Nov 14, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-1027

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Problem

On mobile Agent Setup, every persona toggle made the Import persona file and Import a folder of personas rows flicker (Jackson, Checkpoint 5). Closes #1027.

What changed

toggleAgent set the screen's busy flag for the length of the save. On mobile, busy feeds locked, which disables those two rows, the source folder rows, Add folder and the header's create menu. A disabled row renders at reduced opacity, so they all dimmed and came back on each toggle. Web's Agent Setup did the same, disabling its other controls while a toggle saved.

On both clients a toggle now leaves busy alone. The server already serializes every persona library write (importPermit in agentPersonaLibrary.ts), so other actions, and toggles on other rows, can run while one saves. A toggle still refuses while another action holds busy, and the toggled row keeps its own pending value from #1017.

UI changes

Android: the import rows while a toggle is saving:

Before After
Android: the import rows while a toggle is saving, before Android: the import rows while a toggle is saving, after

Android: the import rows and persona library sources while a toggle is saving:

Before After
Android: the import rows and persona library sources while a toggle is saving, before Android: the import rows and persona library sources while a toggle is saving, after

Web: the surrounding controls while a toggle is saving:

Before After
Web: the surrounding controls while a toggle is saving, before Web: the surrounding controls while a toggle is saving, after

After only:

Two Android persona toggles saving together, after

Both Android persona toggles saved, after

Both web persona toggles saved, after

Android refused toggle recovered with an error, after

Web refused toggle recovered with an error, after

Import file picker opening during a held Android toggle, after

Android before: four toggles and a held toggle:

android-base.mp4

Android after: four toggles, a double tap while saving, and two rows saving together:

android-head-clean.mp4

Web before: the surrounding controls during a held toggle:

web-base.mp4

Web after: two different toggles saving together:

web-head.mp4

Web after: a refused toggle recovering with an error:

web-refused.mp4

Android after: the import file picker opening during a held toggle:

android-import-held.mp4

Live testing

PASS on Android and web at d7b2659739 against base 1790b3386f (crew tester, report test-reports/pr-1029/d7b2659739.md). The server was held to keep each toggle saving.

  • Android: Import persona file, Import a folder of personas and Add folder stay fully opaque during a toggle; before, they dimmed. The source folder's text stayed readable on base too, so the change there shows on its row and menu.
  • Web: the surrounding controls stay enabled during a toggle.
  • A double tap on the saving switch is ignored on Android. A toggle on a different row is accepted, and both saves persist after release, on both clients. On web, a switch shows the new value only once the server confirms it.
  • The import file picker opens during a held toggle and cancels cleanly.
  • A refused write reverts and shows a PermissionDenied error on both clients.

Not exercised: iOS. The change is the same JS on both platforms; Jackson checks iOS at the next checkpoint.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: no test; a visual fix proven by captures
  • UI changes: before/after above, and a video for motion or interaction
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: none
  • Upstream product: no change
  • Surfaces: mobile and web Agent Setup (desktop wraps web)
  • Docs: none affected

Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

Each toggle set the screen's busy flag while it saved, and every row
that follows it, including Import persona file and Import a folder of
personas, dimmed and came back. Toggles now keep their own one-at-a-time
guard, which doesn't render, so the rest of Agent Setup stays put.

Closes #1027

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 14, 2026 6:35am UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 effective changed lines (test files excluded in mixed PRs). labels Nov 14, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Combined panel review (reviewer-opus + reviewer-sol) at 03ab2a6

Verdict: no findings, and the panel approves the source. Still pending: the tester's recording showing the import, folder and header rows stay steady while a persona toggles, and that single, double and failed toggles still settle. Also J5 CI.

  • Cause and fix. toggleAgent no longer sets the screen's busy, so locked doesn't flip and the rows it disables (Import persona file, Import a folder, the folder rows, Add folder, the header menu) no longer dim to opacity-45 and back during a toggle.
  • One toggle at a time. A useRef is set synchronously before the save and cleared after it. useAtomCommand → runAtomCommand turns a rejected request into a typed failure, so a failed save can't leave the guard stuck. A toggle still refuses while another action holds busy. The per-row pending value from #986 and #1017 is unchanged.
  • Other actions now run during a toggle. That's safe: on the server, every library mutation (setEnabled, import, remove, create, edit) takes the same process-wide importPermit.withPermit in agentPersonaLibrary.ts, so a toggle and an import or removal are serialized and can't lose each other's write.
  • Web unchanged. Web's Agent Setup keeps busy on toggle, since only the phone was reported. That's fine.
  • It changes one J5-owned file, so no FORK.md record is needed.

Reviewer-run: reactCompilerCoverage.test.ts passes (1093), mobile vp run typecheck exits 0, and lint and git diff --check are clean. It's a visual fix, so no UI test is asked for.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

Web's toggle also held the screen's busy flag while it saved, disabling
every other control. Both clients now leave busy alone on a toggle and
drop the client-side one-at-a-time guard: the server already serializes
persona library writes, so toggles on different rows can save together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jacksondr5 Jacksondr5 changed the title fix(mobile): toggling a persona leaves the import rows alone fix(j5): toggling a persona leaves the rest of Agent Setup alone Nov 14, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Panel delta check (reviewer-opus + reviewer-sol) at d7b2659

Verdict: no findings, and the panel approves the source. Still pending: evidence on both clients and J5 CI.

  • Web. As the Captain asked, web's toggleAgent no longer sets or clears busy, so the rest of Agent Setup stays enabled during a toggle. Its permission and busy checks, typed failure toast and catalog.refresh() on success are unchanged. The switch is controlled by persona.enabled, so it shows the old value until the reread lands, as before. A repeat click resends the same value, which does nothing.
  • Mobile. The client-side ref guard is gone. Toggles on different rows can save together, each row keeps its own pending value, and a same-row second tap is still ignored. A toggle still refuses while another action holds busy.
  • No write race. Every persona-library mutation is serialized on the server through importPermit.withPermit (agentPersonaLibrary.ts), so concurrent toggles, and a toggle beside an import or removal, can't lose a write.

For the evidence. Web now needs before and after too. On both clients: the surrounding rows stay steady, toggles on two different rows save together, and a failed toggle recovers.

Reviewer-run: web src/j5/agents tests pass (9 in 5 files), web and mobile vp run typecheck exit 0, lint and git diff --check are clean (reviewer-opus). reviewer-sol ran 2 targeted compiler checks on mobile and web.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

@Jacksondr5
Jacksondr5 marked this pull request as ready for review November 14, 2026 06:57
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 32 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 50 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1790b33 and d7b2659.

Files selected for processing: 2

  • apps/mobile/src/j5/agents/AgentLibrarySettingsScreen.tsx
  • apps/web/src/j5/agents/AgentLibrarySettings.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Jacksondr5
Jacksondr5 merged commit e4aaa1f into j5/main Nov 14, 2026
41 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/mobile-1027 branch November 14, 2026 07:01

This branch was successfully deployed

1 active deployment
Preview — d7b26597 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile Agent Setup: the import rows flicker when a persona is toggled

1 participant