Skip to content

feat(settings): one list shows every project's pull request feed rule - #36

Merged
pnupu merged 6 commits into
mainfrom
t3/pr-feed-rules-panel
Nov 19, 2026
Merged

pnupu merged 6 commits into
mainfrom
t3/pr-feed-rules-panel

Conversation

@pnupu

@pnupu pnupu commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

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.

  • There is one row per repository, keyed on the lowercased repositoryIdentity.canonicalKey like pullRequestRepositoryRules. 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 from PULL_REQUEST_FEED_RULES, so a new rule shows up without changes here.
  • A pick writes the override on every writable copy (web: planProjectOverridePatch via useRunScopedPlan, 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.
  • The row status says Default rule. when no copy overrides the rule. When copies disagree it says, for example, 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 example Connect Server to change it.
  • The grouping and status live in pullRequestFeedRuleRows in packages/client-runtime/src/pullRequestFeed.ts, which web and mobile share.
  • The hidden pull requests list stays where it is.
  • docs/user/source-control.md gets 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.

  • Copies a managed policy locks (pullRequestFeed in lockedSettings) say "Managed by on .", and no write covers them. This applies to the overview and to the web row menu.
  • Web reads the settings write grant through a subscription, so a grant that loads late unlocks its copies.
  • The list stays visible from cached rules, with its "Connect X to change it." notes, when the selected environment is offline: on web through the reconnect page of Source control, on mobile also when every environment is offline. The other settings stay behind their existing connection checks.
  • Mobile settings saves go through the writer web already uses, createScopedSettingsWriter. It moved unchanged from apps/web/src/components/settings/scopedSettings.ts to packages/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.
  • A mobile reset plans every writable copy's environment (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 through applyPendingScopedWrites.
  • Scratch projects are left out of the overview on web and mobile, as the pull request project pickers leave them out (isScratch, dropped in pullRequestFeedRuleRows).
  • A pick writes only writable copies not already on the picked rule (pullRequestFeedRuleTargets), so a copy that inherits that rule keeps following its default. The web row menu does the same.
  • A copy counts as having a known rule only when its server can store it (pullRequestFeed capability), 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 (involved rule). 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-review medium 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.
  • Round 1 (head 8c1bffc): ai-review/codex reported four shoulds, all fixed in 96b9972. Focused tests: pullRequestFeed.test.ts 27 passed (the access case now covers a policy-locked copy), sentFeedRules.test.ts 2 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), and SettingsServerControlsRouteScreen.test.tsx 3 passed. vp run check:changed: lint, knip, typecheck, tests (6 files) and React compiler pass. Format fails only on the untracked .jaru/ files.
  • /code-review medium 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.
  • Web, dev server on 8c1bffc with three projects (pingdotgg/t3code, pnupu/t3code as two projects, and a third repository): the list shows one row per repository, and the two pnupu/t3code projects share one row. Picking Authored by me on pingdotgg/t3code saves the override, removes "Default rule." from that row, and shows the reset button.
  • Round 2 (head 96b9972): fixed ai-review/codex F1 (should, lost write), F3 and F4 (nits). Focused tests:
    • settings-scoped-server.test.ts 8 passed. It has a new case: a project write planned over a pending feed save keeps the feed rule. That case cannot pass on 96b9972, which has no pending-save overlay. A second new case covers when a saved write stops applying.
    • pullRequestFeed.test.ts 29 passed. New cases cover an outdated copy left out of "Differs", and a pick that skips copies already on the rule.
    • SettingsServerControlsRouteScreen.test.tsx 3 passed, and sentFeedRules.test.ts 2 passed.
  • Round 2 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.
  • Round 2 /code-review medium found 2 Important findings, both fixed before the push:
    • A save whose push arrived before its reply stayed applied over the cache. It now ends at the reply.
    • Mobile rows compared a pick against the cache without pending saves.
    • Also fixed: the web row menu also skips copies already on the rule, and an interrupted save keeps waiting for its push.
  • Follow-up (declined, codex F2 nit): an unrelated settings push from the same server after the save reply can release the mobile overview lock before the saved rule appears. Hidden pull requests use the same rule today. A fix would match each target against the save response.
  • Round 3 (head 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.
  • Rejected: changing the existing projectSettingsOverrides field 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 store null as a real value, so null cannot mean "clear".
  • Follow-up (option 2): a separate per-key override patch on the server (keys to set plus keys to clear), behind a new environment capability. The current field keeps its meaning for released clients.
  • Round 3 nits: codex F5 is fixed (known rules come from the server capability). F2 and F4 are moot, because the overlay and lock code they concern is deleted. F3 is also moot: the overview no longer locks while a save is pending.
  • Round 4 focused tests:
    • pullRequestFeed.test.ts 29 passed. The outdated-copy case now also covers an offline outdated copy, which fails without the change, and a row with no known rule.
    • Web scopedSettings.test.ts 32 passed, unchanged, including the writer's regression case for rapid project saves (fix(web): preserve project settings during rapid saves pingdotgg/t3code#18426).
    • Mobile settings-scoped-server.test.ts, SettingsServerControlsRouteScreen.test.tsx and sentHiddenPullRequests.test.ts: 12 passed. Two clicks in the screen test now use await act(async …), because saves start on the writer's queue one microtask later; the assertions are unchanged.
    • No mobile-only writer test was added: the replanning is the shared writer's behavior, and web's test covers it at that layer.
  • Round 4 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.
  • Round 4 /code-review medium (full diff since bdeff78) found 5 Important findings:
    • Fixed: a mobile pick now chooses its copies once, and each queued save rebuilds their entries from its own starting settings. The writer's fallback to a stale planned write is therefore not reached from the overview, and a repeated pick is harmless.
    • Fixed: a hide or unhide for an environment the writer was not given now plans from the cached config, and reports the environment as failed when there is none.
    • Follow-up, pre-existing on 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 on main now that the overlay is removed.
    • Follow-up, pre-existing on web: when a replanned save has no write for its environment, createScopedSettingsWriter sends the original plan. It was moved unchanged, as asked.
  • Follow-up, pre-existing: the Pull Requests row menu and its repository-hide check still read an outdated server's decoded fallback rule, which the overview now ignores.
  • Round 5 (head bf1e2ba), the last round in the budget:
    • Codex F1 (should, a reset misses a copy that is still saving) is fixed as described above. Tests: settings-scoped-server.test.ts gains a reset case that keeps the not-yet-shown copy queued and clears it from the earlier save's response. A new packages/client-runtime/src/settingsWriter.test.ts shows 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.
    • Codex F2 and F3 (should, nit), stale acknowledgments in the writer: declined as follow-ups. The settings stream carries no ordering field (version is the event schema literal 1, and the payload is only settings), so acknowledgments cannot be retired by stream order without a protocol change. This is web's writer behavior, moved unchanged.
    • Codex F4 (nit, an offline copy with a cached policy lock says to reconnect): declined as a follow-up.
    • Codex F5 (nit): fixed (Scratch projects).
  • Round 5 vp run check:changed on 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, web scopedSettings.test.ts 32 passed, mobile settings 76 passed.
  • Round 5 /code-review medium: three passes on the final diff since bf1e2ba, because the design changed twice.
    • A per-copy save lock was tried and dropped. Each review found new ways it could stick or unlock too early: delayed echoes, stale closures, remounts and rejected saves. It was replaced by the queued replan above.
    • Fixed from the last pass: no-op requests for copies with nothing to clear.
    • Declined from the last pass: web reset missing an in-flight copy (not real, see above). Scratch detection by workspace path (the pickers check isScratch too). 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.
  • Not verified: the captures below are from 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 of main: 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: Repository feed rules lists three repositories, each on All pull requests with Default rule.

After: one repository set to Authored by me

After: pingdotgg/t3code shows Authored by me with a reset button; the other rows stay on the default rule

Model and harness: Claude Opus 5.5 via T3 Code delegated task.

🤖 Generated with Claude Code

pnupu and others added 2 commits November 19, 2026 15:06
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>
@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

claude-opus-5-5 responding on behalf of Ilkka

Automatic review of 8c1bffcc0e44.

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.

  • Why it is wrong: An older server drops pullRequestFeed, so the client decodes its settings with the default rule (packages/contracts/src/settings.ts:1580, withDecodingDefault("all")) and with no overrides. That copy always reports "All pull requests". The feed ignores these copies (ruleCounts in usePullRequestFeed.ts requires capabilities.pullRequestFeed === true), but the overview does not.
  • What the user sees: A repository set to Authored by me that also lives on an outdated server shows Differs: Authored by me on Laptop; All pull requests on OldServer. That "All pull requests" rule does not exist; the client made it up when it decoded the old server's settings. The picker shows "Differs", and no pick can clear it, because writes only reach writable copies.
  • Scope: This only happens with an outdated server that has a copy of the same repository, so it is a nit.
  • Fix: Leave out copies with access === "outdated" when computing rules, the "Default rule." check and the Differs text. Keep them in covers and in the "Update X to change it." note.

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 row.rule, and that is null on a Differs row. Fix: Skip writable copies whose current rule already equals the pick and that are not overridden, or accept this as is.

Checks:

  • Mobile row lock: It cannot get stuck. The server always emits settingsUpdated after a write (apps/server/src/serverSettings.ts, emitChange(next)). The new settings object then changes serverConfig, which changes presentationsAtom, so pending clears.
  • Discussion: There are no earlier review comments to carry over.

@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

gpt-6.2-sol responding on behalf of Ilkka

Automatic review of 8c1bffcc0e44.

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 vp and project dependencies are absent.

…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>
@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

claude-opus-5-5 responding on behalf of Ilkka

Automatic review of 96b9972f72b1.

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 rules, the "Default rule." check and the Differs text. An older server drops pullRequestFeed, so the client decodes that copy as all with no override. A repository set to "Authored by me" that also exists on an outdated server therefore shows "Differs: ... All pull requests on OldServer." No pick can clear that, because writes only reach writable copies. Fix: leave out access === "outdated" copies when working out the row rule and status text. Keep them in covers and in the "Update X to change it." note.

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 row.rule, which is null on a Differs row. Fix: skip writable copies that are not overridden and already have the picked rule, or accept this behavior.

I checked the gpt-6.2-sol review of 8c1bffc (#36 (comment)) against this head. All four findings are fixed:

  • F1: openSentFeedRules tracks each sent override separately. It closes a send on a no-op, a failed save or an offline server, and a reset across two servers waits for both.
  • F2: web now reads the write grant through useEnvironmentsWithScope, which subscribes to it.
  • F3: isManagedSettingPath(..., "pullRequestFeed") marks policy-locked copies as managed. The overview writes and the web row menu (ruleMembers via canWriteRule) skip them, and the server applies the lock to project overrides too (apps/server/src/policy/managedSettings.ts lockTargets).
  • F4: the overview now renders on the web reconnect page and in mobile's no-connection branch.

I could not run the focused Vitest suites: there is no node_modules or vp in this checkout.

@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

gpt-6.2-sol responding on behalf of Ilkka

Automatic review of 96b9972f72b1.

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 vp and project dependencies are absent.

- 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>
@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

claude-opus-5-5 responding on behalf of Ilkka

Automatic review of bdeff7838da7.

VERDICT: APPROVE

No findings.

  • Earlier findings are fixed at this head (bdeff7838d):
    • gpt-6.2-sol F1 (should): A project-scope write on mobile no longer erases a feed rule whose save hasn't shown up yet. Saves this device sent are now kept in pendingMobileSettingsWritesAtom. ServerSettingsDetail (apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx:195) and the overview (PullRequestFeedRulesSection.tsx:72,93) build their plans from cached settings with withPendingMobileSettingsWrites applied on top. useSettingsWriter drops a save once a push since it was sent has reached the cache, or when the save fails without being interrupted.
    • claude F1 / gpt F3 (nit): Outdated copies no longer count toward the row rule, "Default rule." or the Differs text (packages/client-runtime/src/pullRequestFeed.ts:348-351). They still appear in covers and in the "Update X to change it." note.
    • claude F2 / gpt F4 (nit): A pick no longer pins a rule a copy already inherits. pullRequestFeedRuleTargets skips writable copies already on the picked rule. Both the web overview (setRowRule) and the mobile overview use it, and the web row menu filters changed the same way (apps/web/src/components/pullRequest/usePullRequestFeed.ts:253-258).
  • gpt-6.2-sol F2 (nit) no longer applies. It said a delayed, unrelated settings push could unlock the picker early. The server emits settingsUpdated while it still holds the write lock, before it replies (apps/server/src/serverSettings.ts:1257). So any push after the reply comes from a later write that already contains this rule. openSentFeedRules treating "any update after the reply" as an answer is therefore sound.
  • Other checks:
    • Reset on web goes through planProjectOverridesClear, which merges several projects on the same environment into one patch.
    • On the reconnect page, the overview uses SettingsRow children with serverScoped off, so the unavailable or inert gating doesn't hide it.
    • The mobile screen test only gains mocks for the new atom, registry and section; no assertions were weakened.
  • Not run: I couldn't run the focused Vitest suites because this checkout has no node_modules or vp.

@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

gpt-6.2-sol responding on behalf of Ilkka

Automatic review of bdeff7838da7.

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. git diff --check passed. The Vitest suites could not run because vp and project dependencies are absent.

…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>
@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

claude-opus-5-5 responding on behalf of Ilkka

Automatic review of bf1e2bafd602.

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, pullRequestFeedRuleTargets still sees that copy as all, skips it, and the copy stays Hidden. The same applies to Use the default rule: canReset and overridden still read the old state, so the reset is either not offered or skips the copy. The row does show the real rule once the push arrives, and web is not affected because applyPendingScopedWrites feeds its rows. Fix: choose the copies inside the plan callback from current, using each environment's current pullRequestFeedRule and override, so they come from the writer's newest settings. Alternatively, hold the row disabled until the save returns.

Earlier review findings, checked against this head (bf1e2ba):

  • gpt-6.2-sol F1 (should), rounds 2 and 3 (round 3): a stale project-scope write erasing a feed rule. Fixed. All mobile saves go through one createScopedSettingsWriter per registry (apps/mobile/src/features/settings/useSettingsWriter.ts:18-35). ServerSettingsDetail, the overview and hide/unhide share it, and each save is re-planned from the previous save's response through the (current) => ... planners. Mobile settings objects keep the same identity between server pushes (createEnvironmentServerConfigsAtom keeps the previous map), so the writer can tell its own echo from newer settings.
  • gpt-6.2-sol F5 / claude F1 (nit): an outdated server's fallback counting as a rule. Fixed. rule is null whenever capable is false, online or offline (packages/client-runtime/src/pullRequestFeed.ts:338-342). A row with no known rule shows Unavailable, and a test covers the offline and all-outdated cases.
  • gpt-6.2-sol F2, F3, F4 (nit): these were about sentFeedRules, the batch lock and the interrupted-save overlay. They no longer apply because that code was deleted. F1 above is the gap that deleting it leaves.
  • claude F2 / gpt F4 (nit): pinning an inherited rule. Still fixed through pullRequestFeedRuleTargets and the web row menu's changed filter.

Other checks:

  • Writer move: the writer in packages/client-runtime/src/settingsWriter.ts matches the code removed from apps/web/src/components/settings/scopedSettings.ts, apart from the new Environment type parameter. Web re-exports it, and apps/web/src/components/settings/scopedSettings.test.ts still imports it.
  • Mobile test: SettingsServerControlsRouteScreen.test.tsx only gains mocks and switches to async act for the writer's microtask. The toHaveBeenCalledOnce checks are unchanged, so nothing was weakened.
  • Settings search: the environment-defaults scope accepts both all and environment, which matches where the row renders.

I could not run the Vitest suites: this checkout has no node_modules and no vp.

@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

gpt-6.2-sol responding on behalf of Ilkka

Automatic review of bf1e2bafd602.

VERDICT: CHANGES

F1 [should] apps/mobile/src/features/settings/components/PullRequestFeedRulesSection.tsx:69 Resetting a two-server repository after the first server reports Hidden clears only that copy. The slower copy stays hidden because the reset chooses its targets from the partially updated row. Carried over after the row lock was removed. Fix: Keep the row pending until every affected copy settles, or include pending saves when choosing reset targets. Prior F1

F2 [should] packages/client-runtime/src/settingsWriter.ts:130 After mobile saves Authored by me and then Hidden, a fresh update from another client that restores Authored by me matches an old response. The next mobile project edit silently restores Hidden, even when both earlier saves have fully settled. Fix: Use update ordering to identify delayed echoes and retire them once the settings stream catches up.

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 git diff --check passed. The Vitest suites were unavailable because vp and project dependencies were absent.

… 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>
@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

claude-opus-5-5 responding on behalf of Ilkka

Automatic review of f2a2d0751002.

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: planMobileFeedRuleReset now plans every writable copy's environment, and each save is replanned when it starts. The pick half still applies. pullRequestFeedRuleTargets(row, picked) picks the copies from the cached row, and the writer only replans each copy's contents. Example: a copy inherits "All pull requests" and the user picks Hidden. If they pick "All pull requests" again before the server pushes the first save back, the cached row still shows that copy on all, so the second pick skips it and the copy stays Hidden. In the same window, "Use the default rule" is hidden because row.canReset still reads the old row. The window is short, because the server pushes before it replies. Fix: choose pick targets inside the plan callback from current, as the reset now does, or disable the row until its save returns.

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. isOwnEcho treats any copy whose value equals one of the last 8 responses as a delayed echo of this client's own save. Example: mobile saves Authored, then Hidden. Another client then sets the rule back to Authored, so its push equals the first response. The next mobile project edit plans from the Hidden response and quietly writes Hidden again. This logic moved unchanged from web, but this PR now routes every mobile save through it. I kept it a nit because it is a rare case in code that predates the PR. Fix: tell delayed echoes apart by update order, such as a settings revision, instead of by value equality.

F3 [nit] packages/client-runtime/src/pullRequestFeed.ts:306 Carried over from gpt-6.2-sol F4 on bf1e2ba (same link). It is unchanged. pullRequestFeedRuleAccess checks connected before the managed-policy lock. So an offline copy with a cached pullRequestFeed lock says "Connect X to change it.", even though the policy will still block the change after reconnecting. Fix: check isManagedSettingPath before the disconnected case, using the cached managedPolicy.

Other earlier findings, checked at this head (f2a2d07):

  • gpt-6.2-sol F1 [should] on bf1e2ba (reset missed the slower copy): fixed. A reset now targets every writable copy. Waiting environments get an empty patch, which is replanned from the earlier save's response when its turn comes. The writer sends nothing if that patch is still empty.
  • gpt-6.2-sol F5 (Scratch projects): fixed. pullRequestFeedRuleRows skips isScratch projects, and both clients pass project objects that carry that field.
  • New empty-patch skip in the writer: this does not strand web's pending overlay, even though settle only runs inside persistServer. Web plans never produce an empty server patch: projectOverrideWrites always sets projectSettingsOverrides, and a scoped patch with no server keys produces no writes.

I could not run the Vitest suites because this checkout has no node_modules and no vp.

@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

gpt-6.2-sol responding on behalf of Ilkka

Automatic review of f2a2d0751002.

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 git diff --check passed. The Vitest suites were unavailable because vp and project dependencies were absent.

@pnupu

pnupu commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Note

claude-opus-5-5 responding on behalf of Ilkka

Merging f2a2d07 after round 5, the last review round, by Ilkka's decision.

  • Codex F1 (settings writer mistakes another client's fresh update for a delayed echo): dismissed as a follow-up. The writer moved unchanged from web, which has this behavior today, and the settings stream has no ordering field (version is the schema literal 1), so a correct fix needs a settings revision in the protocol. The claude reviewer rated it a nit.
  • Codex F2–F5 and claude F1–F3: nits, listed as follow-ups in the PR description.
  • Main moved since the branch point; the only overlapping file, settingsSearch.ts, merges cleanly (two independent search entries).

@pnupu
pnupu merged commit 5b1a1c8 into main Nov 19, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant