Skip to content

Commit 7eeb913

Browse files
authored
Merge pull request #61 from iway1/bug/long-description-layout
restyles descriptions to use table to prevent breakage with long text
2 parents 6276591 + 2c30ab6 commit 7eeb913

File tree

2 files changed

+27
-37
lines changed

2 files changed

+27
-37
lines changed

packages/dev-app/src/router.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,15 @@ export const appRouter = createTRPCRouter({
126126
searchTerm: z
127127
.string()
128128
.optional()
129-
.describe("The name of the thing to search for."),
129+
.describe(
130+
"The name of the thing to search for. Really really long long long boi long boi long"
131+
),
132+
searchTerm2: z
133+
.string()
134+
.optional()
135+
.describe(
136+
"The name of the thing to search for. Really really long long long boi long boi long Really really long long long boi long boi long Really really long long long boi long boi long Really really long long long boi long boi long"
137+
),
130138
})
131139
)
132140
.query(() => {

packages/trpc-panel/src/react-app/components/form/ProcedureForm/DescriptionSection.tsx

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,31 @@ export function DocumentationSection({
1212

1313
return (
1414
<FormSection title="Docs">
15-
<div className="flex flex-col space-y-4">
15+
<div className="space-y-4">
1616
{extraData.description && (
1717
<DocumentationSubsection title="Description">
1818
{extraData.description}
1919
</DocumentationSubsection>
2020
)}
2121
{hasParams && (
2222
<DocumentationSubsection title="Params">
23-
<div className="pl-4 flex flex-row">
24-
<div className="flex flex-col">
25-
<ul className="space-y-2 list-disc">
26-
{Object.entries(extraData.parameterDescriptions).map(
27-
([key]) => (
28-
<li
29-
key={key}
30-
className="list-item border-b border-separatorLine flex-row space-x-2"
31-
>
32-
<span className="text-sm text-neutralText font-bold">
33-
{`${key}: `}
34-
</span>
35-
</li>
36-
)
37-
)}
38-
</ul>
39-
</div>
40-
41-
<div className="flex flex-col">
42-
<ul className="space-y-2">
43-
{Object.entries(extraData.parameterDescriptions).map(
44-
([key, value]) => (
45-
<li
46-
key={key}
47-
className="list-item border-b border-separatorLine flex-row space-x-2"
48-
>
49-
<span className="pl-4 text-sm text-gray-500 ">
50-
{`${value}`}
51-
</span>
52-
</li>
53-
)
54-
)}
55-
</ul>
56-
</div>
57-
</div>
23+
<table>
24+
{Object.entries(extraData.parameterDescriptions).map(
25+
([key, value]) => (
26+
<tr
27+
key={key}
28+
className="border-b border-separatorLine flex-row space-x-2"
29+
>
30+
<td className="text-sm text-neutralText font-bold align-top py-2">
31+
{`${key}: `}
32+
</td>
33+
<td className="pl-4 text-sm text-gray-500 py-2">
34+
{`${value}`}
35+
</td>
36+
</tr>
37+
)
38+
)}
39+
</table>
5840
</DocumentationSubsection>
5941
)}
6042
</div>

0 commit comments

Comments
 (0)