Skip to content

feat(mobile): PR filters in the bottom tray, multi-select projects, glass cards - #451

Merged
NoahHendrickson merged 3 commits into
customfrom
t3/pr-filters-project-multiselect
Nov 24, 2026
Merged

NoahHendrickson merged 3 commits into
customfrom
t3/pr-filters-project-multiselect

Conversation

@NoahHendrickson

Copy link
Copy Markdown
Owner

On iPhone, the Pull requests filters sat at the top of the screen, out of thumb reach. The project filter could only pick one project, and the rows looked nothing like the redesigned Linked pull requests sheet.

What changed

Filters at the bottom (no3y iPhone layout). The filter chips move from the list header into the bottom tray above the dock, the same way the Threads tab works (fork/No3yPullRequestFilterBar.tsx). The menus are unchanged; only the order is new: Author, Project, State, Involvement, Labels, Environment, Filters, Views. Project gets its own chip there, so the Filters menu no longer lists it. Search stays in the header. iPad, split view and Android keep upstream's header row.

Multi-select projects (every surface). The Project menu ticks several projects, and "All projects" clears them. On iOS the menu stays open between ticks (keepsMenuPresented; the patched @react-native-menu refreshes the open menu in place). The chip reads "first project +N". Saved controls store a projects set (fork/no3yPullRequestProjects.ts). A single projectId saved before this loads as a one-project selection, and every write clears that pair. Each environment is queried only for its own selected projects through the existing PullRequestListInput.projectIds, so there is no contract or server change. Environments with no selected project are skipped. Saved views match regardless of the order projects were ticked.

Glass cards (no3y iPhone layout). Rows draw as the Linked pull requests sheet's cards from #448 (fork/No3yPullRequestListCard.tsx):

  • Top line: the number on the tinted PR pill, a stack marker, failing or running checks, and +/− counts.
  • The title.
  • A meta line: repository, author, conflicts, review state and when it last changed.
  • Up to three labels.

Long-press opens the same actions menu, and VoiceOver reads the same full label as the upstream row.

The cards reuse #448's checks marks, so No3yStatusPill.tsx exports ChecksRunningMark and ChecksFailingMark. #448 makes the identical two-line change, so whichever PR merges second merges cleanly.

Notes

  • Upstream edits are fenced and listed in .fork/customizations.yaml under no3y-pr-project-multiselect and no3y-pr-list-bottom-filters. The guard is apps/web/src/__fork_guards__/no3yPullRequestListBottomFilters.test.ts.
  • On Android the header menu still multi-selects but closes after each tick. Keeping it open would mean changing upstream's AndroidAnchoredMenu; that is left as a follow-up.
  • Not yet seen on a device or simulator.

Checks

vp run check:changed, vp run i18n:check and .fork/lint-owned.mjs pass.

Reviewed with sol-loop: 3 rounds with gpt-6.2-sol. Sol verdict: approved


🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code

  • Reviewer: GPT-6.2 Sol (gpt-6.2-sol) via Codex, 3 review rounds; its project-menu dedup finding was fixed.

🤖 Generated with Claude Code

xxxxxxxxxxxxx and others added 2 commits November 24, 2026 03:15
…lass cards

On the no3y iPhone layout the Pull requests filters move from the list
header to the bottom tray above the dock, led by Author then Project, and
rows draw as the Linked pull requests sheet's glass cards. The project
filter becomes a set on every surface: the Project menu ticks several
projects and stays open, and each environment is asked only for its own
selected projects through the existing projectIds input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XL labels Nov 24, 2026

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-quality review of head 1603d8b6fa9a24cfe7e5da713f691b0c25079057 (base d0a25f8702). Not approving. No file crosses 1k lines and the fork fencing is tidy. But the multi-select model adds a second representation that every reader has to reconcile, one surface was missed because of that, and two new fork components copy upstream code that is already drifting.

1. Two shapes for one selection, reconciled at 7 call sites. One was missed.

PullRequestListControls now carries both projectId/projectEnvironmentId and projects. Every reader goes through pullRequestProjectSelection(controls): PullRequestsScreen.tsx:165, PullRequestListFilters.tsx:156, pullRequestList.ts:40/70/339/451 and pullRequestSavedViews.ts:23. The legacy fallback becomes a permanent tax on every future reader.

That has already caused a bug. PullRequestFilterSearchScreen.tsx:72 still reads controls.projectId. After any tick in the new Project menu, withPullRequestProjectSelection clears projectId. The Labels and Authors search screen then stops scoping its suggestions to the selected projects and shows options from every repository in the targeted environments. Before this PR it was scoped. PullRequestFilterOptionsInput already accepts projectIds, so it should get the same per-environment ids the list gets.

Code-judo: normalize once, where the data comes in. Migrate legacy projectId → projects when controls are read (usePullRequestListControls.controlsFor, and wherever saved views are decoded/applied). Downstream code then reads controls.projects ?? [] and never sees the legacy pair. pullRequestProjectSelection drops out of every upstream file, and the next reader cannot repeat the FilterSearch miss.

