Skip to content

SwiftUI thread rows: regenerate a thread title - #8623

Open
saphid wants to merge 7 commits into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
saphid:swiftui/pr-141-title-regeneration
Open

SwiftUI thread rows: regenerate a thread title#8623
saphid wants to merge 7 commits into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
saphid:swiftui/pr-141-title-regeneration

Conversation

@saphid

@saphid saphid commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What users observed

In the SwiftUI iOS client, thread titles never regenerate after the first (often mediocre) auto-title. There is no way to ask for a better title from the home screen, and regeneration that does happen can collide with itself — duplicate requests, stale overwrites of a freshly regenerated title, or recovery attempts that never settle.

What changed

  • Thread rows offer "Regenerate title" (where the server supports it) with visible in-progress state on the row while the request is in flight.
  • Regeneration is authoritative and sequence-reconciled: outcomes are applied by request identity, so a stale or late response can never overwrite a newer title; duplicate actions are suppressed while one is pending.
  • Recovery is bounded: failures surface once per request, retry/recovery work is tracked per thread and cancelled with the thread, and pending state survives shell refreshes so the row never lies about what is happening.
  • Server state remains the source of truth — local pending state defers to authoritative state on the next snapshot.

Affected: SwiftUI iOS client only — server, contracts, web/desktop, and React Native are unchanged.

Base: t3code/rebuild-mobile-app-swift at b67837984e5650888b1eed0e1cd7fff83625f696.

UI changes

Before (thread row menu without regeneration, light)

Before — thread row menu

After (regenerate action, in-progress state, duplicate suppressed)

After — authoritative success

After — duplicate action disabled

Interaction video (duplicate failure path)

Play the duplicate-failure video

Dark-mode captures and the full set are embedded in the tracking issue.

Intentionally unchanged

  • Server-side title generation itself (the client consumes the existing regeneration commands/events).
  • Web/desktop title editing.

Verification

  • Focused native suites on this re-materialized head, iPhone 16 Pro / iOS 26.5 simulator: T3CodeTests/FeatureRootModelTests, T3CodeTests/ThreadTitleRegenerationMenuTests, T3CodeTests/HomeThreadSwipeActionTests, T3CodeTests/WireFixtureContractTests — 205 test cases passed, 0 failed across the four suites (xcodebuild exit 0).
  • Full app + test-target build for the simulator succeeded (xcodebuild test, exit 0).
  • git diff --check clean.

Known gaps / honest disclosures

  • This branch is a re-materialization of work originally developed and device-verified against an earlier state of the mobile rebuild stack; the captures above are from that accepted head, not from this exact commit. CI on this PR provides the current-head build/test signal.
  • The upstream root model has since gained unrelated pull-request-tracking state; the integration composes both (regeneration tracking alongside PR observation) rather than touching upstream's PR code.

Affected: SwiftUI iOS client only.


Note

Medium Risk
Medium risk from a breaking FeatureClient signature change, non-trivial concurrency between regeneration, rename, shell vs detail metadata, and optimistic UI state that must stay aligned with server snapshots.

Overview
Adds end-to-end thread title regeneration on the Swift iOS client: users can trigger it from home and thread detail menus, see in-progress state on rows, and get VoiceOver announcements for start, success, and failure.

The FeatureClient API now takes a client-generated requestID and returns FeatureTitleRegenerationDispatchReceipt instead of firing-and-forgetting. NativeFeatureClient dispatches with that commandID, refreshes (including archived threads when needed), and classifies the outcome from snapshot sequence, server titleRegeneration metadata, and whether the title actually changed. Shell snapshots are treated as the authority for title and regeneration fields so stale detail loads cannot revert a new title.

FeatureRootModel adds FeatureTitleRegenerationTracker to block duplicate requests, reconcile against shell updates (including another client’s request ID), survive ambiguous timeouts, and expire with a bounded recovery timer. renameThread waits for an in-flight regeneration dispatch so server-side cancellation ordering stays correct.

Wire models gain ThreadTitleRegeneration and thread fields isRegeneratingTitle / titleRegenerationRequestID. Home and detail UIs use ThreadTitleRegenerationMenuState to hide, enable, or disable regeneration actions and show a small ProgressView on thread rows.

Reviewed by Cursor Bugbot for commit ba8a1d2. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add title regeneration tracking and UI progress to SwiftUI thread rows

  • Introduces FeatureTitleRegenerationTracker in FeatureRootModel.swift to track per-thread in-flight regenerations via request IDs, resolve them against server snapshots or a 60-second timeout, and emit VoiceOver announcements.
  • Updates regenerateThreadTitle on FeatureClient and NativeFeatureClient to accept a requestID and return a FeatureTitleRegenerationDispatchReceipt indicating regenerating, completed, failed, or refresh-unavailable status.
  • Adds a progress indicator and "Regenerating title" accessibility value to thread rows in HomeThreadCollectionView.swift and WorkspaceView.swift; context menus and accessibility actions disable the regenerate action while in progress.
  • Prevents stale detail frames from overwriting newer shell title/regeneration metadata via deferringToShellMetadata in FeatureRootModel.swift and emitCachedSnapshot in NativeFeatureClient.swift.
  • Risk: FeatureClient.regenerateThreadTitle now requires a requestID parameter and returns FeatureTitleRegenerationDispatchReceipt instead of Void; conformers outside the tree must update their implementation.

Macroscope summarized ba8a1d2.

Squash-merge of the accepted title-regeneration window
(22b22f1..b1ad17bbd) onto the current maintainer branch head.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dffbee65-5243-4f22-a76a-74ae832b700d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 29, 2026
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift Outdated
Comment thread apps/swift-ios/Features/Workspace/HomeThreadCollectionView.swift
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift Outdated
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a user-facing title-regeneration workflow across the SwiftUI iOS client, including new concurrency/state tracking, server-backed request identity, refresh reconciliation, and a public client protocol change. The production scope is substantially more than a small UI adjustment, so the runtime and API interactions warrant human review.

You can add or adjust custom eligibility rules. Learn more.

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Aug 29, 2026
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 030cc83. Configure here.

Comment thread apps/swift-ios/Tests/FeatureTests/FeatureRootModelTests.swift
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). 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.

1 participant