mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 23:09:47 +02:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import type { DivergedStrategy } from '@yaakapp-internal/git';
|
||||
import { useState } from 'react';
|
||||
import { showDialog } from '../../lib/dialog';
|
||||
import { Button } from '../core/Button';
|
||||
import { InlineCode } from '../core/InlineCode';
|
||||
import { RadioCards } from '../core/RadioCards';
|
||||
import { HStack } from '../core/Stacks';
|
||||
import type { DivergedStrategy } from "@yaakapp-internal/git";
|
||||
import { useState } from "react";
|
||||
import { showDialog } from "../../lib/dialog";
|
||||
import { Button } from "../core/Button";
|
||||
import { InlineCode } from "../core/InlineCode";
|
||||
import { RadioCards } from "../core/RadioCards";
|
||||
import { HStack } from "../core/Stacks";
|
||||
|
||||
type Resolution = 'force_reset' | 'merge';
|
||||
type Resolution = "force_reset" | "merge";
|
||||
|
||||
const resolutionLabel: Record<Resolution, string> = {
|
||||
force_reset: 'Force Pull',
|
||||
merge: 'Merge',
|
||||
force_reset: "Force Pull",
|
||||
merge: "Merge",
|
||||
};
|
||||
|
||||
interface DivergedDialogProps {
|
||||
@@ -30,17 +30,18 @@ function DivergedDialog({ remote, branch, onResult, onHide }: DivergedDialogProp
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
onResult('cancel');
|
||||
onResult("cancel");
|
||||
onHide();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 mb-4">
|
||||
<p className="text-text-subtle">
|
||||
Your local branch has diverged from{' '}
|
||||
Your local branch has diverged from{" "}
|
||||
<InlineCode>
|
||||
{remote}/{branch}
|
||||
</InlineCode>. How would you like to resolve this?
|
||||
</InlineCode>
|
||||
. How would you like to resolve this?
|
||||
</p>
|
||||
<RadioCards
|
||||
name="diverged-strategy"
|
||||
@@ -48,24 +49,24 @@ function DivergedDialog({ remote, branch, onResult, onHide }: DivergedDialogProp
|
||||
onChange={setSelected}
|
||||
options={[
|
||||
{
|
||||
value: 'merge',
|
||||
label: 'Merge Commit',
|
||||
description: 'Combining local and remote changes into a single merge commit',
|
||||
value: "merge",
|
||||
label: "Merge Commit",
|
||||
description: "Combining local and remote changes into a single merge commit",
|
||||
},
|
||||
{
|
||||
value: 'force_reset',
|
||||
label: 'Force Pull',
|
||||
description: 'Discard local commits and reset to match the remote branch',
|
||||
value: "force_reset",
|
||||
label: "Force Pull",
|
||||
description: "Discard local commits and reset to match the remote branch",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<HStack space={2} justifyContent="start" className="flex-row-reverse">
|
||||
<Button
|
||||
color={selected === 'force_reset' ? 'danger' : 'primary'}
|
||||
color={selected === "force_reset" ? "danger" : "primary"}
|
||||
disabled={selected == null}
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
{selected != null ? resolutionLabel[selected] : 'Select an option'}
|
||||
{selected != null ? resolutionLabel[selected] : "Select an option"}
|
||||
</Button>
|
||||
<Button variant="border" onClick={handleCancel}>
|
||||
Cancel
|
||||
@@ -84,12 +85,12 @@ export async function promptDivergedStrategy({
|
||||
}): Promise<DivergedStrategy> {
|
||||
return new Promise((resolve) => {
|
||||
showDialog({
|
||||
id: 'git-diverged',
|
||||
title: 'Branches Diverged',
|
||||
id: "git-diverged",
|
||||
title: "Branches Diverged",
|
||||
hideX: true,
|
||||
size: 'sm',
|
||||
size: "sm",
|
||||
disableBackdropClose: true,
|
||||
onClose: () => resolve('cancel'),
|
||||
onClose: () => resolve("cancel"),
|
||||
render: ({ hide }) =>
|
||||
DivergedDialog({
|
||||
remote,
|
||||
|
||||
Reference in New Issue
Block a user