feat(swift-ios): add swipe-down command palette - #6146
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 |
| } | ||
|
|
||
| private static func threadItems(snapshot: FeatureSnapshot) -> [FeatureCommandPaletteItem] { | ||
| let projectsByID = Dictionary(uniqueKeysWithValues: snapshot.projects.map { ($0.id, $0) }) |
There was a problem hiding this comment.
🟠 High Workspace/FeatureCommandPaletteModel.swift:266
threadItems builds projectsByID with Dictionary(uniqueKeysWithValues:), which traps when the snapshot contains two projects with the same id. Legacy aggregate snapshots can include cloned projects from multiple environments sharing an unscoped id, so presenting or searching the command palette with such a cached snapshot crashes the app. Consider using a duplicate-tolerant lookup (e.g. Dictionary(_:uniquingKeysWith:) or scoping by environment) instead.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/swift-ios/Features/Workspace/FeatureCommandPaletteModel.swift around line 266:
`threadItems` builds `projectsByID` with `Dictionary(uniqueKeysWithValues:)`, which traps when the snapshot contains two projects with the same `id`. Legacy aggregate snapshots can include cloned projects from multiple environments sharing an unscoped `id`, so presenting or searching the command palette with such a cached snapshot crashes the app. Consider using a duplicate-tolerant lookup (e.g. `Dictionary(_:uniquingKeysWith:)` or scoping by environment) instead.
What
Adds a native swipe-down command palette with recent threads, projects, new-task, add-project, and settings actions.
Scope
This is the single extracted feature commit: the palette model, palette view, WorkspaceView presentation gesture, and its focused tests. It excludes the surrounding personal release history.
Verification
Dependencies and gate
Note
Add swipe-down command palette to iOS workspace view
WorkspaceViewtriggered by a downward drag gesture starting within 88pt of the top edge with at least 72pt of vertical travel.FeatureCommandPaletteView) supports two modes: a root view with actions and search across projects and threads, and a project picker for "New task in…" navigation.>filters to actions only.WorkspaceView: opening a thread, switching to a project, starting a new task, or presenting the add-project or settings sheets.📊 Macroscope summarized 2293598. 3 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.