feat(ios): add full thread row menu - #5753
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
| case .worktree: worktreeBase(in: branches) | ||
| } | ||
| } | ||
| return branches.first { $0.name == selection.name } ?? selection |
There was a problem hiding this comment.
🟠 High Workspace/NewTaskWorkspaceModels.swift:83
refreshedSelection returns the stale selection when it's no longer found in branches, so after a refresh the caller retains a branch that was deleted or renamed. canSubmit still accepts it and the request goes out with a branch no longer present, instead of falling back to localBranch/worktreeBase. The fallback ?? selection discards the resolved default even when the branch genuinely disappeared. Consider returning the mode-appropriate default when the branch is missing, or restricting the retain-original behavior to the initial seeded selection only.
| return branches.first { $0.name == selection.name } ?? selection | |
| return branches.first { $0.name == selection.name } ?? defaultBranch(in: branches, mode: mode) |
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/swift-ios/Features/Workspace/NewTaskWorkspaceModels.swift around line 83:
`refreshedSelection` returns the stale `selection` when it's no longer found in `branches`, so after a refresh the caller retains a branch that was deleted or renamed. `canSubmit` still accepts it and the request goes out with a branch no longer present, instead of falling back to `localBranch`/`worktreeBase`. The fallback `?? selection` discards the resolved default even when the branch genuinely disappeared. Consider returning the mode-appropriate default when the branch is missing, or restricting the retain-original behavior to the initial seeded selection only.
65e66ee to
4df1e9b
Compare
f6d7154 to
cc44c81
Compare
|
Rebased this draft onto the signed SwiftUI base rewrite at 4df1e9b. The only conflict was in NewThreadView; the repair keeps the new activePicker flow and preserves workspaceSelectionIsSeeded = false when a branch is chosen. GitHub now reports the intended 13-file diff (865 additions, 72 deletions), not the rewritten base history. Verification: 12 focused Xcode tests passed, 0 failed; git diff --check passed. New tip: cc44c81. |
What Changed
Regenerating…state while title generation is pending.This is limited to the native SwiftUI mobile client. It does not change the React Native mobile, web, desktop, server, or wire schemas.
Why
The Electron/web thread menu already exposes the complete thread workflow, while the SwiftUI row menu only offered Rename, Archive, Pin, Settle, a fixed one-hour Snooze, and Delete. Users could not start related work on the same branch, regenerate a title, copy thread metadata, choose useful snooze times, or wake a snoozed thread from the same menu.
The shared menu model keeps capability and reverse-state rules testable, while the UIKit collection view remains responsible only for rendering
UIMenuElementvalues. This follows the existing SwiftUI client boundary and the product direction established by #5592.Mark unread is intentionally excluded because the SwiftUI client does not yet have a thread-read model. That depends on the separate server read-status work in #5652.
UI Changes
Before:
After:
Snooze presets:
Interaction video: open the menu and inspect snooze presets
Verification
ThreadContextMenuTestsplusCoreContractTests/testCommandBuildersMatchOrchestrationContract— 12 passed, 0 failed, 0 skipped.node scripts/generate-swift-wire-fixtures.ts --check— exit 0.git diff --check— exit 0.05c8028b895a8a4529468d7b35e2c0011beb79754c09b463505217b462efb9a1) with no actionable findings. A fresh post-rebase review attempt exited 1 without output because the Claude session quota was exhausted; the rebase range-diff was unchanged.Risks and limitations
size:XL, so the small-PR checklist item remains unchecked even though this is one SwiftUI-only outcome.Checklist
Implemented with GPT-5.6 Sol in the Codex harness.
Note
Add full thread row context menu with title regeneration, branch seeding, and copy actions
ThreadContextMenuModelin ThreadContextMenu.swift that drives context menus with consistent, capability-gated items: new thread on branch, regenerate title, snooze presets, wake, and copy path/branch/thread ID.WorkspaceViewto handle all new menu actions, including optimistic UI tracking for in-progress title regeneration (item disabled while running) with a polling loop to clear state when the server finishes.regenerateTitleWebSocket command and supporting model fields (ThreadTitleRegeneration,isRegeneratingTitle) through the client and protocol stack.SeededWorkspaceDraftPersistenceto avoid persisting drafts that contain only a seed with no user content.ThreadContextMenuTestsand contract test assertions for the newregenerateTitlecommand payload.📊 Macroscope summarized f6d7154. 11 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.