mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 00:02:29 +00:00
* fix: make PR unlink hide auto-detected reviews * Type the empty-content test double against the real model The literal narrowed suppressedGitHubPR to number and typed the callback as Mock, so neither direction was comparable and tsconfig.tc.web.json failed on TS2352. Keeping the 'as' cast preserves checking of the fields the double does supply. * Add localization keys for the unlinked checks-panel state The unlinked title, relink action, and the remote-runtime upgrade notice introduced untranslated keys that static analysis requires in en.json. * Advertise PR suppression capability in the transport test The client capability list is pinned by websocket-transport.test.ts, and adding WORKTREE_GITHUB_PR_SUPPRESSION left the expected list stale. * Fix stale PR suppression in Checks * fix: harden PR unlink suppression state * refactor: extract PR unlink state handling * fix: show PR relink recovery in source control * fix: add unlinked PR localization * Clarify workspace-scoped PR unlinking --------- Co-authored-by: Merge Sim <sim@local>
20 lines
621 B
TypeScript
20 lines
621 B
TypeScript
import type { Worktree } from './types'
|
|
import type { WorktreeMeta } from './meta-types'
|
|
|
|
type GitHubPRSuppressionMetadata = Pick<Worktree, 'linkedPR' | 'suppressedGitHubPR'>
|
|
|
|
export function isGitHubPRSuppressed(
|
|
{ linkedPR, suppressedGitHubPR }: GitHubPRSuppressionMetadata,
|
|
prNumber: number
|
|
): boolean {
|
|
return linkedPR === null && suppressedGitHubPR === prNumber
|
|
}
|
|
|
|
export function normalizeGitHubPRSuppressionUpdate(
|
|
updates: Partial<WorktreeMeta>
|
|
): Partial<WorktreeMeta> {
|
|
return typeof updates.linkedPR === 'number' && updates.linkedPR > 0
|
|
? { ...updates, suppressedGitHubPR: null }
|
|
: updates
|
|
}
|