Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
348cda8b58 | ||
|
|
19690e1367 |
No files matched your search
@@ -384,64 +384,6 @@ describe("ChatMarkdown", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("renders path-shaped inline code as interactive file chips", async () => {
|
||||
const source = [
|
||||
"Call `appendFileSync` once per batch.",
|
||||
"Inspect `apps/server/src/provider/Layers/EventNdjsonLogger.ts:148` and keep `1.2.3` unchanged.",
|
||||
].join("\n\n");
|
||||
const screen = await render(
|
||||
<ChatMarkdown text={source} cwd="/repo/project" threadRef={threadRef} />,
|
||||
);
|
||||
|
||||
try {
|
||||
const link = page.getByRole("link", { name: "EventNdjsonLogger.ts · L148" });
|
||||
await expect.element(link).toHaveClass(/chat-markdown-file-link/);
|
||||
await expect
|
||||
.element(link)
|
||||
.toHaveAttribute(
|
||||
"href",
|
||||
"/repo/project/apps/server/src/provider/Layers/EventNdjsonLogger.ts:148",
|
||||
);
|
||||
|
||||
const inlineCodeValues = [
|
||||
...document.querySelectorAll<HTMLElement>(".chat-markdown :not(pre) > code"),
|
||||
].map((element) => element.textContent);
|
||||
expect(inlineCodeValues).toEqual(["appendFileSync", "1.2.3"]);
|
||||
|
||||
await link.click();
|
||||
await vi.waitFor(() => {
|
||||
expect(
|
||||
selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, threadRef),
|
||||
).toMatchObject({
|
||||
isOpen: true,
|
||||
activeSurfaceId: "file:apps/server/src/provider/Layers/EventNdjsonLogger.ts",
|
||||
});
|
||||
});
|
||||
} finally {
|
||||
await screen.unmount();
|
||||
}
|
||||
});
|
||||
|
||||
it("disambiguates inline-code file chips with duplicate basenames", async () => {
|
||||
const screen = await render(
|
||||
<ChatMarkdown
|
||||
text="Compare `apps/web/src/first/config.ts` with `packages/shared/src/second/config.ts`."
|
||||
cwd="/repo/project"
|
||||
/>,
|
||||
);
|
||||
|
||||
try {
|
||||
await expect
|
||||
.element(page.getByRole("link", { name: "config.ts · src/first" }))
|
||||
.toBeInTheDocument();
|
||||
await expect
|
||||
.element(page.getByRole("link", { name: "config.ts · src/second" }))
|
||||
.toBeInTheDocument();
|
||||
} finally {
|
||||
await screen.unmount();
|
||||
}
|
||||
});
|
||||
|
||||
it("renders sanitized details with the design-system collapsible", async () => {
|
||||
const source = [
|
||||
"<details open>",
|
||||
|
||||
@@ -54,7 +54,6 @@ import {
|
||||
import {
|
||||
normalizeMarkdownLinkDestination,
|
||||
resolveMarkdownFileLinkMeta,
|
||||
resolveMarkdownInlineCodeFileLinkMeta,
|
||||
rewriteMarkdownFileUriHref,
|
||||
} from "../markdown-links";
|
||||
import { readLocalApi } from "../localApi";
|
||||
@@ -162,8 +161,6 @@ function extractPreCodeMeta(node: unknown): string | undefined {
|
||||
type MarkdownAstNode = {
|
||||
type?: string;
|
||||
meta?: unknown;
|
||||
value?: unknown;
|
||||
url?: string;
|
||||
data?: {
|
||||
hProperties?: Record<string, unknown>;
|
||||
};
|
||||
@@ -189,25 +186,6 @@ function remarkPreserveCodeMeta() {
|
||||
};
|
||||
}
|
||||
|
||||
function remarkLinkInlineCodeFilePaths(options: { readonly cwd: string | undefined }) {
|
||||
return (tree: MarkdownAstNode) => {
|
||||
const visit = (node: MarkdownAstNode) => {
|
||||
if (node.type === "inlineCode" && typeof node.value === "string") {
|
||||
const value = node.value;
|
||||
if (resolveMarkdownInlineCodeFileLinkMeta(value, options.cwd)) {
|
||||
node.type = "link";
|
||||
node.url = value.trim();
|
||||
node.children = [{ type: "text", value }];
|
||||
delete node.value;
|
||||
}
|
||||
}
|
||||
node.children?.forEach(visit);
|
||||
};
|
||||
|
||||
visit(tree);
|
||||
};
|
||||
}
|
||||
|
||||
function nodeToPlainText(node: ReactNode): string {
|
||||
if (typeof node === "string" || typeof node === "number") {
|
||||
return String(node);
|
||||
@@ -689,7 +667,6 @@ interface MarkdownFileLinkProps {
|
||||
}
|
||||
|
||||
const MARKDOWN_LINK_HREF_PATTERN = /\[[^\]]*]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/g;
|
||||
const MARKDOWN_INLINE_CODE_PATTERN = /(?<!`)(`{1,2})(?!`)([\s\S]*?)(?<!`)\1(?!`)/g;
|
||||
const MARKDOWN_FILE_LINK_CLASS_NAME =
|
||||
"chat-markdown-file-link cursor-pointer transition-colors hover:bg-accent/70";
|
||||
|
||||
@@ -763,16 +740,6 @@ function extractMarkdownLinkHrefs(text: string): string[] {
|
||||
return hrefs;
|
||||
}
|
||||
|
||||
function extractMarkdownInlineCodeValues(text: string): string[] {
|
||||
const values: string[] = [];
|
||||
for (const match of text.matchAll(MARKDOWN_INLINE_CODE_PATTERN)) {
|
||||
const value = match[2]?.trim();
|
||||
if (!value) continue;
|
||||
values.push(value);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
function normalizeMarkdownLinkHrefKey(href: string): string {
|
||||
const normalizedHref = normalizeMarkdownLinkDestination(href);
|
||||
return rewriteMarkdownFileUriHref(normalizedHref) ?? normalizedHref;
|
||||
@@ -1223,14 +1190,6 @@ function ChatMarkdown({
|
||||
metaByHref.set(normalizedHref, meta);
|
||||
}
|
||||
}
|
||||
for (const value of extractMarkdownInlineCodeValues(text)) {
|
||||
const normalizedHref = normalizeMarkdownLinkHrefKey(value);
|
||||
if (metaByHref.has(normalizedHref)) continue;
|
||||
const meta = resolveMarkdownInlineCodeFileLinkMeta(normalizedHref, cwd);
|
||||
if (meta) {
|
||||
metaByHref.set(normalizedHref, meta);
|
||||
}
|
||||
}
|
||||
return metaByHref;
|
||||
}, [cwd, text]);
|
||||
const fileLinkParentSuffixByPath = useMemo(() => {
|
||||
@@ -1261,10 +1220,7 @@ function ChatMarkdown({
|
||||
},
|
||||
a({ node, href, children, ...props }) {
|
||||
const normalizedHref = href ? normalizeMarkdownLinkHrefKey(href) : "";
|
||||
const fileLinkMeta = normalizedHref
|
||||
? (markdownFileLinkMetaByHref.get(normalizedHref) ??
|
||||
resolveMarkdownFileLinkMeta(normalizedHref, cwd))
|
||||
: null;
|
||||
const fileLinkMeta = normalizedHref ? markdownFileLinkMetaByHref.get(normalizedHref) : null;
|
||||
if (!fileLinkMeta) {
|
||||
const faviconHost = resolveExternalLinkHost(href);
|
||||
const isSameDocumentLink = href?.startsWith("#") ?? false;
|
||||
@@ -1371,7 +1327,6 @@ function ChatMarkdown({
|
||||
}),
|
||||
[
|
||||
diffThemeName,
|
||||
cwd,
|
||||
fileLinkParentSuffixByPath,
|
||||
isStreaming,
|
||||
markdownFileLinkMetaByHref,
|
||||
@@ -1392,13 +1347,8 @@ function ChatMarkdown({
|
||||
<ReactMarkdown
|
||||
remarkPlugins={
|
||||
lineBreaks
|
||||
? [
|
||||
remarkGfm,
|
||||
remarkBreaks,
|
||||
[remarkLinkInlineCodeFilePaths, { cwd }],
|
||||
remarkPreserveCodeMeta,
|
||||
]
|
||||
: [remarkGfm, [remarkLinkInlineCodeFilePaths, { cwd }], remarkPreserveCodeMeta]
|
||||
? [remarkGfm, remarkBreaks, remarkPreserveCodeMeta]
|
||||
: [remarkGfm, remarkPreserveCodeMeta]
|
||||
}
|
||||
rehypePlugins={[rehypeRaw, [rehypeSanitize, CHAT_MARKDOWN_SANITIZE_SCHEMA]]}
|
||||
components={markdownComponents}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { CheckIcon } from "lucide-react";
|
||||
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useMemo, useReducer } from "react";
|
||||
import {
|
||||
ProviderInstanceId,
|
||||
ProviderDriverKind,
|
||||
@@ -64,6 +64,7 @@ const INSTANCE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
|
||||
const DEFAULT_DRIVER_KIND = ProviderDriverKind.make("codex");
|
||||
const DEFAULT_DRIVER_OPTION = DRIVER_OPTIONS[0]!;
|
||||
const EMPTY_CONFIG_DRAFT: Record<string, unknown> = {};
|
||||
const WIZARD_STEPS = ["Driver", "Identity", "Config"] as const;
|
||||
interface ComingSoonDriverOption {
|
||||
readonly value: ProviderDriverKind;
|
||||
readonly label: string;
|
||||
@@ -113,78 +114,132 @@ interface AddProviderInstanceDialogProps {
|
||||
onOpenChange: (open: boolean) => void;
|
||||
}
|
||||
|
||||
interface AddProviderInstanceDraftState {
|
||||
readonly wizardStep: number;
|
||||
readonly driver: ProviderDriverKind;
|
||||
readonly label: string;
|
||||
readonly accentColor: string;
|
||||
readonly manualInstanceId: string;
|
||||
readonly instanceIdDirty: boolean;
|
||||
readonly configByDriver: Record<string, Record<string, unknown>>;
|
||||
readonly hasAttemptedSubmit: boolean;
|
||||
}
|
||||
|
||||
type AddProviderInstanceDraftAction =
|
||||
| { readonly type: "setWizardStep"; readonly step: number }
|
||||
| { readonly type: "setDriver"; readonly driver: ProviderDriverKind }
|
||||
| { readonly type: "setLabel"; readonly label: string }
|
||||
| { readonly type: "setAccentColor"; readonly accentColor: string }
|
||||
| { readonly type: "setManualInstanceId"; readonly instanceId: string }
|
||||
| {
|
||||
readonly type: "setConfigDraft";
|
||||
readonly driver: ProviderDriverKind;
|
||||
readonly config: Record<string, unknown> | undefined;
|
||||
}
|
||||
| { readonly type: "markAttemptedSubmit" };
|
||||
|
||||
function createInitialAddProviderInstanceDraftState(): AddProviderInstanceDraftState {
|
||||
return {
|
||||
wizardStep: 0,
|
||||
driver: DEFAULT_DRIVER_KIND,
|
||||
label: "",
|
||||
accentColor: "",
|
||||
manualInstanceId: "",
|
||||
instanceIdDirty: false,
|
||||
configByDriver: {},
|
||||
hasAttemptedSubmit: false,
|
||||
};
|
||||
}
|
||||
|
||||
function addProviderInstanceDraftReducer(
|
||||
state: AddProviderInstanceDraftState,
|
||||
action: AddProviderInstanceDraftAction,
|
||||
): AddProviderInstanceDraftState {
|
||||
switch (action.type) {
|
||||
case "setWizardStep":
|
||||
return state.wizardStep === action.step ? state : { ...state, wizardStep: action.step };
|
||||
case "setDriver":
|
||||
return state.driver === action.driver ? state : { ...state, driver: action.driver };
|
||||
case "setLabel":
|
||||
return state.label === action.label ? state : { ...state, label: action.label };
|
||||
case "setAccentColor":
|
||||
return state.accentColor === action.accentColor
|
||||
? state
|
||||
: { ...state, accentColor: action.accentColor };
|
||||
case "setManualInstanceId":
|
||||
return state.manualInstanceId === action.instanceId && state.instanceIdDirty
|
||||
? state
|
||||
: { ...state, manualInstanceId: action.instanceId, instanceIdDirty: true };
|
||||
case "setConfigDraft": {
|
||||
const next = { ...state.configByDriver };
|
||||
if (action.config === undefined || Object.keys(action.config).length === 0) {
|
||||
delete next[action.driver];
|
||||
} else {
|
||||
next[action.driver] = action.config;
|
||||
}
|
||||
return { ...state, configByDriver: next };
|
||||
}
|
||||
case "markAttemptedSubmit":
|
||||
return state.hasAttemptedSubmit ? state : { ...state, hasAttemptedSubmit: true };
|
||||
}
|
||||
}
|
||||
|
||||
export function AddProviderInstanceDialog({ open, onOpenChange }: AddProviderInstanceDialogProps) {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
{open ? <AddProviderInstanceDialogContent onOpenChange={onOpenChange} /> : null}
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceDialogContent({
|
||||
onOpenChange,
|
||||
}: Pick<AddProviderInstanceDialogProps, "onOpenChange">) {
|
||||
const settings = useSettings();
|
||||
const { updateSettings } = useUpdateSettings();
|
||||
|
||||
const [wizardStep, setWizardStep] = useState(0);
|
||||
const [driver, setDriver] = useState<ProviderDriverKind>(DEFAULT_DRIVER_KIND);
|
||||
const [label, setLabel] = useState("");
|
||||
const [accentColor, setAccentColor] = useState<string>("");
|
||||
const [instanceId, setInstanceId] = useState("");
|
||||
const [instanceIdDirty, setInstanceIdDirty] = useState(false);
|
||||
// Driver-specific config drafts keyed by driver so toggling between drivers
|
||||
// during the same dialog session does not lose in-progress input.
|
||||
const [configByDriver, setConfigByDriver] = useState<Record<string, Record<string, unknown>>>({});
|
||||
// Errors are suppressed until the user has tried to submit once. After that
|
||||
// they update live so fixing the problem clears the message in place.
|
||||
const [hasAttemptedSubmit, setHasAttemptedSubmit] = useState(false);
|
||||
const [draft, dispatch] = useReducer(
|
||||
addProviderInstanceDraftReducer,
|
||||
undefined,
|
||||
createInitialAddProviderInstanceDraftState,
|
||||
);
|
||||
const {
|
||||
wizardStep,
|
||||
driver,
|
||||
label,
|
||||
accentColor,
|
||||
manualInstanceId,
|
||||
instanceIdDirty,
|
||||
configByDriver,
|
||||
hasAttemptedSubmit,
|
||||
} = draft;
|
||||
|
||||
const existingIds = useMemo(
|
||||
() => new Set(Object.keys(settings.providerInstances ?? {})),
|
||||
[settings.providerInstances],
|
||||
);
|
||||
|
||||
// Reset the form every time the dialog opens so each creation starts
|
||||
// from a clean slate.
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
setDriver(DEFAULT_DRIVER_KIND);
|
||||
setLabel("");
|
||||
setAccentColor("");
|
||||
setInstanceId("");
|
||||
setWizardStep(0);
|
||||
setInstanceIdDirty(false);
|
||||
setConfigByDriver({});
|
||||
setHasAttemptedSubmit(false);
|
||||
}, [open]);
|
||||
|
||||
// Auto-derive the instance id from driver + label until the user types
|
||||
// in the Instance ID field directly (after which they own its value).
|
||||
useEffect(() => {
|
||||
if (instanceIdDirty) return;
|
||||
setInstanceId(deriveInstanceId(driver, label));
|
||||
}, [driver, label, instanceIdDirty]);
|
||||
|
||||
const driverOption = DRIVER_OPTION_BY_VALUE[driver] ?? DEFAULT_DRIVER_OPTION;
|
||||
const driverSettingsFields = useMemo(
|
||||
() => deriveProviderSettingsFields(driverOption),
|
||||
[driverOption],
|
||||
);
|
||||
const derivedInstanceId = deriveInstanceId(driver, label);
|
||||
const instanceId = instanceIdDirty ? manualInstanceId : derivedInstanceId;
|
||||
const instanceIdError = validateInstanceId(instanceId, existingIds);
|
||||
const showInstanceIdError = hasAttemptedSubmit && instanceIdError !== null;
|
||||
const previewLabel = label.trim() || `${driverOption.label} Workspace`;
|
||||
const wizardSteps = ["Driver", "Identity", "Config"] as const;
|
||||
const wizardStepSummaries = [driverOption.label, previewLabel, null] as const;
|
||||
|
||||
const configDraft = configByDriver[driver] ?? EMPTY_CONFIG_DRAFT;
|
||||
const setConfigDraft = useCallback(
|
||||
(config: Record<string, unknown> | undefined) => {
|
||||
setConfigByDriver((existing) => {
|
||||
const next = { ...existing };
|
||||
if (config === undefined || Object.keys(config).length === 0) {
|
||||
delete next[driver];
|
||||
} else {
|
||||
next[driver] = config;
|
||||
}
|
||||
return next;
|
||||
});
|
||||
dispatch({ type: "setConfigDraft", driver, config });
|
||||
},
|
||||
[driver],
|
||||
);
|
||||
|
||||
const handleSave = useCallback(() => {
|
||||
setHasAttemptedSubmit(true);
|
||||
dispatch({ type: "markAttemptedSubmit" });
|
||||
if (instanceIdError !== null) return;
|
||||
|
||||
const config = configByDriver[driver] ?? {};
|
||||
@@ -236,256 +291,392 @@ export function AddProviderInstanceDialog({ open, onOpenChange }: AddProviderIns
|
||||
]);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogPopup className="max-w-xl overflow-hidden">
|
||||
<div className="flex min-h-0 flex-col overflow-hidden border-foreground/10 bg-background shadow-2xl">
|
||||
<DialogHeader className="border-b border-border/70 bg-background">
|
||||
<DialogTitle>Add provider instance</DialogTitle>
|
||||
<DialogDescription>
|
||||
Configure an additional provider instance — for example, a second Codex install
|
||||
pointed at a different workspace.
|
||||
</DialogDescription>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
{wizardSteps.map((step, index) => (
|
||||
<button
|
||||
key={step}
|
||||
type="button"
|
||||
className={cn(
|
||||
"grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] gap-x-2 rounded-lg border px-3 py-2 text-left",
|
||||
index === wizardStep
|
||||
? "border-primary bg-primary/10 ring-1 ring-primary/25"
|
||||
: index < wizardStep
|
||||
? "border-border bg-background"
|
||||
: "border-border bg-muted/40",
|
||||
)}
|
||||
onClick={() => setWizardStep(index)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"row-span-2 mt-0.5 grid size-4 place-items-center rounded-full border",
|
||||
index < wizardStep
|
||||
? "border-primary bg-primary text-primary-foreground"
|
||||
: index === wizardStep
|
||||
? "border-primary bg-background"
|
||||
: "border-muted-foreground/35 bg-background",
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
{index < wizardStep ? <CheckIcon className="size-3" /> : null}
|
||||
</span>
|
||||
<span className="text-[10px] font-medium uppercase text-muted-foreground">
|
||||
Step {index + 1}
|
||||
</span>
|
||||
<span className="truncate text-xs font-semibold text-foreground">
|
||||
{step}
|
||||
{index < wizardStep && wizardStepSummaries[index]
|
||||
? `: ${wizardStepSummaries[index]}`
|
||||
: ""}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</DialogHeader>
|
||||
|
||||
<div
|
||||
data-slot="dialog-panel"
|
||||
className="space-y-4 border-b border-border/70 bg-muted/20 px-6 py-5"
|
||||
>
|
||||
<AnimatedHeight>
|
||||
<div className={cn("grid gap-2", wizardStep !== 0 && "hidden")}>
|
||||
<span
|
||||
id="add-instance-driver-label"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Driver
|
||||
</span>
|
||||
<RadioGroup
|
||||
value={driver}
|
||||
onValueChange={(value) => setDriver(ProviderDriverKind.make(value))}
|
||||
aria-labelledby="add-instance-driver-label"
|
||||
className="grid grid-cols-2 gap-2.5"
|
||||
>
|
||||
{DRIVER_OPTIONS.map((option) => {
|
||||
const IconComponent = option.icon;
|
||||
const isSelected = option.value === driver;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
className={cn(
|
||||
"relative flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-left outline-none transition-[background-color,border-color,box-shadow]",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
||||
isSelected
|
||||
? "border-primary bg-background shadow-sm ring-2 ring-primary/35"
|
||||
: "border-border bg-background hover:border-foreground/20 hover:bg-muted/50",
|
||||
)}
|
||||
>
|
||||
<IconComponent className="size-5 shrink-0" aria-hidden />
|
||||
<span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">
|
||||
{option.label}
|
||||
</span>
|
||||
{option.badgeLabel ? (
|
||||
<Badge variant="warning" size="sm">
|
||||
{option.badgeLabel}
|
||||
</Badge>
|
||||
) : null}
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
{COMING_SOON_DRIVER_OPTIONS.map((option) => {
|
||||
const IconComponent = option.icon;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
disabled
|
||||
className={cn(
|
||||
"relative flex cursor-not-allowed items-center gap-3 rounded-lg border border-border bg-background px-3 py-3 text-left opacity-55 outline-none",
|
||||
)}
|
||||
>
|
||||
<IconComponent
|
||||
className="size-5 shrink-0 text-muted-foreground"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">
|
||||
{option.label}
|
||||
</span>
|
||||
<Badge variant="warning" size="sm">
|
||||
Coming Soon
|
||||
</Badge>
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
|
||||
<label className={cn("grid gap-2", wizardStep !== 1 && "hidden")}>
|
||||
<span className="text-xs font-medium text-foreground">Label</span>
|
||||
<Input
|
||||
className="bg-background"
|
||||
placeholder="e.g. Work"
|
||||
value={label}
|
||||
onChange={(event) => setLabel(event.target.value)}
|
||||
/>
|
||||
<span className="text-[11px] text-muted-foreground">
|
||||
Shown in the provider list. Optional.
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label className={cn("grid gap-2", wizardStep !== 1 && "hidden")}>
|
||||
<span className="text-xs font-medium text-foreground">Instance ID</span>
|
||||
<Input
|
||||
className="bg-background"
|
||||
placeholder={`${driver}_work`}
|
||||
value={instanceId}
|
||||
onChange={(event) => {
|
||||
setInstanceIdDirty(true);
|
||||
setInstanceId(event.target.value);
|
||||
}}
|
||||
aria-invalid={showInstanceIdError}
|
||||
/>
|
||||
{showInstanceIdError ? (
|
||||
<span className="text-[11px] text-destructive">{instanceIdError}</span>
|
||||
) : (
|
||||
<span className="text-[11px] text-muted-foreground">
|
||||
Routing key used by threads and sessions. Letters, digits, '-', or '_'.
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
|
||||
<div className={cn("grid gap-2", wizardStep !== 1 && "hidden")}>
|
||||
<span className="text-xs font-medium text-foreground">Accent color</span>
|
||||
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={normalizeProviderAccentColor(accentColor) ?? PROVIDER_ACCENT_SWATCHES[0]}
|
||||
onChange={(event) => setAccentColor(event.target.value)}
|
||||
aria-label="Provider instance accent color"
|
||||
className="h-8 w-10 cursor-pointer rounded-xl border border-input bg-background p-0.5"
|
||||
/>
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{PROVIDER_ACCENT_SWATCHES.map((swatch) => {
|
||||
const selected = accentColor.toLowerCase() === swatch;
|
||||
return (
|
||||
<button
|
||||
key={swatch}
|
||||
type="button"
|
||||
className={cn(
|
||||
"size-6 cursor-pointer rounded-full border transition",
|
||||
selected
|
||||
? "scale-110 border-foreground ring-2 ring-ring ring-offset-1 ring-offset-background"
|
||||
: "border-black/10 hover:scale-105 dark:border-white/20",
|
||||
)}
|
||||
style={{ backgroundColor: swatch }}
|
||||
onClick={() => setAccentColor(swatch)}
|
||||
aria-label={`Use ${swatch} accent`}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{accentColor ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="h-7 px-2 text-xs text-muted-foreground"
|
||||
onClick={() => setAccentColor("")}
|
||||
>
|
||||
Clear
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="text-[11px] text-muted-foreground">
|
||||
Optional marker shown in the picker.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{driverSettingsFields.length > 0 ? (
|
||||
<div className={cn("grid gap-4", wizardStep !== 2 && "hidden")}>
|
||||
<ProviderSettingsForm
|
||||
definition={driverOption}
|
||||
value={configDraft}
|
||||
idPrefix={`add-provider-${driver}`}
|
||||
variant="dialog"
|
||||
onChange={setConfigDraft}
|
||||
/>
|
||||
</div>
|
||||
) : wizardStep === 2 ? (
|
||||
<div className="grid gap-2">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
This driver has no required configuration. You can add the instance now.
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
</AnimatedHeight>
|
||||
</div>
|
||||
|
||||
<DialogFooter className="border-t bg-background">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
if (wizardStep === 0) {
|
||||
onOpenChange(false);
|
||||
return;
|
||||
}
|
||||
setWizardStep((step) => Math.max(0, step - 1));
|
||||
}}
|
||||
>
|
||||
{wizardStep === 0 ? "Cancel" : "Back"}
|
||||
</Button>
|
||||
{wizardStep < wizardSteps.length - 1 ? (
|
||||
<Button size="sm" onClick={() => setWizardStep((step) => Math.min(2, step + 1))}>
|
||||
Next
|
||||
</Button>
|
||||
) : (
|
||||
<Button size="sm" onClick={handleSave}>
|
||||
Add instance
|
||||
</Button>
|
||||
)}
|
||||
</DialogFooter>
|
||||
</div>
|
||||
</DialogPopup>
|
||||
</Dialog>
|
||||
<DialogPopup className="max-w-xl overflow-hidden">
|
||||
<div className="flex min-h-0 flex-col overflow-hidden border-foreground/10 bg-background shadow-2xl">
|
||||
<AddProviderInstanceDialogHeader
|
||||
wizardStep={wizardStep}
|
||||
wizardStepSummaries={wizardStepSummaries}
|
||||
onStepSelect={(step) => dispatch({ type: "setWizardStep", step })}
|
||||
/>
|
||||
<AddProviderInstanceDialogPanel
|
||||
wizardStep={wizardStep}
|
||||
driver={driver}
|
||||
driverOption={driverOption}
|
||||
driverSettingsFields={driverSettingsFields}
|
||||
label={label}
|
||||
onLabelChange={(nextLabel) => dispatch({ type: "setLabel", label: nextLabel })}
|
||||
instanceId={instanceId}
|
||||
instanceIdError={instanceIdError}
|
||||
showInstanceIdError={showInstanceIdError}
|
||||
onInstanceIdChange={(nextInstanceId) =>
|
||||
dispatch({ type: "setManualInstanceId", instanceId: nextInstanceId })
|
||||
}
|
||||
accentColor={accentColor}
|
||||
onAccentColorChange={(nextAccentColor) =>
|
||||
dispatch({ type: "setAccentColor", accentColor: nextAccentColor })
|
||||
}
|
||||
onDriverChange={(nextDriver) => dispatch({ type: "setDriver", driver: nextDriver })}
|
||||
configDraft={configDraft}
|
||||
onConfigDraftChange={setConfigDraft}
|
||||
/>
|
||||
<AddProviderInstanceDialogFooter
|
||||
wizardStep={wizardStep}
|
||||
onBack={() => {
|
||||
if (wizardStep === 0) {
|
||||
onOpenChange(false);
|
||||
return;
|
||||
}
|
||||
dispatch({ type: "setWizardStep", step: Math.max(0, wizardStep - 1) });
|
||||
}}
|
||||
onNext={() =>
|
||||
dispatch({
|
||||
type: "setWizardStep",
|
||||
step: Math.min(WIZARD_STEPS.length - 1, wizardStep + 1),
|
||||
})
|
||||
}
|
||||
onSave={handleSave}
|
||||
/>
|
||||
</div>
|
||||
</DialogPopup>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceDialogHeader(props: {
|
||||
wizardStep: number;
|
||||
wizardStepSummaries: readonly (string | null)[];
|
||||
onStepSelect: (step: number) => void;
|
||||
}) {
|
||||
return (
|
||||
<DialogHeader className="border-b border-border/70 bg-background">
|
||||
<DialogTitle>Add provider instance</DialogTitle>
|
||||
<DialogDescription>
|
||||
Configure an additional provider instance — for example, a second Codex install pointed at a
|
||||
different workspace.
|
||||
</DialogDescription>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
{WIZARD_STEPS.map((step, index) => (
|
||||
<button
|
||||
key={step}
|
||||
type="button"
|
||||
className={cn(
|
||||
"grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] gap-x-2 rounded-lg border px-3 py-2 text-left",
|
||||
index === props.wizardStep
|
||||
? "border-primary bg-primary/10 ring-1 ring-primary/25"
|
||||
: index < props.wizardStep
|
||||
? "border-border bg-background"
|
||||
: "border-border bg-muted/40",
|
||||
)}
|
||||
onClick={() => props.onStepSelect(index)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"row-span-2 mt-0.5 grid size-4 place-items-center rounded-full border",
|
||||
index < props.wizardStep
|
||||
? "border-primary bg-primary text-primary-foreground"
|
||||
: index === props.wizardStep
|
||||
? "border-primary bg-background"
|
||||
: "border-muted-foreground/35 bg-background",
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
{index < props.wizardStep ? <CheckIcon className="size-3" /> : null}
|
||||
</span>
|
||||
<span className="text-[10px] font-medium uppercase text-muted-foreground">
|
||||
Step {index + 1}
|
||||
</span>
|
||||
<span className="truncate text-xs font-semibold text-foreground">
|
||||
{step}
|
||||
{index < props.wizardStep && props.wizardStepSummaries[index]
|
||||
? `: ${props.wizardStepSummaries[index]}`
|
||||
: ""}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</DialogHeader>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceDialogPanel(props: {
|
||||
wizardStep: number;
|
||||
driver: ProviderDriverKind;
|
||||
driverOption: typeof DEFAULT_DRIVER_OPTION;
|
||||
driverSettingsFields: ReturnType<typeof deriveProviderSettingsFields>;
|
||||
label: string;
|
||||
onLabelChange: (label: string) => void;
|
||||
instanceId: string;
|
||||
instanceIdError: string | null;
|
||||
showInstanceIdError: boolean;
|
||||
onInstanceIdChange: (instanceId: string) => void;
|
||||
accentColor: string;
|
||||
onAccentColorChange: (accentColor: string) => void;
|
||||
onDriverChange: (driver: ProviderDriverKind) => void;
|
||||
configDraft: Record<string, unknown>;
|
||||
onConfigDraftChange: (config: Record<string, unknown> | undefined) => void;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
data-slot="dialog-panel"
|
||||
className="space-y-4 border-b border-border/70 bg-muted/20 px-6 py-5"
|
||||
>
|
||||
<AnimatedHeight>
|
||||
<AddProviderInstanceDriverStep
|
||||
active={props.wizardStep === 0}
|
||||
driver={props.driver}
|
||||
onDriverChange={props.onDriverChange}
|
||||
/>
|
||||
<AddProviderInstanceIdentityStep
|
||||
active={props.wizardStep === 1}
|
||||
driver={props.driver}
|
||||
label={props.label}
|
||||
onLabelChange={props.onLabelChange}
|
||||
instanceId={props.instanceId}
|
||||
instanceIdError={props.instanceIdError}
|
||||
showInstanceIdError={props.showInstanceIdError}
|
||||
onInstanceIdChange={props.onInstanceIdChange}
|
||||
accentColor={props.accentColor}
|
||||
onAccentColorChange={props.onAccentColorChange}
|
||||
/>
|
||||
<AddProviderInstanceConfigStep
|
||||
active={props.wizardStep === 2}
|
||||
driver={props.driver}
|
||||
driverOption={props.driverOption}
|
||||
driverSettingsFields={props.driverSettingsFields}
|
||||
configDraft={props.configDraft}
|
||||
onConfigDraftChange={props.onConfigDraftChange}
|
||||
/>
|
||||
</AnimatedHeight>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceDriverStep(props: {
|
||||
active: boolean;
|
||||
driver: ProviderDriverKind;
|
||||
onDriverChange: (driver: ProviderDriverKind) => void;
|
||||
}) {
|
||||
return (
|
||||
<div className={cn("grid gap-2", !props.active && "hidden")}>
|
||||
<span id="add-instance-driver-label" className="text-xs font-medium text-foreground">
|
||||
Driver
|
||||
</span>
|
||||
<RadioGroup
|
||||
value={props.driver}
|
||||
onValueChange={(value) => props.onDriverChange(ProviderDriverKind.make(value))}
|
||||
aria-labelledby="add-instance-driver-label"
|
||||
className="grid grid-cols-2 gap-2.5"
|
||||
>
|
||||
{DRIVER_OPTIONS.map((option) => {
|
||||
const IconComponent = option.icon;
|
||||
const isSelected = option.value === props.driver;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
className={cn(
|
||||
"relative flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-left outline-none transition-[background-color,border-color,box-shadow]",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
||||
isSelected
|
||||
? "border-primary bg-background shadow-sm ring-2 ring-primary/35"
|
||||
: "border-border bg-background hover:border-foreground/20 hover:bg-muted/50",
|
||||
)}
|
||||
>
|
||||
<IconComponent className="size-5 shrink-0" aria-hidden />
|
||||
<span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">
|
||||
{option.label}
|
||||
</span>
|
||||
{option.badgeLabel ? (
|
||||
<Badge variant="warning" size="sm">
|
||||
{option.badgeLabel}
|
||||
</Badge>
|
||||
) : null}
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
{COMING_SOON_DRIVER_OPTIONS.map((option) => {
|
||||
const IconComponent = option.icon;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
disabled
|
||||
className={cn(
|
||||
"relative flex cursor-not-allowed items-center gap-3 rounded-lg border border-border bg-background px-3 py-3 text-left opacity-55 outline-none",
|
||||
)}
|
||||
>
|
||||
<IconComponent className="size-5 shrink-0 text-muted-foreground" aria-hidden />
|
||||
<span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">
|
||||
{option.label}
|
||||
</span>
|
||||
<Badge variant="warning" size="sm">
|
||||
Coming Soon
|
||||
</Badge>
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceIdentityStep(props: {
|
||||
active: boolean;
|
||||
driver: ProviderDriverKind;
|
||||
label: string;
|
||||
onLabelChange: (label: string) => void;
|
||||
instanceId: string;
|
||||
instanceIdError: string | null;
|
||||
showInstanceIdError: boolean;
|
||||
onInstanceIdChange: (instanceId: string) => void;
|
||||
accentColor: string;
|
||||
onAccentColorChange: (accentColor: string) => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<label
|
||||
htmlFor="add-provider-instance-label"
|
||||
className={cn("grid gap-2", !props.active && "hidden")}
|
||||
>
|
||||
<span className="text-xs font-medium text-foreground">Label</span>
|
||||
<Input
|
||||
id="add-provider-instance-label"
|
||||
className="bg-background"
|
||||
placeholder="e.g. Work"
|
||||
value={props.label}
|
||||
onChange={(event) => props.onLabelChange(event.target.value)}
|
||||
/>
|
||||
<span className="text-[11px] text-muted-foreground">
|
||||
Shown in the provider list. Optional.
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label
|
||||
htmlFor="add-provider-instance-id"
|
||||
className={cn("grid gap-2", !props.active && "hidden")}
|
||||
>
|
||||
<span className="text-xs font-medium text-foreground">Instance ID</span>
|
||||
<Input
|
||||
id="add-provider-instance-id"
|
||||
className="bg-background"
|
||||
placeholder={`${props.driver}_work`}
|
||||
value={props.instanceId}
|
||||
onChange={(event) => props.onInstanceIdChange(event.target.value)}
|
||||
aria-invalid={props.showInstanceIdError}
|
||||
/>
|
||||
{props.showInstanceIdError ? (
|
||||
<span className="text-[11px] text-destructive">{props.instanceIdError}</span>
|
||||
) : (
|
||||
<span className="text-[11px] text-muted-foreground">
|
||||
Routing key used by threads and sessions. Letters, digits, '-', or '_'.
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
|
||||
<div className={cn("grid gap-2", !props.active && "hidden")}>
|
||||
<span className="text-xs font-medium text-foreground">Accent color</span>
|
||||
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={normalizeProviderAccentColor(props.accentColor) ?? PROVIDER_ACCENT_SWATCHES[0]}
|
||||
onChange={(event) => props.onAccentColorChange(event.target.value)}
|
||||
aria-label="Provider instance accent color"
|
||||
className="h-8 w-10 cursor-pointer rounded-xl border border-input bg-background p-0.5"
|
||||
/>
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{PROVIDER_ACCENT_SWATCHES.map((swatch) => {
|
||||
const selected = props.accentColor.toLowerCase() === swatch;
|
||||
return (
|
||||
<button
|
||||
key={swatch}
|
||||
type="button"
|
||||
className={cn(
|
||||
"size-6 cursor-pointer rounded-full border transition",
|
||||
selected
|
||||
? "scale-110 border-foreground ring-2 ring-ring ring-offset-1 ring-offset-background"
|
||||
: "border-black/10 hover:scale-105 dark:border-white/20",
|
||||
)}
|
||||
style={{ backgroundColor: swatch }}
|
||||
onClick={() => props.onAccentColorChange(swatch)}
|
||||
aria-label={`Use ${swatch} accent`}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{props.accentColor ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="h-7 px-2 text-xs text-muted-foreground"
|
||||
onClick={() => props.onAccentColorChange("")}
|
||||
>
|
||||
Clear
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="text-[11px] text-muted-foreground">
|
||||
Optional marker shown in the picker.
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceConfigStep(props: {
|
||||
active: boolean;
|
||||
driver: ProviderDriverKind;
|
||||
driverOption: typeof DEFAULT_DRIVER_OPTION;
|
||||
driverSettingsFields: ReturnType<typeof deriveProviderSettingsFields>;
|
||||
configDraft: Record<string, unknown>;
|
||||
onConfigDraftChange: (config: Record<string, unknown> | undefined) => void;
|
||||
}) {
|
||||
if (props.driverSettingsFields.length > 0) {
|
||||
return (
|
||||
<div className={cn("grid gap-4", !props.active && "hidden")}>
|
||||
<ProviderSettingsForm
|
||||
definition={props.driverOption}
|
||||
value={props.configDraft}
|
||||
idPrefix={`add-provider-${props.driver}`}
|
||||
variant="dialog"
|
||||
onChange={props.onConfigDraftChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!props.active) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="grid gap-2">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
This driver has no required configuration. You can add the instance now.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddProviderInstanceDialogFooter(props: {
|
||||
wizardStep: number;
|
||||
onBack: () => void;
|
||||
onNext: () => void;
|
||||
onSave: () => void;
|
||||
}) {
|
||||
return (
|
||||
<DialogFooter className="border-t bg-background">
|
||||
<Button variant="outline" size="sm" onClick={props.onBack}>
|
||||
{props.wizardStep === 0 ? "Cancel" : "Back"}
|
||||
</Button>
|
||||
{props.wizardStep < WIZARD_STEPS.length - 1 ? (
|
||||
<Button size="sm" onClick={props.onNext}>
|
||||
Next
|
||||
</Button>
|
||||
) : (
|
||||
<Button size="sm" onClick={props.onSave}>
|
||||
Add instance
|
||||
</Button>
|
||||
)}
|
||||
</DialogFooter>
|
||||
);
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from "vite-plus/test";
|
||||
import {
|
||||
resolveMarkdownFileLinkMeta,
|
||||
resolveMarkdownFileLinkTarget,
|
||||
resolveMarkdownInlineCodeFileLinkMeta,
|
||||
rewriteMarkdownFileUriHref,
|
||||
} from "./markdown-links";
|
||||
|
||||
@@ -128,35 +127,3 @@ describe("resolveMarkdownFileLinkTarget", () => {
|
||||
expect(resolveMarkdownFileLinkTarget("/chat/settings")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveMarkdownInlineCodeFileLinkMeta", () => {
|
||||
it("resolves path-shaped inline code with source positions", () => {
|
||||
expect(
|
||||
resolveMarkdownInlineCodeFileLinkMeta(
|
||||
"apps/server/src/provider/Layers/EventNdjsonLogger.ts:148",
|
||||
"/repo/project",
|
||||
),
|
||||
).toMatchObject({
|
||||
basename: "EventNdjsonLogger.ts",
|
||||
line: 148,
|
||||
targetPath: "/repo/project/apps/server/src/provider/Layers/EventNdjsonLogger.ts:148",
|
||||
workspaceRelativePath: "apps/server/src/provider/Layers/EventNdjsonLogger.ts",
|
||||
});
|
||||
});
|
||||
|
||||
it("resolves bare filenames only when they include a source position", () => {
|
||||
expect(resolveMarkdownInlineCodeFileLinkMeta("script.ts:10", "/repo/project")).toMatchObject({
|
||||
basename: "script.ts",
|
||||
line: 10,
|
||||
targetPath: "/repo/project/script.ts:10",
|
||||
});
|
||||
expect(resolveMarkdownInlineCodeFileLinkMeta("script.ts", "/repo/project")).toBeNull();
|
||||
});
|
||||
|
||||
it("leaves ordinary code and ambiguous slash values alone", () => {
|
||||
expect(resolveMarkdownInlineCodeFileLinkMeta("sink.write()", "/repo/project")).toBeNull();
|
||||
expect(resolveMarkdownInlineCodeFileLinkMeta("1.2.3", "/repo/project")).toBeNull();
|
||||
expect(resolveMarkdownInlineCodeFileLinkMeta("1/2", "/repo/project")).toBeNull();
|
||||
expect(resolveMarkdownInlineCodeFileLinkMeta("client/server", "/repo/project")).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -211,28 +211,3 @@ export function resolveMarkdownFileLinkMeta(
|
||||
...(columnNumber !== undefined ? { column: columnNumber } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Inline code is used for many non-path values, so only promote references
|
||||
* with unambiguous path syntax. Markdown links remain more permissive because
|
||||
* the link destination itself already signals intent.
|
||||
*/
|
||||
export function resolveMarkdownInlineCodeFileLinkMeta(
|
||||
value: string,
|
||||
cwd?: string,
|
||||
): MarkdownFileLinkMeta | null {
|
||||
const candidate = value.trim();
|
||||
const hasSourcePosition =
|
||||
POSITION_SUFFIX_PATTERN.test(candidate) || /#L\d+(?:C\d+)?$/i.test(candidate);
|
||||
if (!/[\\/]/.test(candidate) && !hasSourcePosition) {
|
||||
return null;
|
||||
}
|
||||
const meta = resolveMarkdownFileLinkMeta(candidate, cwd);
|
||||
if (!meta) {
|
||||
return null;
|
||||
}
|
||||
if (!/[A-Za-z]/.test(meta.basename) || (!meta.basename.includes(".") && !hasSourcePosition)) {
|
||||
return null;
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
Reference in new issue
Block a user