2. Per-environment narrowing is spread over an optional param and a three-way return

pullRequestListInput(controls, query, environmentId?) (pullRequestList.ts:332) silently drops the project filter when environmentId is omitted. The existing test still calls it that way. pullRequestProjectIdsFor returns undefined for "no selection" and [] for "selection elsewhere". The targets memo then re-derives the same env membership with projectSelection.some(...).

Group the selection by environment once (Map<environmentId, projectId[]>):

  • targets keeps an environment when the map is empty or has it.
  • Each target's input gets map.get(env).
  • The FilterSearch screen reuses the same map.

That removes pullRequestProjectIdsFor, the optional parameter and the undefined/empty distinction.

3. pullRequestFilterProjects is now driven by input order, and its selectedProject param is dead

pullRequestList.ts:85 pre-sorts [...selected, ...rest] so the repository dedup in client-runtime/pullRequestProjectFilter.ts happens to keep the selected projects. The helper's selectedProject parameter now has no callers, and correctness depends on an ordering contract nothing states. Change the parameter to an isSelected predicate (mobile is its only consumer), or delete it and document "first wins". Don't keep both an unused override and an implicit ordering trick.

4. No3yPullRequestFilterBar re-implements upstream's chips

The bar copies every chip's label, active flag, accessibility label and plural logic from PullRequestListFilters. It also re-hardcodes STATE_LABELS/INVOLVEMENT_LABELS as English strings instead of STATES/INVOLVEMENT. It filters more by the string id "projects" (line 103), and line 53 has a raw "Filter by project" while its neighbours use gt. Every upstream sync that touches a chip now has two places to change.

The real difference is order, plus Project as its own chip. Have usePullRequestListFilters return chip descriptors ({ label, active, accessibilityLabel, actions } for author, project, state, involvement, labels, environment, more). Each row then just maps them in its own order. The hook can also return moreWithoutProjects so nobody filters actions by id. Related: count now adds projectSelection.length (PullRequestListFilters.tsx:281). In the bottom tray the Filters chip therefore counts projects that are no longer in its menu, and the header counts three projects as three filters.

5. The card copies the row's accessibility label, and the copy has already drifted

The PR body says the card "reads the same full label as the upstream row". No3yPullRequestListCard.tsx:88 is a hand copy of PullRequestListRow's label array. It already differs: the card gates review and checks on open, so for closed and merged PRs VoiceOver says less than the upstream row does. Extract the label as a pure function (e.g. pullRequestListRowAccessibilityLabel(item, gt, messages) next to PullRequestListRow or in pullRequestList.ts) and call it from both. The same applies to the review-colour ternary chain and the checks wording if the card keeps them.

Smaller

  • PullRequestsScreen hoists savedViewsMenu and adds no3y branches in four places: render item, padding, header, tray. This is acceptable inside fences. A single const no3yLayout = no3y ? {...} : null would keep the upstream body readable, but this is secondary to 1–5.

To get to approval: fix the FilterSearch scoping, normalize the selection at the persistence boundary, and share the chip descriptors and the accessibility label instead of copying them.

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review of 1603d8b6fa9a24cfe7e5da713f691b0c25079057: one bug and two nits.

Important: label and author search ignores the project selection

