Repository navigation
feat(settings): one list shows every project's pull request feed rule - #36
Conversation
Settings > Source control gets Repository feed rules on web, desktop and mobile: one row per repository (projects without one get their own row), with the projects and environments it covers and a rule picker. A pick writes every writable copy, like the Pull Requests row menu. Rows say when copies differ, when the rule is the default, and which copies this client cannot change. A reset clears the overrides back to the default. The grouping lives in client-runtime's pullRequestFeedRuleRows so web and mobile share it, and it reads rules from PULL_REQUEST_FEED_RULES so new rules appear without changes here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d servers A mobile pick of the rule a row already shows no longer pins overrides, and rows stay locked until the server pushes the saved settings. One outdated server no longer hides the whole overview: its copies say to update it. Copy says a pick covers only the copies this connection can change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note claude-opus-5-5 responding on behalf of Ilkka Automatic review of VERDICT: APPROVE F1 [nit] packages/client-runtime/src/pullRequestFeed.ts:633: Copies on an outdated server still count when the helper works out the row's rule.
F2 [nit] apps/web/src/components/settings/PullRequestFeedRulesSetting.tsx:372: When a row shows "Differs" only because a read-only or disconnected copy disagrees, the writable copies may already share the picked rule. Picking it still writes an override on those copies, which pins an inherited rule. The mobile code avoids this only when the pick equals Checks:
|
|
Note gpt-6.2-sol responding on behalf of Ilkka Automatic review of VERDICT: CHANGES F1 [should] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:38 The first server update unlocks every row, so resetting a two-server repository before the second update clears only the first override. A successful no-op on the sole writable copy of a mixed row can also leave every row locked. Fix: Track completion per target using the save response and the expected override, including successful no-ops. F2 [should] apps/web/src/components/pullRequest/usePullRequestFeed.ts:164 The overview reads write grants without subscribing to them. A connected secondary server can remain marked read-only after its grant loads, so an All projects edit skips that copy. Fix: Subscribe to write grants for every environment in the overview. F3 [should] apps/web/src/components/pullRequest/usePullRequestFeed.ts:160 Both clients treat a policy-locked feed rule as writable. The picker offers changes the server rejects. Fix: Check the managed setting lock on each copy, show which organization manages it, and skip locked copies when setting a rule. F4 [should] apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx:488 Both clients hide the overview when the selected environment disconnects, even with cached rules. Mobile also hides it in All projects when the last connection drops. Fix: Keep the overview visible with its reconnect notes while leaving the other settings behind their existing connection checks. The web gate is at apps/web/src/routes/_chat.settings.tsx:97. Focused Node checks reproduced both F1 cases. The focused Vitest suite was unavailable because |
…ffline servers - Mobile picks lock the list per sent override until that server's settings answer it, so a reset across two servers waits for both, and a no-op or an offline server no longer leaves rows locked. - Web subscribes to write grants, so a grant that loads late unlocks its copies in the overview and the row menu. - A policy-locked feed rule reads "Managed by <organization> on <env>" and is skipped by overview writes and by the web row menu. - The overview stays visible from cached rules when the selected environment, or on mobile every environment, is offline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note claude-opus-5-5 responding on behalf of Ilkka Automatic review of VERDICT: APPROVE F1 [nit] packages/client-runtime/src/pullRequestFeed.ts:349 Carried over from the claude-opus-5-5 review of 8c1bffc (F1, #36 (comment)). It has no reply and the code is unchanged. Outdated copies still count toward F2 [nit] apps/web/src/components/settings/PullRequestFeedRulesSetting.tsx:46 Carried over from the same review (F2). It has no reply and the code is unchanged. A row can show "Differs" only because a read-only, disconnected or managed copy disagrees. In that case the writable copies may already inherit the picked rule, and picking it still writes a pinned override on each of them. Mobile has the same gap: its no-op guard at apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:82 compares the pick with I checked the gpt-6.2-sol review of 8c1bffc (#36 (comment)) against this head. All four findings are fixed:
I could not run the focused Vitest suites: there is no |
|
Note gpt-6.2-sol responding on behalf of Ilkka Automatic review of VERDICT: CHANGES F1 [should] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:87 Switching to the project scope before a feed save appears lets another setting, such as Remove agent credits when merging, save a stale copy of the whole project override and erase the new feed rule. Fix: Replan queued project writes from the latest acknowledged settings across both scopes. F2 [nit] apps/mobile/src/features/settings/sentFeedRules.ts:34 A delayed, unrelated settings push from the same server can unlock the picker before the saved rule appears, so a quick reset can miss that copy. Fix: Use the save response to match each target’s update. Carried over from the earlier unlock finding with a narrower trigger. Prior F1 F3 [nit] packages/client-runtime/src/pullRequestFeed.ts:349 An outdated server contributes the decoded “All pull requests” fallback and can leave a row showing “Differs” even when every supported copy agrees. Fix: Keep the copy and its update note visible while excluding it from the rule comparison. Carried over from F1 F4 [nit] apps/web/src/components/pullRequest/usePullRequestFeed.ts:179 If a disconnected or read-only copy causes “Differs,” picking the rule already inherited by every writable copy pins overrides there. The mobile picker does the same. Fix: Skip writable copies that already inherit the selected rule. Carried over from F2 Focused Node checks reproduced F1–F3. The Vitest suites were unavailable because |
- Mobile settings plans read this device's unanswered saves. The server replaces a project override entry whole, so a project-scope write made before a feed save showed up erased that feed rule. A save stops counting once a push since its send carries the server's stored settings; an interrupted save keeps waiting for that push. - A pick writes only writable copies not already on the picked rule, so a copy that inherits it keeps following its default. The web row menu does the same. - An outdated server's decoded fallback no longer counts toward "Differs"; its update note stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note claude-opus-5-5 responding on behalf of Ilkka Automatic review of VERDICT: APPROVE No findings.
|
|
Note gpt-6.2-sol responding on behalf of Ilkka Automatic review of VERDICT: CHANGES F1 [should] apps/mobile/src/features/settings/useSettingsWriter.ts:66 A delayed update from an earlier save can make the writer drop an acknowledged feed override before its own update arrives. Switching to project scope and changing “Remove agent credits when merging” then replaces the whole override and erases the feed rule. Fix: Replan queued project edits from the latest acknowledged settings. Carried over from prior F1. F2 [nit] apps/mobile/src/features/settings/sentFeedRules.ts:34 An unrelated update after the reply can still unlock the picker before the saved rule appears, so a quick reset can skip that copy. Fix: Match each update against the corresponding save response and replace the test’s assumption that any later update settles the save. Carried over from prior F2. F3 [nit] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:108 If a fast server shows the saved rule and another client changes it while a slow server is still saving, the batch records the newer settings as its starting point. The whole list stays locked until another update arrives. Fix: Retire each target when its save is acknowledged, independently of the batch. F4 [nit] apps/mobile/src/features/settings/settings-scoped-server.ts:146 An interrupted save that never reached the server can stay active after reconnect because the fresh snapshot reuses the unchanged settings object. The overview then shows an override the server never stored, and the next project edit can persist it. Fix: Reconcile interrupted saves when a fresh snapshot arrives, including when its values are unchanged. F5 [nit] packages/client-runtime/src/pullRequestFeed.ts:350 An outdated copy still contributes the decoded “All pull requests” fallback when it is offline or when every copy is outdated. This can produce a false “Differs” or “Default rule” status. Fix: Use server capability to decide whether a rule is known and show an unavailable value when none are known. Carried over from prior F3. Focused Node checks reproduced these cases. |
…rules stay unknown The server replaces a project's override entry whole, so a mobile save planned from a stale copy could erase another key, such as a feed rule saved just before. Web avoids this with a writer that runs one save at a time per environment and plans each from the previous save's response. That writer moves from web to client-runtime unchanged, and every mobile settings save now goes through it. The mobile pending-saves overlay and the overview's save lock are removed. A copy on a server that cannot store the feed rule no longer counts toward "Differs" or "Default rule". It asks for the update even while offline, and a row with no known rule shows Unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note claude-opus-5-5 responding on behalf of Ilkka Automatic review of VERDICT: APPROVE F1 [nit] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:69 This head removes the mobile overview's save lock and pending overlay. The copies a pick writes are now chosen from the cached row when the user picks, and the writer only re-plans the contents of each copy, not which copies get written. So a second pick made before the server pushes the first save back can be dropped. Example: a copy inherits "All pull requests" and the user picks Hidden. If they pick "All pull requests" again before the push arrives, Earlier review findings, checked against this head (bf1e2ba):
Other checks:
I could not run the Vitest suites: this checkout has no |
|
Note gpt-6.2-sol responding on behalf of Ilkka Automatic review of VERDICT: CHANGES F1 [should] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:69 Resetting a two-server repository after the first server reports F2 [should] packages/client-runtime/src/settingsWriter.ts:130 After mobile saves F3 [nit] packages/client-runtime/src/settingsWriter.ts:154 An older push from outside the writer can arrive during a feed save and cause the writer to discard the newer acknowledgment. A project edit before the feed save's own push then erases the saved rule. Carried over through the new writer. Fix: Keep the acknowledgment until the settings stream reaches that save or a later revision. Prior F1 F4 [nit] packages/client-runtime/src/pullRequestFeed.ts:306 An offline copy with a cached policy lock says reconnecting will let the user change its rule, even though the policy still blocks it. Fix: Show the cached managed-policy status while the copy is offline. F5 [nit] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:56 The overview offers editable rules for Scratch projects, which the pull request project pickers exclude. Web includes them at apps/web/src/components/pullRequest/usePullRequestFeed.ts:161. Fix: Exclude Scratch projects from the overview on both clients. Focused Node checks reproduced F1–F3, and |
… projects stay out On mobile a reset chose the copies that showed an override, so on a repository with two servers it missed the copy whose earlier pick had not shown up yet. A reset now plans every writable copy's environment. Each save is planned again when it starts, from the settings it starts from, the earlier save's response included: a copy that shows the override is cleared, and the settings writer sends nothing for one that still has nothing to clear. Scratch projects leave the overview on web and mobile, as they leave the pull request project pickers; the shared row helper drops them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note claude-opus-5-5 responding on behalf of Ilkka Automatic review of VERDICT: APPROVE F1 [nit] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:73 Carried over in part from claude-opus-5-5 F1 on bf1e2ba (#36 (comment)). The reset half is fixed: F2 [nit] packages/client-runtime/src/settingsWriter.ts:129 Carried over from gpt-6.2-sol F2 [should] and F3 on bf1e2ba (#36 (comment)). There is no reply, and the code is unchanged. F3 [nit] packages/client-runtime/src/pullRequestFeed.ts:306 Carried over from gpt-6.2-sol F4 on bf1e2ba (same link). It is unchanged. Other earlier findings, checked at this head (f2a2d07):
I could not run the Vitest suites because this checkout has no |
|
Note gpt-6.2-sol responding on behalf of Ilkka Automatic review of VERDICT: CHANGES F1 [should] packages/client-runtime/src/settingsWriter.ts:130 After two mobile saves settle, another client can restore the first rule and have that fresh update mistaken for a delayed echo. The next project edit silently restores the second rule. Fix: Track settings update order and retire saved responses once the stream catches up. Carried over. Prior F2 F2 [nit] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:73 Picking All pull requests after a fast server reports Hidden skips any slower copy that still displays All. That copy stays Hidden and keeps the repository out of the combined feed. Fix: Queue picks for every writable copy and decide whether each needs a write using the latest acknowledged settings. Carried over. Prior F1 F3 [nit] packages/client-runtime/src/settingsWriter.ts:161 An earlier settings push arriving during a save can discard the newer acknowledgment. A queued reset then sees no override and sends nothing, leaving the copy Hidden. Fix: Retain the acknowledgment until the settings stream reaches that save or a later revision. Carried over. Prior F3 F4 [nit] packages/client-runtime/src/pullRequestFeed.ts:306 An offline copy with a cached policy lock says reconnecting will let the user edit its rule. Fix: Show the cached policy lock while the copy is offline. Carried over. Prior F4 F5 [nit] packages/client-runtime/src/settingsWriter.ts:233 Mobile save alerts now replace non-Error failure details with a generic reconnect message. Fix: Preserve the supplied failure detail when a cause is available. Focused Node checks reproduced all five findings, and |
|
Note claude-opus-5-5 responding on behalf of Ilkka Merging
|
Problem
To see or change a project's pull request feed rule, you had to select each project in the Settings scope selector, or right-click one of its pull requests. No one place showed which projects override the default rule.
Change
Settings → Source control now has Repository feed rules below the default rule, on web, desktop and mobile. The list shows in the All projects and environment scopes.
repositoryIdentity.canonicalKeylikepullRequestRepositoryRules. A project without a repository identity gets its own row. Each row names the repository, the projects and environments it covers, and has a rule picker built fromPULL_REQUEST_FEED_RULES, so a new rule shows up without changes here.planProjectOverridePatchviauseRunScopedPlan, the same path as the row menu; mobile:planMobileScopedSettingsPatch). A reset button (web) or Use the default rule (mobile) clears the overrides of the writable copies.Differs: All pull requests on Laptop; Hidden on Server., and the picker shows "Differs". For disconnected, outdated or read-only copies it adds one line, for exampleConnect Server to change it.pullRequestFeedRuleRowsinpackages/client-runtime/src/pullRequestFeed.ts, which web and mobile share.docs/user/source-control.mdgets one sentence on where the overview is.Mobile gap: the mobile rows use a native menu instead of a select, and there is no search entry. Web has a settings-search entry, Repository feed rules.
pullRequestFeedinlockedSettings) say "Managed by on .", and no write covers them. This applies to the overview and to the web row menu.createScopedSettingsWriter. It moved unchanged fromapps/web/src/components/settings/scopedSettings.tstopackages/client-runtime/src/settingsWriter.ts, and web re-exports it. The server replaces a project's override entry whole, so the writer runs one save at a time per environment and plans each one from the previous save's response. A save planned from a stale copy therefore keeps the keys an earlier save set. That stale-copy plan was the lost-write cause in codex F1 of rounds 2 and 3. The mobile pending-saves overlay and the overview's save lock are gone.planMobileFeedRuleReset). Each save is planned again when it starts, from the settings it starts from, the earlier save's response included. So a copy whose earlier pick has not shown up yet is still cleared. The writer sends nothing for a save whose replanned patch is empty. Web needs none of this: its rows include in-flight saves throughapplyPendingScopedWrites.isScratch, dropped inpullRequestFeedRuleRows).pullRequestFeedRuleTargets), so a copy that inherits that rule keeps following its default. The web row menu does the same.pullRequestFeedcapability), online or offline. Such a copy's decoded fallback never feeds "Differs" or "Default rule", and its note says to update the server. A row with no known rule shows Unavailable.Scope
The maintainer asked for this as a follow-up to #31 (per-project feed rules). It does not depend on #33 (
involvedrule). The picker reads the rule list, so #33's rule appears here once it merges.Verification
vp test run packages/client-runtime/src/pullRequestFeed.test.ts: 27 passed. The 4 new cases cover grouping across environments with a case-insensitive key, a row of its own for a project without identity, an inherited rule, differing copies, and access notes, with reset only for writable overridden copies.vp test run apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx: 3 passed. That test mocks the new section, which loads native menu modules.vp run check:changed: lint, knip, typecheck (41 packages), tests and React compiler pass. Format fails only on the untracked.jaru/map/map.json, which is not part of this change./code-reviewmedium ran on the diff. Its 3 Important findings are fixed in the second commit: a mobile pick of the current rule no longer pins overrides, mobile rows stay locked until the saved settings arrive, and one outdated server no longer hides the list. Two nits that made the copy inaccurate are also fixed. Not fixed (nits): the row name comes from the first copy, "Differs" names only environments when two checkouts on one environment disagree, and "No projects yet." also shows when no environment has sent settings yet.8c1bffc):ai-review/codexreported four shoulds, all fixed in96b9972. Focused tests:pullRequestFeed.test.ts27 passed (the access case now covers a policy-locked copy),sentFeedRules.test.ts2 passed (a reset across two servers stays open until both answer, a no-op closes at once, a saved change closes at the next update), andSettingsServerControlsRouteScreen.test.tsx3 passed.vp run check:changed: lint, knip, typecheck, tests (6 files) and React compiler pass. Format fails only on the untracked.jaru/files./code-reviewmedium on the round-1 diff found 2 Important findings, both fixed before the push. The web row menu now also skips policy-locked copies. A sent mobile override on an offline server no longer locks the list forever. Not fixed (nits): an unrelated settings push after the save reply also releases the mobile lock, the same as hidden pull requests do. On web the All scope has no connection gate, so the list renders there through the Source control page; that case was not run live.8c1bffcwith three projects (pingdotgg/t3code,pnupu/t3codeas two projects, and a third repository): the list shows one row per repository, and the twopnupu/t3codeprojects share one row. Picking Authored by me onpingdotgg/t3codesaves the override, removes "Default rule." from that row, and shows the reset button.96b9972): fixedai-review/codexF1 (should, lost write), F3 and F4 (nits). Focused tests:settings-scoped-server.test.ts8 passed. It has a new case: a project write planned over a pending feed save keeps the feed rule. That case cannot pass on96b9972, which has no pending-save overlay. A second new case covers when a saved write stops applying.pullRequestFeed.test.ts29 passed. New cases cover an outdated copy left out of "Differs", and a pick that skips copies already on the rule.SettingsServerControlsRouteScreen.test.tsx3 passed, andsentFeedRules.test.ts2 passed.vp run check:changed(untracked.jaru/excluded for the run only): every step passes. That covers format, lint, knip, typecheck (7 packages), tests (6 files) and React compiler./code-reviewmedium found 2 Important findings, both fixed before the push:bdeff78): codex F1 (should) was the third form of the same lost write. Cause:mergeProjectSettingsOverridesPatch(packages/shared/src/serverSettings.ts) replaces a project's whole override entry, as the contract says, and the mobile writer planned whole entries from stale copies. Fixed in round 4 by the shared writer above.projectSettingsOverridesfield to merge per key. Clients clear a key by leaving it out of the entry (clearProjectSettingsOverrides), so released clients' resets would stop working on new servers. New clients that send one key would wipe the other keys on older servers. Some keys also storenullas a real value, sonullcannot mean "clear".pullRequestFeed.test.ts29 passed. The outdated-copy case now also covers an offline outdated copy, which fails without the change, and a row with no known rule.scopedSettings.test.ts32 passed, unchanged, including the writer's regression case for rapid project saves (fix(web): preserve project settings during rapid saves pingdotgg/t3code#18426).settings-scoped-server.test.ts,SettingsServerControlsRouteScreen.test.tsxandsentHiddenPullRequests.test.ts: 12 passed. Two clicks in the screen test now useawait act(async …), because saves start on the writer's queue one microtask later; the assertions are unchanged.vp run check:changed(untracked.jaru/excluded for the run only): unused patches, format, knip, typecheck (41 packages), tests (6 files) and React compiler pass. Lint failed on one unused import, which I removed; lint then passed in the commit hook./code-reviewmedium (full diff sincebdeff78) found 5 Important findings:main: after an interrupted save, the next save plans from the cached copy. Server controls also show the cached value from the save reply until the push arrives. Both behave as onmainnow that the overlay is removed.createScopedSettingsWritersends the original plan. It was moved unchanged, as asked.bf1e2ba), the last round in the budget:settings-scoped-server.test.tsgains a reset case that keeps the not-yet-shown copy queued and clears it from the earlier save's response. A newpackages/client-runtime/src/settingsWriter.test.tsshows that an empty save planned again from the save before it is sent only once it changes something. That case fails without the change: the empty save was sent.versionis the event schema literal1, and the payload is onlysettings), so acknowledgments cannot be retired by stream order without a protocol change. This is web's writer behavior, moved unchanged.vp run check:changedon the final tree (untracked.jaru/excluded for the run only): every step passes. That covers unused patches, format, lint, knip, typecheck (41 packages), tests (8 files) and React compiler. Focused tests: client-runtime feed and writer tests 30 passed, webscopedSettings.test.ts32 passed, mobile settings 76 passed./code-reviewmedium: three passes on the final diff sincebf1e2ba, because the design changed twice.isScratchtoo). Two nits: no reset item while every copy's first save is still in flight, and reset member choice that differs from web by design.8c1bffc; rounds 1 to 5 have no new captures. No live run of a policy-locked copy, the offline overview or the mobile client, and no multi-environment write against live servers, so the "Differs" text was not seen live. No capture ofmain: there, Settings → Source control has only the Pull request feed row that appears above the new list in these captures.After: every repository on the default rule
After: one repository set to Authored by me
Model and harness: Claude Opus 5.5 via T3 Code delegated task.
🤖 Generated with Claude Code