mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
* Fix mobile source control drawer overflow and branch-compare state loss - Render BottomDrawer in a native Modal so it covers the full viewport even when mounted inside a ScrollView. - Move the conflict/Abort row onto its own line so it never overflows the branch card, and enlarge the Abort hit target. - Show the committed-on-branch footer even when the changed-files SectionList has no sections, since RN skips ListFooterComponent for empty sections. - Stop branch-compare state from collapsing to idle/error on transient base-ref resolution failures when a ready result should be preserved. * Add mobile source control drawer reload screenshot Attaches an evidence screenshot for the mobile source control drawer overflow / branch-compare state loss fix. * Remove stray temp screenshot file Accidentally committed debug artifact from mobile source control drawer work; not needed in the repo.
84 lines
3.2 KiB
TypeScript
84 lines
3.2 KiB
TypeScript
import { Pressable, Text, View } from 'react-native'
|
|
import { GitBranch } from 'lucide-react-native'
|
|
import { colors } from '../theme/mobile-theme'
|
|
import { styles } from './mobile-source-control-styles'
|
|
import { MobileSourceControlPrChip } from './MobileSourceControlPrChip'
|
|
import type { MobilePrChipSummary } from './mobile-pr-chip-summary'
|
|
import { mobileConflictAbortLabel } from './mobile-source-control-conflict-abort'
|
|
|
|
type Props = {
|
|
branchLabel: string
|
|
syncLabel: string | null
|
|
unstagedCount: number
|
|
stagedCount: number
|
|
branchCount: number
|
|
conflictOperation: string | null
|
|
// True while any serial git IO is in flight — disables Abort so ops don't race.
|
|
conflictBusy: boolean
|
|
// True only while abort-merge / abort-rebase itself is running (label accuracy).
|
|
conflictAborting: boolean
|
|
onAbortConflict: (operation: string) => void
|
|
// The PR chip is shown only on repos with a hosted-review remote; null hides it.
|
|
prChip: MobilePrChipSummary | null
|
|
onOpenPr: () => void
|
|
}
|
|
|
|
// Persistent card at the top of every hub segment: branch identity, sync/counts,
|
|
// conflict state, and the PR chip. Shared so PR/History see the same status the
|
|
// Changes lens does without re-deriving it.
|
|
export function MobileSourceControlBranchCard({
|
|
branchLabel,
|
|
syncLabel,
|
|
unstagedCount,
|
|
stagedCount,
|
|
branchCount,
|
|
conflictOperation,
|
|
conflictBusy,
|
|
conflictAborting,
|
|
onAbortConflict,
|
|
prChip,
|
|
onOpenPr
|
|
}: Props) {
|
|
const showConflict = conflictOperation !== null && conflictOperation !== 'unknown'
|
|
return (
|
|
<View style={styles.summaryCard}>
|
|
<View style={styles.summaryHeader}>
|
|
<View style={styles.branchLine}>
|
|
<GitBranch size={15} color={colors.textSecondary} strokeWidth={2.1} />
|
|
<Text style={styles.branchText} numberOfLines={1}>
|
|
{branchLabel}
|
|
</Text>
|
|
</View>
|
|
{syncLabel ? <Text style={styles.syncText}>{syncLabel}</Text> : null}
|
|
</View>
|
|
<View style={styles.countRow}>
|
|
<Text style={styles.countText}>{unstagedCount} changed</Text>
|
|
<Text style={styles.countText}>{stagedCount} staged</Text>
|
|
{branchCount > 0 ? <Text style={styles.countText}>{branchCount} on branch</Text> : null}
|
|
</View>
|
|
{/* Own row so Abort never overflows past the card when counts are long. */}
|
|
{showConflict ? (
|
|
<View style={styles.conflictRow}>
|
|
<Text style={styles.conflictText}>{conflictOperation}</Text>
|
|
{conflictOperation === 'merge' || conflictOperation === 'rebase' ? (
|
|
<Pressable
|
|
style={({ pressed }) => [
|
|
styles.abortButton,
|
|
conflictBusy && styles.abortButtonDisabled,
|
|
pressed && !conflictBusy && styles.abortPressed
|
|
]}
|
|
disabled={conflictBusy}
|
|
onPress={() => onAbortConflict(conflictOperation)}
|
|
>
|
|
<Text style={styles.abortText}>
|
|
{mobileConflictAbortLabel(conflictOperation, conflictAborting)}
|
|
</Text>
|
|
</Pressable>
|
|
) : null}
|
|
</View>
|
|
) : null}
|
|
{prChip ? <MobileSourceControlPrChip summary={prChip} onPress={onOpenPr} /> : null}
|
|
</View>
|
|
)
|
|
}
|