apps/mobile/src/features/pull-requests/PullRequestFilterSearchScreen.tsx:72 (not in this diff, so it can't take an inline comment) still scopes its filterOptions request with controls.projectId:

...(controls.projectId ? { projectId: ProjectId.make(controls.projectId) } : {}),

Every project write now goes through withPullRequestProjectSelection, which clears projectId and stores the set in projects. So once someone ticks a project in the new menu, Search labels… and Search authors… return labels and authors from every repository in the environment. Before this PR they were narrowed to the selected project. Only controls saved before this change, which still carry the legacy projectId, stay scoped.

Repro: tick web in Project, then open Labels → Search labels… and type bug. The input has neither projectId nor projectIds, so the host answers for all repos.

Fix: PullRequestFilterOptionsInput already accepts projectIds. Build it per environment with pullRequestProjectIdsFor(pullRequestProjectSelection(controls), id), the same way pullRequestListInput does. Skip environments that have no selected project, as targets does on the list screen, so they don't fall back to unscoped options.

I checked two other findings and dropped them:

  • A race between quick ticks in the menu that stays open. stage in state/preferences.ts applies the optimistic patch synchronously when a save starts, so the next tap's render already sees the earlier tick.
  • No feedback when ticking past PULL_REQUEST_LIST_PROJECT_LIMIT (100). Nobody realistically gets there.

🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code

);
// Each repository keeps the first project it meets, so selected ones go first: every selected
// project stays in the menu, not only the first.
return pullRequestFilterProjects(

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: two selected projects in the same repository collapse into one menu entry. pullRequestFilterProjects still keeps one project per [environmentId, canonicalKey]. Putting selected projects first only protects the first selected project in each repository. Suppose web and web-wt are both ticked, for example because web-wt's repositoryIdentity hadn't resolved yet and it was keyed by project id. Once it resolves, only web shows in the menu. web-wt stays in the selection, projectIds and the local filter, but nobody can untick it except through All projects.

The same gap makes the chip disagree with itself in PullRequestListFilters.tsx. projectLabel is built from selectedProjects, the selected projects that appear in the menu, while projectCount and count use the whole projectSelection. So the chip reads web while the Filters badge counts 2. A deleted project left in the selection does the same.

Fix: let selected projects skip the repository dedupe (dedupe only the unselected ones), and add the two-selected-same-repo case to no3yPullRequestProjects.test.ts, or the existing pullRequestProjectChoices test.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as a nit. The menu is the only way to add a project to the selection, and while one checkout of a repository is selected, the menu never offers a second one. Selected projects go first, and the dedupe keeps the first project it meets per repository. So the only way in is the path you describe: a selected project whose repository identity later resolves to match another selected one. A deleted project left in the selection behaves the same way upstream's single selection already did. It can't be pruned while projects are still loading (see withoutScratchProjectScope), and All projects clears it. Letting selected projects skip the dedupe would mean reimplementing the shared client-runtime dedupe on mobile, which this change doesn't need.

import type { usePullRequestListFilters } from "../src/features/pull-requests/PullRequestListFilters";
import { ListFilterMenu } from "../src/features/layout/workspace/ListFilterMenu";

const STATE_LABELS = {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: these chip labels are now English only on the iPhone layout. Upstream's row, which this bar replaces there, renders m(STATES[state]) and m(INVOLVEMENT[involvement]). Those are msg(...) entries with translations. STATE_LABELS and INVOLVEMENT_LABELS are raw strings, and the project chip's accessibilityLabel="Filter by project" (line 53) isn't passed through gt. So a user on a non-English locale sees Open, All PRs and By you and hears Filter by project in English, where those chips were localized before. Exporting STATES and INVOLVEMENT from PullRequestListFilters.tsx, or returning resolved stateLabel and involvementLabel from usePullRequestListFilters, keeps the existing translations with no new keys.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b9465a715. The tray no longer has its own labels. usePullRequestListFilters returns chips, built with the same m(STATES[…]), m(INVOLVEMENT[…]) and gt(…) calls the upstream row used, and both rows render those. "Filter by project" goes through gt now, with translations added in every locale.

…nd labels

The label and author search still scoped by the old single projectId, so a
multi-project filter left its suggestions unscoped. It now sends each
environment its own selected projectIds, as the list does.

Saved controls are converted to the project set once, in
sanitizePreferences, so nothing downstream reads the legacy pair. The
selection is grouped by environment once for targets, list input and the
search. usePullRequestListFilters builds each chip once for upstream's
header row and the iPhone tray, and the card reads the row's accessibility
label instead of a copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NoahHendrickson

Copy link
Copy Markdown
Owner Author

Thanks. Addressed in 0b9465a715:

1. Fixed. PullRequestFilterSearchScreen now sends each environment its own selected projectIds, the same as the list. Legacy controls are converted at the read boundary: sanitizePreferences turns a saved projectId/projectEnvironmentId pair into projects, for both list controls and saved views (withPullRequestProjectSet). Everything downstream reads only controls.projects, and pullRequestProjectSelection is gone. The four upstream tests that scoped to a single project now pass a one-project set.

2. Fixed. The selection is grouped once, with pullRequestProjectIdsByEnvironment(controls). targets keeps an environment when the map is empty or contains it. Each input gets map.get(env) (pullRequestListInput's third parameter is now the ids themselves), and the search screen uses the same map. pullRequestProjectIdsFor and the undefined/empty distinction are gone.

3. Kept the ordering, with the contract stated at the call site. The selectedProject parameter isn't dead: web still passes it (apps/web/src/components/pullRequest/usePullRequestListView.ts, apps/web/src/components/issue/issuesSearch.logic.ts). Mobile relies on the helper's documented first-wins dedup, and the comment there now says so. Changing the shared client-runtime helper's signature for one caller isn't needed.

4. Fixed, except the count. usePullRequestListFilters returns chips (each with label, active, accessibility label and actions) plus moreWithoutProject. Upstream's header row and the tray only lay them out in their own order. The hardcoded English labels and the id-string filter are gone. "Filter by project" is now gt with translations in every locale. I kept the count as it is: it counts every active filter, including ones that have their own chip (state, author, each label), so counting each project matches how labels already count.

5. Fixed. The row's label is now pullRequestListRowAccessibilityLabel(item, gt, m) in PullRequestListRow.tsx, and both the row and the card call it. Closed and merged PRs now read the same on both.

Smaller: left as is. The four no3y branches are each fenced and small.

vp run check:changed, vp run i18n:check and .fork/lint-owned.mjs pass.

@NoahHendrickson
NoahHendrickson merged commit 3c0fc9c into custom Nov 24, 2026
32 checks passed
@NoahHendrickson
NoahHendrickson deleted the t3/pr-filters-project-multiselect branch November 24, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants