From 75c568c244c8d273ae2764618f408303cd7fd9f7 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Thu, 17 Sep 2026 01:01:50 -0400 Subject: [PATCH] refactor(mobile): let each module build its own Linear team reader `linearTeamListReader` was exported from the detail-operations module only so the list-operations module could import it, which adds an operations-to-operations import edge that buys nothing: `rpcResultVariant` is a pure factory, so two calls with the same schema produce two functionally identical readers. What keeps the composer's picker and the saved-selection reconciler agreeing about a team row is that both build from `linearTeamsSchema`, which is already exported. Deleting the export also puts the composer-policy JSDoc back on `linearComposerTeamListRead`. JSDoc binds to the next declaration, so the block explaining why this method carries two operations with different acceptance policies had drifted onto the reader, leaving the operation it is about undocumented. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- mobile/src/tasks/mobile-task-item-detail-operations.ts | 10 ++++------ mobile/src/tasks/mobile-task-list-operations.ts | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mobile/src/tasks/mobile-task-item-detail-operations.ts b/mobile/src/tasks/mobile-task-item-detail-operations.ts index 2109d6a6c06..2f80e66f8e4 100644 --- a/mobile/src/tasks/mobile-task-item-detail-operations.ts +++ b/mobile/src/tasks/mobile-task-item-detail-operations.ts @@ -102,18 +102,16 @@ export const linearTeamStateListRead = bindDeferredRpcOperation( /** * The composer's Linear team list, the first of two policies on this method. The composer empties * its picker on a refusal and stays open; hydration in mobile-task-list-operations.ts cannot - * proceed without the list and surfaces the host's message. One reader serves both. + * proceed without the list and surfaces the host's message. Both build their reader from + * `linearTeamsSchema`, which is what keeps them agreeing about what a team row is; the reader + * itself is a pure factory and there is nothing to share. */ -/** Shared with hydration's leg in the list module: one team list, so the composer's picker and - * the saved-selection reconciler can never disagree about what a team row is. */ -export const linearTeamListReader = rpcResultVariant('linear-teams', linearTeamsSchema) - export const linearComposerTeamListRead = bindDeferredRpcOperation( defineRpcOperation({ name: 'linear.composer-team-list-or-skip', method: 'linear.listTeams', acceptance: 'success-result-or-skip', barrier: 'after-caller-barrier', - read: linearTeamListReader + read: rpcResultVariant('linear-teams', linearTeamsSchema) }) ) diff --git a/mobile/src/tasks/mobile-task-list-operations.ts b/mobile/src/tasks/mobile-task-list-operations.ts index dc64fe68320..97bd268f746 100644 --- a/mobile/src/tasks/mobile-task-list-operations.ts +++ b/mobile/src/tasks/mobile-task-list-operations.ts @@ -1,6 +1,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc-operation' import { rpcResultVariant } from '../transport/rpc-operation-result-reader' -import { linearTeamListReader } from './mobile-task-item-detail-operations' +import { linearTeamsSchema } from './task-item-detail-reply-schema' import { githubWorkItemCountSchema, gitlabTodoListSchema, @@ -41,7 +41,7 @@ export const linearWorkspaceTeamListRead = bindDeferredRpcOperation( method: 'linear.listTeams', acceptance: 'require-result-or-throw-message', barrier: 'after-caller-barrier', - read: linearTeamListReader + read: rpcResultVariant('linear-teams', linearTeamsSchema) }) )