mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-09 18:06:45 +08:00
* refactor(ui): add @multica/ui/icons as the single icon entry point (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * refactor: import icons from @multica/ui/icons instead of lucide-react (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * chore(lint): ban direct lucide-react imports outside @multica/ui/icons (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): draw Multica icons and enlarge primitive icon sizes (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): roomier menu and sidebar rhythm (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): mark body and detail layers in icon glyphs (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): Inter optical sizing, lighter titles, CJK leading and zh-TW font stack (MUL-8338) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): 13px for in-place reading text, regular weight for descriptive labels (MUL-8338) Issue detail timeline, comment headers, properties panel, wakeup and PR rows move from 12px to 13px; sub-issue identifiers match list/board (12px regular); sidebar group labels drop to regular weight; board card titles get more leading under a CJK UI via a new cjk: variant. Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): tint the active sidebar icon's body with a light fill (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): draw every remaining icon and drop lucide-react (MUL-8334) All 286 icon names now render Multica drawings. The drawings, their construction helpers and the generator live in packages/ui/icons/drawings; glyphs.ts and index.ts are generated and a test fails when they drift. Search loses its lens highlight and Inbox its arrow. Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * chore: guard against icon libraries and document drawing new icons (MUL-8334) Lint bans the common React icon libraries, AGENTS.md points to a new multica-icons skill, route icons must mark a body for the active tint, and comments no longer describe product icons as Lucide. Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * feat(ui): fill the active sidebar icon solid with its details knocked out (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> * fix(lint): ban icon library subpaths too (MUL-8334) Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]> --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]>
106 lines
3.2 KiB
TypeScript
106 lines
3.2 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
import { TriangleAlert } from "@multica/ui/icons";
|
|
import { Button } from "@multica/ui/components/ui/button";
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from "@multica/ui/components/ui/dialog";
|
|
import { GithubRefField, githubRefHasError } from "./github-ref-field";
|
|
import { useT } from "../../i18n/use-t";
|
|
import { githubShortLabel } from "../../common/github-url";
|
|
|
|
interface GithubRefDialogProps {
|
|
open: boolean;
|
|
onOpenChange: (open: boolean) => void;
|
|
/** Repository being configured, so the user knows which row this edits. */
|
|
url: string;
|
|
/** Current ref; empty means the repository's default branch. */
|
|
value: string;
|
|
/** Server-side rejection to show inline. */
|
|
errorMessage?: string;
|
|
saving?: boolean;
|
|
onConfirm: (ref: string) => void;
|
|
}
|
|
|
|
/**
|
|
* Sets the branch an already attached `github_repo` resource works on.
|
|
*
|
|
* A dialog rather than an inline field: unlike renaming a row, this changes
|
|
* where every future task in the project starts AND where it delivers, and
|
|
* that is worth a sentence the row has no space for. The same sentence has to
|
|
* say what it does not do — the ref is read when a task is claimed, so work
|
|
* already underway keeps the branch it started on.
|
|
*/
|
|
export function GithubRefDialog({
|
|
open,
|
|
onOpenChange,
|
|
url,
|
|
value,
|
|
errorMessage,
|
|
saving = false,
|
|
onConfirm,
|
|
}: GithubRefDialogProps) {
|
|
const { t } = useT("projects");
|
|
const [draft, setDraft] = useState(value);
|
|
|
|
// Re-sync on reopen, otherwise the previous row's ref is what shows.
|
|
useEffect(() => {
|
|
if (open) setDraft(value);
|
|
}, [open, value]);
|
|
|
|
const invalid = githubRefHasError(draft);
|
|
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
<DialogContent className="sm:max-w-md">
|
|
<DialogHeader>
|
|
<DialogTitle>{t(($) => $.resources.ref_dialog_title)}</DialogTitle>
|
|
<DialogDescription>
|
|
{t(($) => $.resources.ref_dialog_description)}
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
|
|
<div className="rounded-md bg-muted px-2.5 py-1.5 font-mono text-micro text-muted-foreground break-all">
|
|
{githubShortLabel(url)}
|
|
</div>
|
|
|
|
<GithubRefField
|
|
id="github-ref"
|
|
value={draft}
|
|
onChange={setDraft}
|
|
onSubmit={() => {
|
|
if (!invalid && !saving) onConfirm(draft.trim());
|
|
}}
|
|
autoFocus
|
|
/>
|
|
|
|
{errorMessage && (
|
|
<div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-caption text-destructive">
|
|
<TriangleAlert className="size-3.5 mt-0.5 shrink-0" />
|
|
<span>{errorMessage}</span>
|
|
</div>
|
|
)}
|
|
|
|
<DialogFooter>
|
|
<Button
|
|
variant="ghost"
|
|
onClick={() => onOpenChange(false)}
|
|
disabled={saving}
|
|
>
|
|
{t(($) => $.resources.ref_cancel)}
|
|
</Button>
|
|
<Button onClick={() => onConfirm(draft.trim())} disabled={saving || invalid}>
|
|
{t(($) => $.resources.ref_save)}
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|