Some tweaks for beta

This commit is contained in:
Gregory Schier
2024-08-19 19:10:08 -07:00
parent 323e27a047
commit 0763c1b9b8
6 changed files with 20 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ import type {
import { useCallback, useMemo, useState } from 'react';
import type { FnArg } from '../gen/FnArg';
import type { Tokens } from '../gen/Tokens';
import { useActiveRequest } from '../hooks/useActiveRequest';
import { useDebouncedValue } from '../hooks/useDebouncedValue';
import { useHttpRequests } from '../hooks/useHttpRequests';
import { useRenderTemplate } from '../hooks/useRenderTemplate';
@@ -207,6 +208,7 @@ function HttpRequestArg({
onChange: (v: string) => void;
}) {
const httpRequests = useHttpRequests();
const activeRequest = useActiveRequest();
return (
<Select
label={arg.label ?? arg.name}
@@ -214,10 +216,12 @@ function HttpRequestArg({
onChange={onChange}
value={value}
options={[
...httpRequests.map((r) => ({
label: fallbackRequestName(r),
value: r.id,
})),
...httpRequests
.filter((r) => r.id != activeRequest?.id)
.map((r) => ({
label: fallbackRequestName(r),
value: r.id,
})),
]}
/>
);

View File

@@ -41,9 +41,9 @@ export function twig({
templateFunctions.map((fn) => {
const shortArgs =
fn.args
.slice(0, 2)
.slice(0, 1)
.map((a) => a.name)
.join(', ') + (fn.args.length > 2 ? ', …' : '');
.join(', ') + (fn.args.length > 1 ? ', …' : '');
return {
name: fn.name,
type: 'function',