Repository navigation
feat(mobile): PR filters in the bottom tray, multi-select projects, glass cards - #451
Conversation
…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>
NoahHendrickson
left a comment
There was a problem hiding this comment.
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[]>):
targetskeeps 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
PullRequestsScreenhoistssavedViewsMenuand addsno3ybranches in four places: render item, padding, header, tray. This is acceptable inside fences. A singleconst no3yLayout = no3y ? {...} : nullwould 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
left a comment
There was a problem hiding this comment.
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.
stageinstate/preferences.tsapplies 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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
|
Thanks. Addressed in 1. Fixed. 2. Fixed. The selection is grouped once, with 3. Kept the ordering, with the contract stated at the call site. The 4. Fixed, except the count. 5. Fixed. The row's label is now Smaller: left as is. The four
|
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-menurefreshes the open menu in place). The chip reads "first project +N". Saved controls store aprojectsset (fork/no3yPullRequestProjects.ts). A singleprojectIdsaved 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 existingPullRequestListInput.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):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.tsxexportsChecksRunningMarkandChecksFailingMark. #448 makes the identical two-line change, so whichever PR merges second merges cleanly.Notes
.fork/customizations.yamlunderno3y-pr-project-multiselectandno3y-pr-list-bottom-filters. The guard isapps/web/src/__fork_guards__/no3yPullRequestListBottomFilters.test.ts.AndroidAnchoredMenu; that is left as a follow-up.Checks
vp run check:changed,vp run i18n:checkand.fork/lint-owned.mjspass.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 Codegpt-6.2-sol) via Codex, 3 review rounds; its project-menu dedup finding was fixed.🤖 Generated with Claude Code