+36
![github-actions[bot]](/assets/img/avatar_default.png)








Julius Marminge
maria-rcks
Bilal Bakr
shivam
Vitalii Yehorov
Jake Leventhal
Claude Opus 5
Alex Southwell
github-actions[bot]
Nicholas Wasmiller
PB
Exotic
Yash Singh
Devin
Theo Browne
Gabriel De Andrade
Dara Adedeji
scratchyone
Dominic Roy
chukfinley
Primož Ajdišek
benthecarman
NaveDanan
aaditagrawal
Aditya Garud
Nick Anisimov
MacKinley Smith
Yordis Prieto
t3-code[bot]
AKolenda
Guillermo Casanova
Otavio Salvador
Shirish Pothi
Ishaan Kothari
Bob Fowler
Anton Bezdenezhnykh
ValeraZSD
Ephraim
Ryan Ilano
Alex
maco
Cursor
Tristan Knight
PR Batch Tester
oliver
kamkm
de34391427
Co-authored-by: maria-rcks <[email protected]> Co-authored-by: Bilal Bakr <[email protected]> Co-authored-by: shivam <[email protected]> Co-authored-by: Vitalii Yehorov <[email protected]> Co-authored-by: Jake Leventhal <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Alex Southwell <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nicholas Wasmiller <[email protected]> Co-authored-by: PB <[email protected]> Co-authored-by: Exotic <[email protected]> Co-authored-by: Yash Singh <[email protected]> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Theo Browne <[email protected]> Co-authored-by: Gabriel De Andrade <[email protected]> Co-authored-by: Dara Adedeji <[email protected]> Co-authored-by: scratchyone <[email protected]> Co-authored-by: Dominic Roy <[email protected]> Co-authored-by: chukfinley <[email protected]> Co-authored-by: Primož Ajdišek <[email protected]> Co-authored-by: benthecarman <[email protected]> Co-authored-by: NaveDanan <[email protected]> Co-authored-by: aaditagrawal <[email protected]> Co-authored-by: Aditya Garud <[email protected]> Co-authored-by: Nick Anisimov <[email protected]> Co-authored-by: MacKinley Smith <[email protected]> Co-authored-by: Yordis Prieto <[email protected]> Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: AKolenda <[email protected]> Co-authored-by: Guillermo Casanova <[email protected]> Co-authored-by: Otavio Salvador <[email protected]> Co-authored-by: Shirish Pothi <[email protected]> Co-authored-by: Ishaan Kothari <[email protected]> Co-authored-by: Bob Fowler <[email protected]> Co-authored-by: Anton Bezdenezhnykh <[email protected]> Co-authored-by: ValeraZSD <[email protected]> Co-authored-by: Ephraim <[email protected]> Co-authored-by: Ryan Ilano <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: maco <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Tristan Knight <[email protected]> Co-authored-by: PR Batch Tester <[email protected]> Co-authored-by: oliver <[email protected]> Co-authored-by: kamkm <[email protected]> Signed-off-by: Yordis Prieto <[email protected]>
574 lines
19 KiB
TypeScript
574 lines
19 KiB
TypeScript
import { createNativeHeaderMenu } from "../../components/nativeHeaderMenu.ios";
|
|
import type { ScreenHeaderMenu } from "../../components/ScreenHeader.types";
|
|
import {
|
|
EnvironmentId,
|
|
type GitRunStackedActionResult,
|
|
type ProjectScript,
|
|
ThreadId,
|
|
type VcsStatusResult,
|
|
} from "@t3tools/contracts";
|
|
import {
|
|
type GitActionRequestInput,
|
|
requiresDefaultBranchConfirmation,
|
|
resolveQuickAction,
|
|
} from "@t3tools/client-runtime/state/vcs";
|
|
import { useNavigation } from "@react-navigation/native";
|
|
import { NativeHeaderToolbar } from "../../native/StackHeader";
|
|
import { useCallback, useMemo } from "react";
|
|
import { Alert } from "react-native";
|
|
import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
|
|
import {
|
|
basename,
|
|
getTerminalStatusLabel,
|
|
projectScriptMenuIcon,
|
|
projectScriptMenuLabel,
|
|
type TerminalMenuSession,
|
|
} from "../terminal/terminalMenu";
|
|
|
|
function truncateMiddle(value: string, maxLength: number): string {
|
|
if (value.length <= maxLength) {
|
|
return value;
|
|
}
|
|
|
|
const headLength = Math.ceil((maxLength - 1) / 2);
|
|
const tailLength = Math.floor((maxLength - 1) / 2);
|
|
return `${value.slice(0, headLength)}…${value.slice(value.length - tailLength)}`;
|
|
}
|
|
|
|
function compactMenuBranchLabel(branch: string): string {
|
|
return truncateMiddle(branch, 24);
|
|
}
|
|
|
|
function compactMenuStatus(gitStatus: VcsStatusResult | null): string {
|
|
if (!gitStatus) {
|
|
return "Checking status";
|
|
}
|
|
if (!gitStatus.isRepo) {
|
|
return "Not a repo";
|
|
}
|
|
|
|
const parts: string[] = [];
|
|
if (gitStatus.hasWorkingTreeChanges) {
|
|
parts.push(`${gitStatus.workingTree.files.length} changed`);
|
|
} else if (gitStatus.aheadCount === 0 && gitStatus.behindCount === 0) {
|
|
parts.push("Clean");
|
|
}
|
|
if (gitStatus.aheadCount > 0) {
|
|
parts.push(`${gitStatus.aheadCount} ahead`);
|
|
}
|
|
if (gitStatus.behindCount > 0) {
|
|
parts.push(`${gitStatus.behindCount} behind`);
|
|
}
|
|
if (gitStatus.pr?.state === "open") {
|
|
parts.push(`PR #${gitStatus.pr.number}`);
|
|
}
|
|
|
|
return parts.join(" · ");
|
|
}
|
|
|
|
type HeaderItem = Record<string, unknown>;
|
|
type HeaderItems = HeaderItem[];
|
|
type ThreadGitHeaderActionItems = {
|
|
readonly terminal: HeaderItem;
|
|
readonly files: HeaderItem;
|
|
readonly git: HeaderItem;
|
|
};
|
|
type QuickActionIcon =
|
|
| "arrow.down.circle"
|
|
| "arrow.up.right.circle"
|
|
| "checkmark.circle"
|
|
| "arrow.up.circle";
|
|
|
|
/** The subset of git-control wiring the standalone git menu needs. */
|
|
export type ThreadGitMenuProps = {
|
|
readonly environmentId: EnvironmentId | string;
|
|
readonly threadId: ThreadId | string;
|
|
readonly currentBranch: string | null;
|
|
readonly gitStatus: VcsStatusResult | null;
|
|
readonly gitOperationLabel: string | null;
|
|
readonly onOpenFilesInspector?: () => void;
|
|
readonly onOpenGitInspector?: () => void;
|
|
/** Present only on a thread whose work can be merged into the one it came from. */
|
|
readonly onMergeBack?: () => void;
|
|
readonly onPull: () => Promise<void>;
|
|
readonly onRunAction: (input: GitActionRequestInput) => Promise<GitRunStackedActionResult | null>;
|
|
};
|
|
|
|
type ThreadGitControlsProps = ThreadGitMenuProps & {
|
|
readonly auxiliaryPaneControl?: {
|
|
readonly accessibilityLabel: string;
|
|
readonly onPress: () => void;
|
|
};
|
|
readonly canOpenTerminal: boolean;
|
|
readonly canOpenFiles: boolean;
|
|
readonly projectScripts: ReadonlyArray<ProjectScript>;
|
|
readonly terminalSessions: ReadonlyArray<TerminalMenuSession>;
|
|
readonly showActionControls?: boolean;
|
|
readonly showDirectFileControl?: boolean;
|
|
readonly onOpenTerminal: (terminalId?: string | null) => void;
|
|
readonly onOpenNewTerminal: () => void;
|
|
readonly onRunProjectScript: (script: ProjectScript) => Promise<void>;
|
|
};
|
|
|
|
function useThreadGitControlModel(props: ThreadGitMenuProps) {
|
|
const navigation = useNavigation();
|
|
const environmentId = props.environmentId;
|
|
const threadId = props.threadId;
|
|
const { gitStatus, gitOperationLabel, onPull, onRunAction } = props;
|
|
|
|
const currentBranchLabel = gitStatus?.refName ?? props.currentBranch ?? "Detached HEAD";
|
|
const busy = gitOperationLabel !== null;
|
|
const isRepo = gitStatus?.isRepo ?? true;
|
|
const hasPrimaryRemote = gitStatus?.hasPrimaryRemote ?? false;
|
|
const isDefaultRef = gitStatus?.isDefaultRef ?? false;
|
|
|
|
const quickAction = useMemo(
|
|
() =>
|
|
isRepo
|
|
? resolveQuickAction(gitStatus, busy, isDefaultRef, hasPrimaryRemote)
|
|
: {
|
|
label: "Git unavailable",
|
|
disabled: true,
|
|
kind: "show_hint" as const,
|
|
hint: "This workspace is not a git repository.",
|
|
},
|
|
[busy, gitStatus, hasPrimaryRemote, isDefaultRef, isRepo],
|
|
);
|
|
|
|
const quickActionHint = quickAction.disabled
|
|
? (quickAction.hint ?? "This action is unavailable.")
|
|
: null;
|
|
|
|
const quickActionIcon: QuickActionIcon = (() => {
|
|
if (quickAction.kind === "run_pull") return "arrow.down.circle";
|
|
if (quickAction.kind === "open_pr") return "arrow.up.right.circle";
|
|
if (quickAction.kind === "run_action") {
|
|
if (quickAction.action === "commit") return "checkmark.circle";
|
|
if (quickAction.action === "push" || quickAction.action === "commit_push")
|
|
return "arrow.up.circle";
|
|
}
|
|
return "arrow.up.right.circle";
|
|
})();
|
|
|
|
const openExistingPr = useCallback(async () => {
|
|
const prUrl = gitStatus?.pr?.state === "open" ? gitStatus.pr.url : null;
|
|
if (!prUrl) {
|
|
Alert.alert("No open PR", "This branch does not have an open pull request.");
|
|
return;
|
|
}
|
|
if (!(await tryOpenExternalUrl(prUrl, "pull-request"))) {
|
|
Alert.alert("Unable to open PR", "The pull request could not be opened.");
|
|
}
|
|
}, [gitStatus]);
|
|
|
|
const runActionWithPrompt = useCallback(
|
|
async (input: GitActionRequestInput) => {
|
|
const confirmableAction =
|
|
input.action === "push" ||
|
|
input.action === "create_pr" ||
|
|
input.action === "commit_push" ||
|
|
input.action === "commit_push_pr"
|
|
? input.action
|
|
: null;
|
|
const branchName = gitStatus?.refName;
|
|
if (
|
|
branchName &&
|
|
confirmableAction &&
|
|
!input.featureBranch &&
|
|
requiresDefaultBranchConfirmation(input.action, isDefaultRef)
|
|
) {
|
|
navigation.navigate("GitConfirm", {
|
|
environmentId: String(environmentId),
|
|
threadId: String(threadId),
|
|
confirmAction: confirmableAction,
|
|
branchName,
|
|
includesCommit: String(
|
|
input.action === "commit_push" || input.action === "commit_push_pr",
|
|
),
|
|
});
|
|
return;
|
|
}
|
|
|
|
await onRunAction(input);
|
|
},
|
|
[environmentId, gitStatus, isDefaultRef, onRunAction, navigation, threadId],
|
|
);
|
|
|
|
const runQuickAction = useCallback(async () => {
|
|
if (quickAction.kind === "open_pr") {
|
|
await openExistingPr();
|
|
return;
|
|
}
|
|
if (quickAction.kind === "run_pull") {
|
|
await onPull();
|
|
return;
|
|
}
|
|
if (quickAction.kind === "run_action" && quickAction.action) {
|
|
await runActionWithPrompt({ action: quickAction.action });
|
|
}
|
|
}, [onPull, openExistingPr, quickAction, runActionWithPrompt]);
|
|
|
|
const openFiles = useCallback(() => {
|
|
if (props.onOpenFilesInspector) {
|
|
props.onOpenFilesInspector();
|
|
return;
|
|
}
|
|
navigation.navigate("ThreadFiles", {
|
|
environmentId: String(environmentId),
|
|
threadId: String(threadId),
|
|
});
|
|
}, [environmentId, props.onOpenFilesInspector, navigation, threadId]);
|
|
|
|
const openReview = useCallback(() => {
|
|
navigation.navigate("ThreadReview", {
|
|
environmentId: EnvironmentId.make(String(environmentId)),
|
|
threadId: ThreadId.make(String(threadId)),
|
|
});
|
|
}, [environmentId, navigation, threadId]);
|
|
|
|
const openGitInspector = useCallback(() => {
|
|
if (props.onOpenGitInspector) {
|
|
props.onOpenGitInspector();
|
|
return;
|
|
}
|
|
navigation.navigate("GitOverview", {
|
|
environmentId: String(environmentId),
|
|
threadId: String(threadId),
|
|
});
|
|
}, [environmentId, props.onOpenGitInspector, navigation, threadId]);
|
|
|
|
return {
|
|
currentBranchLabel,
|
|
isRepo,
|
|
openFiles,
|
|
openGitInspector,
|
|
openReview,
|
|
quickAction,
|
|
quickActionHint,
|
|
quickActionIcon,
|
|
runQuickAction,
|
|
};
|
|
}
|
|
|
|
function useThreadGitHeaderActionItems(props: ThreadGitControlsProps): ThreadGitHeaderActionItems {
|
|
const model = useThreadGitControlModel(props);
|
|
|
|
return useMemo(
|
|
() => ({
|
|
terminal: {
|
|
accessibilityLabel: "Open terminal",
|
|
disabled: !props.canOpenTerminal,
|
|
icon: { name: "terminal", type: "sfSymbol" },
|
|
identifier: "thread-right-terminal",
|
|
label: "Terminal",
|
|
menu: {
|
|
items: [
|
|
...props.projectScripts.map((script) => ({
|
|
description: script.command,
|
|
icon: { name: projectScriptMenuIcon(script.icon), type: "sfSymbol" as const },
|
|
label: projectScriptMenuLabel(script),
|
|
onPress: () => void props.onRunProjectScript(script),
|
|
type: "action" as const,
|
|
})),
|
|
...(props.projectScripts.length === 0
|
|
? [
|
|
{
|
|
description: "This project has no saved scripts yet",
|
|
disabled: true,
|
|
icon: { name: "play", type: "sfSymbol" as const },
|
|
label: "No project scripts",
|
|
onPress: () => {},
|
|
type: "action" as const,
|
|
},
|
|
]
|
|
: []),
|
|
...props.terminalSessions.map((session) => ({
|
|
description: [
|
|
getTerminalStatusLabel({
|
|
status: session.status,
|
|
hasRunningSubprocess: session.hasRunningSubprocess,
|
|
}),
|
|
basename(session.cwd),
|
|
]
|
|
.filter(Boolean)
|
|
.join(" · "),
|
|
icon: { name: "terminal", type: "sfSymbol" as const },
|
|
label: session.displayLabel,
|
|
onPress: () => props.onOpenTerminal(session.terminalId),
|
|
type: "action" as const,
|
|
})),
|
|
{
|
|
description: "Start another shell for this thread",
|
|
icon: { name: "plus", type: "sfSymbol" },
|
|
label: "Open new terminal",
|
|
onPress: props.onOpenNewTerminal,
|
|
type: "action",
|
|
},
|
|
],
|
|
title: "Terminal",
|
|
},
|
|
sharesBackground: true,
|
|
type: "menu",
|
|
variant: "plain",
|
|
},
|
|
files: {
|
|
accessibilityLabel: "Open files",
|
|
disabled: !props.canOpenFiles,
|
|
icon: { name: "folder", type: "sfSymbol" },
|
|
identifier: "thread-right-files",
|
|
label: "Files",
|
|
onPress: model.openFiles,
|
|
sharesBackground: true,
|
|
type: "button",
|
|
variant: "plain",
|
|
},
|
|
git: {
|
|
accessibilityLabel: "Git actions",
|
|
icon: { name: "point.topleft.down.curvedto.point.bottomright.up", type: "sfSymbol" },
|
|
identifier: "thread-right-git",
|
|
label: "Git",
|
|
menu: {
|
|
items: [
|
|
{
|
|
description: compactMenuStatus(props.gitStatus),
|
|
disabled: true,
|
|
icon: {
|
|
name: "point.topleft.down.curvedto.point.bottomright.up",
|
|
type: "sfSymbol",
|
|
},
|
|
label: compactMenuBranchLabel(model.currentBranchLabel),
|
|
onPress: (): void => {},
|
|
type: "action",
|
|
},
|
|
{
|
|
description: model.quickActionHint ?? undefined,
|
|
disabled: model.quickAction.disabled,
|
|
icon: { name: model.quickActionIcon, type: "sfSymbol" },
|
|
label: model.quickAction.label,
|
|
onPress: (): void => void model.runQuickAction(),
|
|
type: "action",
|
|
},
|
|
{
|
|
description: "Turn diffs and worktree changes",
|
|
disabled: !model.isRepo,
|
|
icon: { name: "text.bubble", type: "sfSymbol" },
|
|
label: "Review changes",
|
|
onPress: model.openReview,
|
|
type: "action",
|
|
},
|
|
...(props.onMergeBack
|
|
? [
|
|
{
|
|
description: "Bring this thread's latest turn into its source",
|
|
icon: { name: "arrow.triangle.merge", type: "sfSymbol" as const },
|
|
label: "Merge back to source",
|
|
onPress: props.onMergeBack,
|
|
type: "action" as const,
|
|
},
|
|
]
|
|
: []),
|
|
{
|
|
description: "Commit, files, branches",
|
|
icon: { name: "ellipsis", type: "sfSymbol" },
|
|
label: "More",
|
|
onPress: model.openGitInspector,
|
|
type: "action",
|
|
},
|
|
],
|
|
title: "Git",
|
|
},
|
|
sharesBackground: true,
|
|
type: "menu",
|
|
variant: "plain",
|
|
},
|
|
}),
|
|
[
|
|
model.currentBranchLabel,
|
|
model.isRepo,
|
|
model.openFiles,
|
|
model.openGitInspector,
|
|
model.openReview,
|
|
model.quickAction.disabled,
|
|
model.quickAction.label,
|
|
model.quickActionHint,
|
|
model.quickActionIcon,
|
|
model.runQuickAction,
|
|
props.canOpenFiles,
|
|
props.canOpenTerminal,
|
|
props.gitStatus,
|
|
props.onMergeBack,
|
|
props.onOpenNewTerminal,
|
|
props.onOpenTerminal,
|
|
props.onRunProjectScript,
|
|
props.projectScripts,
|
|
props.terminalSessions,
|
|
],
|
|
);
|
|
}
|
|
|
|
export function useThreadGitRightHeaderItems(props: ThreadGitControlsProps): HeaderItems {
|
|
const actionItems = useThreadGitHeaderActionItems(props);
|
|
return useMemo(
|
|
() => [actionItems.git, actionItems.files, actionItems.terminal] as HeaderItems,
|
|
[actionItems],
|
|
);
|
|
}
|
|
|
|
export function useThreadGitCenterHeaderItems(props: ThreadGitControlsProps): HeaderItems {
|
|
const actionItems = useThreadGitHeaderActionItems(props);
|
|
return useMemo(
|
|
() => [actionItems.files, actionItems.git, actionItems.terminal] as HeaderItems,
|
|
[actionItems],
|
|
);
|
|
}
|
|
|
|
export function ThreadGitControls(props: ThreadGitControlsProps) {
|
|
const model = useThreadGitControlModel(props);
|
|
const showActionControls = props.showActionControls ?? true;
|
|
|
|
if (!showActionControls) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<NativeHeaderToolbar placement="right">
|
|
{showActionControls && props.auxiliaryPaneControl ? (
|
|
<NativeHeaderToolbar.Button
|
|
accessibilityLabel={props.auxiliaryPaneControl.accessibilityLabel}
|
|
icon="sidebar.right"
|
|
onPress={props.auxiliaryPaneControl.onPress}
|
|
separateBackground
|
|
/>
|
|
) : null}
|
|
{showActionControls ? (
|
|
<NativeHeaderToolbar.Menu
|
|
accessibilityLabel="Open terminal"
|
|
icon="terminal"
|
|
disabled={!props.canOpenTerminal}
|
|
separateBackground
|
|
>
|
|
{props.projectScripts.length > 0 ? (
|
|
props.projectScripts.map((script) => (
|
|
<NativeHeaderToolbar.MenuAction
|
|
key={script.id}
|
|
icon={projectScriptMenuIcon(script.icon)}
|
|
onPress={() => void props.onRunProjectScript(script)}
|
|
subtitle={script.command}
|
|
>
|
|
<NativeHeaderToolbar.Label>
|
|
{projectScriptMenuLabel(script)}
|
|
</NativeHeaderToolbar.Label>
|
|
</NativeHeaderToolbar.MenuAction>
|
|
))
|
|
) : (
|
|
<NativeHeaderToolbar.MenuAction
|
|
icon="play"
|
|
disabled
|
|
onPress={() => {}}
|
|
subtitle="This project has no saved scripts yet"
|
|
>
|
|
<NativeHeaderToolbar.Label>No project scripts</NativeHeaderToolbar.Label>
|
|
</NativeHeaderToolbar.MenuAction>
|
|
)}
|
|
{props.terminalSessions.map((session) => (
|
|
<NativeHeaderToolbar.MenuAction
|
|
key={session.terminalId}
|
|
icon="terminal"
|
|
onPress={() => props.onOpenTerminal(session.terminalId)}
|
|
subtitle={[
|
|
getTerminalStatusLabel({
|
|
status: session.status,
|
|
hasRunningSubprocess: session.hasRunningSubprocess,
|
|
}),
|
|
basename(session.cwd),
|
|
]
|
|
.filter(Boolean)
|
|
.join(" · ")}
|
|
>
|
|
<NativeHeaderToolbar.Label>{session.displayLabel}</NativeHeaderToolbar.Label>
|
|
</NativeHeaderToolbar.MenuAction>
|
|
))}
|
|
<NativeHeaderToolbar.MenuAction
|
|
icon="plus"
|
|
onPress={props.onOpenNewTerminal}
|
|
subtitle="Start another shell for this thread"
|
|
>
|
|
<NativeHeaderToolbar.Label>Open new terminal</NativeHeaderToolbar.Label>
|
|
</NativeHeaderToolbar.MenuAction>
|
|
</NativeHeaderToolbar.Menu>
|
|
) : null}
|
|
{showActionControls && props.showDirectFileControl ? (
|
|
<NativeHeaderToolbar.Button
|
|
accessibilityLabel="Open files"
|
|
disabled={!props.canOpenFiles}
|
|
icon="folder"
|
|
onPress={model.openFiles}
|
|
separateBackground
|
|
/>
|
|
) : null}
|
|
{showActionControls ? createNativeHeaderMenu(threadGitMenuDefinition(props, model)) : null}
|
|
</NativeHeaderToolbar>
|
|
);
|
|
}
|
|
|
|
/**
|
|
* The standalone git actions menu (branch status, quick commit/push action,
|
|
* review, more). Rendered inside a NativeHeaderToolbar by both the thread
|
|
* chat header and the review screen's toolbar.
|
|
*/
|
|
export function ThreadGitMenu(props: ThreadGitMenuProps) {
|
|
const menu = useThreadGitMenuDefinition(props);
|
|
return menu ? createNativeHeaderMenu(menu) : null;
|
|
}
|
|
|
|
/** Returns menu data because native toolbars serialize direct items rather than rendering component children. */
|
|
export function useThreadGitMenuDefinition(props: ThreadGitMenuProps): ScreenHeaderMenu | null {
|
|
return threadGitMenuDefinition(props, useThreadGitControlModel(props));
|
|
}
|
|
|
|
function threadGitMenuDefinition(
|
|
props: ThreadGitMenuProps,
|
|
model: ReturnType<typeof useThreadGitControlModel>,
|
|
): ScreenHeaderMenu {
|
|
return {
|
|
title: "Git controls",
|
|
icon: "point.topleft.down.curvedto.point.bottomright.up",
|
|
separateBackground: false,
|
|
items: [
|
|
{
|
|
id: "git-status",
|
|
title: compactMenuBranchLabel(model.currentBranchLabel),
|
|
icon: "point.topleft.down.curvedto.point.bottomright.up",
|
|
disabled: true,
|
|
subtitle: compactMenuStatus(props.gitStatus),
|
|
onPress: () => {},
|
|
},
|
|
{
|
|
id: "git-quick-action",
|
|
title: model.quickAction.label,
|
|
icon: model.quickActionIcon,
|
|
disabled: model.quickAction.disabled,
|
|
subtitle: model.quickActionHint ?? undefined,
|
|
onPress: () => {
|
|
void model.runQuickAction();
|
|
},
|
|
},
|
|
{
|
|
id: "git-review",
|
|
title: "Review changes",
|
|
icon: "text.bubble",
|
|
disabled: !model.isRepo,
|
|
subtitle: "Turn diffs and worktree changes",
|
|
onPress: model.openReview,
|
|
},
|
|
{
|
|
id: "git-more",
|
|
title: "More",
|
|
icon: "ellipsis",
|
|
subtitle: "Commit, files, branches",
|
|
onPress: model.openGitInspector,
|
|
},
|
|
],
|
|
};
|
|
}
|