feat(swift-ios): filter the new-task project picker and pick its environment - #7634
Conversation
…ronment Choosing a project on the new-task sheet had no way to narrow the list, and on an account with projects on several machines the only way to tell them apart was to read the location line on every row. Two controls, one per question. An environment selector above the list offers "All environments" plus each host that actually owns a visible project, so it can always change the list; it appears only when more than one host is represented. A search field filters by project name. The two narrow independently and compose, and neutral values on both render exactly the list that was there before. Matching deliberately ignores host names. An earlier revision matched them, and a two-letter query then selected every project on a machine because the query happened to sit inside the machine name — the list looked broken rather than filtered. Host is the selector's axis. Rows now name the host they would open on, leading with the environment the composer is already using and counting the rest, which replaces the per-location lines. The list is drawn as grouped cards on T3Colors.surface rather than plain List rows: a plain row inherits the page background, which on a dark appearance is near-black, so rows read as loose text on a void with full-bleed separators. Cards keep them anchored in both appearances, with hairlines inset past the icon column.
|
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 42533b2. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds new user-facing capabilities (project filtering and environment selection) with new UI components and business logic. New features introducing new user behavior warrant human review regardless of test coverage. You can add or adjust custom eligibility rules. Learn more. |

What Changed
The new-task project picker gets two controls and a surface fix.
Host, orHost +Nwhen the group also exists elsewhere), leading with the environment the composer is already using — the same choicepreferredProject(environmentID:)makes on selection.Listrows.DailyUXProjectHostLabelsis new and owns host naming;DailyUXProjectPickerSectionsgained the two narrowing axes. 8 new focused tests.Why
Filtering. There was no way to narrow the list at all.
Why the selector rather than matching hosts in the text field. An earlier revision of this work did match host names in the search field. It was wrong in practice: a two-letter query selected every project on a machine because the query happened to sit inside the machine name (
"ro"matched every project onAlex's MacBook P·ro·). The list looked broken rather than filtered. Host is a different question from name, so it gets its own control, and the text field deliberately ignores hosts. There is a test asserting that negative.Why cards. The rows were plain
Listrows with.listRowBackground(T3Colors.background)— the row background was the page background. In light appearance that reads as an acceptable flat list. In dark,T3Colors.backgroundis#0A0A0A, so row and page are the same near-black, no surface exists under the rows, and.listStyle(.plain)runs separators the full width. The result read as loose text floating on a void. Cards onT3Colors.surfacewith a hairline border anchor the rows in both appearances, and dividers are inset past the icon column. This is a real defect on the current branch, not a restyle for taste.Heads-up for reviewers — this replaces an existing display
This removes
projectLocation(_:)and the per-row location lines it fed ("<environment> · <path>", up to two plus"+N more locations"), replacing them with a single host label. That was deliberate — on a phone the two-line-per-location rows crowded the title, and the question being asked at that moment is "which machine will this run on", not "which checkout". But it drops the path detail, it is a product decision on a surface you already shaped, and it is separable from the rest of this PR. If you want the path kept, say so and I will restore it alongside the host label rather than instead of it.Exact-head UI proof
Captured from current PR head
ffa19ec6c81cd992e4f6a6ebb6556178613f765e. Before every capture, the installedT3Code.debug.dylibSHA-256 matched the exact-head build artifact:3c916e22d3f541699fc0792500d571423130a4c9ed9a0be087dc1c644b379f2e.Both frames show one grouped
alpha-ledgerrow withAlex’s MacBook Pro +1, proving that same-named environments are counted as distinct destinations.Interaction proof: 26.9-second exact-head video — filters to
Travel Mac, selects the shared project, and ends with the composer visibly targetingTravel Mac.Testing
T3CodeTests/DailyUXNewTaskTestson iPhone 17 Pro / iOS 26.5: 37 passed, 0 failed, 0 skipped (11projectPicker*cases — 3 pre-existing, 8 new).+Nshared-host case and that the label follows the composer's environment; endpoint-host fallback and unknown environments; filtering by name and the negative — a host name typed into the field matches nothing; per-host narrowing with the Recent/Other sections preserved; selector × text composition; and that the selector only offers hosts that own visible projects.Limitations
environments.count > 1), but it does mean a single-host user never discovers the control.Checklist
Coordination trace: T3 thread 33C247AD-06DD-442D-B688-582FDD789770 · saphid/t3code-personal#123
Note
Low Risk
Client-only SwiftUI and sectioning logic for task creation; no auth, networking, or persistence changes beyond picker state that resets when the sheet closes.
Overview
The new-task project picker gains search (project names only) and an environment menu when multiple hosts have visible projects; both filters compose and default to the previous unfiltered list.
DailyUXProjectHostLabelsdrives row subtitles (HostorHost +N) aligned with the composer’s current environment viapreferredEnvironmentID, with endpoint-host fallback for unnamed environments. Rows no longer show per-locationenvironment · pathlines.DailyUXProjectPickerSectionsapplies optionalfilterandenvironmentIDbefore Recent/Other splitting;isEmptysupports empty search states.The picker UI moves from a plain
Listto card-groupedScrollViewrows (surface + inset dividers) and wirespreferredEnvironmentIDfromNewThreadView. Eight newDailyUXNewTaskTestscover host labels, filtering, and environment narrowing.Reviewed by Cursor Bugbot for commit 42533b2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add environment selector and text filtering to
NewTaskProjectPickerScrollViewwith an environment menu, text search, and per-row host labels showing where a selection opens.DailyUXProjectHostLabels,DailyUXProjectHostOption, andDailyUXProjectPickerSelection.targetin DailyUXModels.swift to compute environment options, resolve a selection target to a specific project on the chosen (or fallback) environment, and label hosts with a+Nsuffix for multi-environment groups.DailyUXProjectPickerSectionsnow filters groups by environment first, then by case-insensitive text match against group and project names (hosts excluded).selectProjectGroupnow compares the resolved target project rather than the group id, so selecting the same resolved project is a no-op; text search no longer matches host names.Macroscope summarized ffa19ec.