From 76c8fc331b2d40f1130edfef162eeb2ed07e2f57 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Wed, 9 Sep 2026 15:37:57 -0400 Subject: [PATCH] fix mobile task detail projections and list types Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- .../tasks/github-task-detail-projection.ts | 19 ++++++++++++++----- .../src/tasks/host-task-provider-payloads.ts | 4 ++-- ...use-mobile-tasks-provider-load-actions.tsx | 4 +--- .../use-mobile-tasks-task-list-loading.tsx | 4 +--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/mobile/src/tasks/github-task-detail-projection.ts b/mobile/src/tasks/github-task-detail-projection.ts index e7b97ce5862..f26c2c554dc 100644 --- a/mobile/src/tasks/github-task-detail-projection.ts +++ b/mobile/src/tasks/github-task-detail-projection.ts @@ -1,7 +1,16 @@ import type { HostTaskGitHubDetail } from './host-task-provider-payloads' import type { GitHubAssignableUser } from './mobile-tasks-provider-detail-types' -type GitHubRawDetails = Partial & { +type GitHubRawDetails = { + body?: string + comments?: HostTaskGitHubDetail['comments'] + assignees?: string[] + headSha?: string + baseSha?: string + pullRequestId?: string + checks?: HostTaskGitHubDetail['checks'] + files?: HostTaskGitHubDetail['files'] + item?: { labels?: string[] reviewDecision?: string | null @@ -18,11 +27,11 @@ export function projectGitHubTaskDetail(value: unknown): HostTaskGitHubDetail { return { body: details.body ?? '', comments: details.comments ?? [], - labels: details.item?.labels ?? details.labels, + labels: details.item?.labels, assignees: details.assignees ?? [], - reviewDecision: details.item?.reviewDecision ?? details.reviewDecision, - reviewRequests: details.item?.reviewRequests ?? details.reviewRequests, - latestReviews: details.item?.latestReviews ?? details.latestReviews, + reviewDecision: details.item?.reviewDecision, + reviewRequests: details.item?.reviewRequests, + latestReviews: details.item?.latestReviews, headSha: details.headSha, baseSha: details.baseSha, pullRequestId: details.pullRequestId, diff --git a/mobile/src/tasks/host-task-provider-payloads.ts b/mobile/src/tasks/host-task-provider-payloads.ts index a22e3ee2b9f..13e5e9614a9 100644 --- a/mobile/src/tasks/host-task-provider-payloads.ts +++ b/mobile/src/tasks/host-task-provider-payloads.ts @@ -66,7 +66,7 @@ export type HostTaskGitHubListPayload = { } export type HostTaskGitHubListResult = { - items: GitHubWorkItem[] + items: Array> sources?: GitHubRepoSources errors?: { issues?: { message: string } } issueSourceFellBack?: true @@ -86,7 +86,7 @@ export type HostTaskGitLabListPayload = { } export type HostTaskGitLabListResult = { - items: GitLabWorkItem[] + items: Array> error?: { type?: string; message: string } } diff --git a/mobile/src/tasks/use-mobile-tasks-provider-load-actions.tsx b/mobile/src/tasks/use-mobile-tasks-provider-load-actions.tsx index 46c6b6ad95e..0ba46d01ac1 100644 --- a/mobile/src/tasks/use-mobile-tasks-provider-load-actions.tsx +++ b/mobile/src/tasks/use-mobile-tasks-provider-load-actions.tsx @@ -103,9 +103,7 @@ export function useMobileTasksProviderLoadActions(model: RuntimeHydrationModel) before }) return { - items: envelope.items.map((item) => - createGitHubTask(repo, item as Omit) - ), + items: envelope.items.map((item) => createGitHubTask(repo, item)), sources: envelope.sources, sourceError: extractGitHubIssueSourceError(repo, envelope), sourceFallback: extractGitHubIssueSourceFallback(repo, envelope), diff --git a/mobile/src/tasks/use-mobile-tasks-task-list-loading.tsx b/mobile/src/tasks/use-mobile-tasks-task-list-loading.tsx index 5c54e2da32d..449b50c799c 100644 --- a/mobile/src/tasks/use-mobile-tasks-task-list-loading.tsx +++ b/mobile/src/tasks/use-mobile-tasks-task-list-loading.tsx @@ -170,9 +170,7 @@ export function useMobileTasksTaskListLoading(model: ProviderLoadActionsModel) { return { items: [], error: envelope.error.message } } return { - items: envelope.items.map((item) => - createGitLabTask(repo, item as Omit) - ) + items: envelope.items.map((item) => createGitLabTask(repo, item)) } } catch (err) { console.warn(`[mobile tasks] failed to fetch ${provider} work items`, repo.id, err)