Skip to content

fix(ios): child-count strings follow the formatter's locale; unrace two chip tests - #14554

Merged
teamleaderleo merged 3 commits into
mainfrom
fix/ios-shellui-tests-b
Sep 25, 2026
Merged

teamleaderleo merged 3 commits into
mainfrom
fix/ios-shellui-tests-b

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Three CmuxMobileShellUI failures in the files-chip and folder-tap code. One is a real bug, two are stale or racy tests.

  • Bug (code fix): TerminalArtifactChildCountFormatter passed its locale only as the formatting locale, so String(localized:) read the string table of the process language. An injected Japanese locale rendered "1 item" in an English host. It now resolves the matching .lproj in the package bundle first, as DiagnosticLocalization in CMUXMobileCore already does. Formatter from iOS: complete chip files gallery — dedup, folders, streaming viewer, previews, gallery UX, QoL #8287.
  • failedScanDropsHeldZero modeled a failed refresh but left scanSucceeded at its default of true. Since Fix iOS terminal typing latency #12007's per-count scan dedupe, only scanSucceeded: false releases the visible count. Production passes scanSucceeded: response != nil, so the test now passes false like the other failed-scan tests.
  • The fast folder-tap classification test raced the policy's 50 ms ContinuousClock deadline against a busy main actor in the hosted suite (iOS: make terminal folder-path taps a setting (Open Folders on Tap) #8524). It now injects a clock that never fires, so classification is the only possible answer.

Credit: @azooz2003-bit (#8287, #8524, #12007).

Part of getting the cmux-ios full suite green on main (see #14464 to #14470).

🤖 Generated with Claude Code


Summary by cubic

Fixes child-count strings to follow the formatter's locale and stabilizes two flaky tests in CmuxMobileShellUI.

  • TerminalArtifactChildCountFormatter now resolves the matching .lproj in the package bundle so an injected locale selects its translation instead of falling back to the process language.
  • The failedScanDropsHeldZero test now passes scanSucceeded: false to model a failed refresh, aligning with production behavior after per-count scan dedupe.
  • The fast folder-tap classification test now injects a clock that never fires, removing the race against the 50 ms deadline on a busy main actor.

Written for commit c083b73. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Terminal artifact child counts now use the preferred localization available in the app’s resources, while retaining the selected locale’s number and plural formatting. If a matching localization is unavailable, the counts fall back to the default resources. This improves consistency for capped and inflected child-count labels across supported localizations.

teamleaderleo and others added 3 commits September 25, 2026 06:03
TerminalArtifactChildCountFormatter passed its locale only as the
formatting locale, so String(localized:) and AttributedString(localized:)
still read the string table of the process language. An injected
Japanese locale rendered "1 item" in an English host. Resolve the
matching .lproj of the package bundle first, as DiagnosticLocalization
in CMUXMobileCore already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
failedScanDropsHeldZero modeled the failed refresh as a completion with
no totals but left scanSucceeded at its default of true. Since #12007
added per-count scan dedupe, only a completion with scanSucceeded false
releases the visible count, so the follow-up trigger at the same count
became a provisional report instead of a report plus retry. Production
passes scanSucceeded: response != nil, so pass false here as the other
failed-scan tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TerminalFolderTapPolicy runs the stat on the main actor and races it
against a 50 ms ContinuousClock deadline. In the hosted iOS suite, other
tests keep the main actor busy long enough for the deadline to win, so
the fast classification test saw .focusTerminal. Inject a clock whose
sleep only ends on cancellation, so the classification is the only
possible answer and the test no longer depends on scheduling.

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

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 53276e6a-e903-4c2e-baf7-77b2294be674

📥 Commits

Reviewing files that changed from the base of the PR and between f2550c9 and c083b73.

📒 Files selected for processing (3)
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalArtifactChildCountFormatter.swift
  • Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/TerminalArtifactChipCountStateTests.swift
  • Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/TerminalFolderTapPolicyTests.swift
 __________________________________________________
< Deploying the charm offensive against your bugs. >
 --------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@teamleaderleo
teamleaderleo merged commit 257cd9e into main Sep 25, 2026
54 of 57 checks passed
@teamleaderleo
teamleaderleo deleted the fix/ios-shellui-tests-b branch September 25, 2026 11:39
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for c083b73017, merged 2026-09-25 11:39:25 UTC

  • Not verified at merge: ios-simulator-build (in progress), mobile-core-package (in progress)
  • Verified: ci-status, Web complexity, web-validation, detect-ios-changes, Fast static checks, guards (17), package-conventions-lint, runner, Testbox broker trust boundary, tests
  • Skipped by policy: browser, Claude wrapper regressions, GhosttyKit release check, linux-preflight, macos, macOS admission gate, remote-daemon, suite-coverage, web, web-build, web-database-tests, web-tests
  • Full suite: runs on main after merge.

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