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
This commit is contained in:
Jinwoo-H
2026-09-17 01:01:50 -04:00
parent 3a53958537
commit 75c568c244
2 changed files with 6 additions and 8 deletions
@@ -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)
})
)
@@ -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)
})
)