Skip to content

feat(swift-ios): filter the new-task project picker and pick its environment - #7634

Open
saphid wants to merge 2 commits into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
saphid:feat/swift-ios-project-picker-environment-filter
Open

feat(swift-ios): filter the new-task project picker and pick its environment#7634
saphid wants to merge 2 commits into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
saphid:feat/swift-ios-project-picker-environment-filter

Conversation

@saphid

@saphid saphid commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What Changed

The new-task project picker gets two controls and a surface fix.

  • Environment selector above the list: "All environments" plus each host that actually owns a visible project. It appears only when more than one host is represented, because with one host it could not narrow anything.
  • Filter field that matches project names.
  • The two axes narrow independently and compose; neutral values on both render exactly the list that was there before.
  • Rows now name the host they would open on (Host, or Host +N when the group also exists elsewhere), leading with the environment the composer is already using — the same choice preferredProject(environmentID:) makes on selection.
  • The list is drawn as grouped cards instead of plain List rows.

DailyUXProjectHostLabels is new and owns host naming; DailyUXProjectPickerSections gained 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 on Alex'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 List rows with .listRowBackground(T3Colors.background) — the row background was the page background. In light appearance that reads as an acceptable flat list. In dark, T3Colors.background is #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 on T3Colors.surface with 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 installed T3Code.debug.dylib SHA-256 matched the exact-head build artifact: 3c916e22d3f541699fc0792500d571423130a4c9ed9a0be087dc1c644b379f2e.

Light Dark

Both frames show one grouped alpha-ledger row with Alex’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 targeting Travel Mac.

Testing

  • Focused suite T3CodeTests/DailyUXNewTaskTests on iPhone 17 Pro / iOS 26.5: 37 passed, 0 failed, 0 skipped (11 projectPicker* cases — 3 pre-existing, 8 new).
  • New cases cover: host label per row; the +N shared-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.
  • Integrated run on the iOS Simulator against two isolated local T3 environments, in light and dark.

Limitations

  • The selector hides itself when only one host is represented. Consistent with the Add Project environment picker (which hides at environments.count > 1), but it does mean a single-host user never discovers the control.
  • Selector state is per-sheet; reopening the picker starts from "All environments" again.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes — no motion or transition changes in this PR

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.

DailyUXProjectHostLabels drives row subtitles (Host or Host +N) aligned with the composer’s current environment via preferredEnvironmentID, with endpoint-host fallback for unnamed environments. Rows no longer show per-location environment · path lines.

DailyUXProjectPickerSections applies optional filter and environmentID before Recent/Other splitting; isEmpty supports empty search states.

The picker UI moves from a plain List to card-grouped ScrollView rows (surface + inset dividers) and wires preferredEnvironmentID from NewThreadView. Eight new DailyUXNewTaskTests cover 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 NewTaskProjectPicker

  • Reworks the project picker UI in NewThreadView.swift into a card-styled ScrollView with an environment menu, text search, and per-row host labels showing where a selection opens.
  • Adds DailyUXProjectHostLabels, DailyUXProjectHostOption, and DailyUXProjectPickerSelection.target in 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 +N suffix for multi-environment groups.
  • DailyUXProjectPickerSections now filters groups by environment first, then by case-insensitive text match against group and project names (hosts excluded).
  • Expands tests in DailyUXNewTaskTests.swift covering host labeling, environment narrowing, and filter semantics.
  • Behavioral Change: selectProjectGroup now 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.

…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.
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Aug 20, 2026
@coderabbitai

coderabbitai Bot commented Aug 20, 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: 11a23e28-f83c-415a-882f-f025ec34fbf6

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

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.

@github-actions github-actions Bot added the size:XL 500-999 changed lines (additions + deletions). label Aug 20, 2026
Comment thread apps/swift-ios/Features/Workspace/NewThreadView.swift
Comment thread apps/swift-ios/Features/Workspace/DailyUXModels.swift Outdated

@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 42533b2. Configure here.

Comment thread apps/swift-ios/Features/Workspace/NewThreadView.swift
@macroscopeapp

macroscopeapp Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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