Skip to content

Commit 89e58cf

Browse files
authored
Merge pull request #103 from lien-dev/feature/2-update-prettier
update prettier
2 parents 9a757e1 + d04c708 commit 89e58cf

24 files changed

+374
-179
lines changed

.prettierignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
pnpm-lock.yaml
1+
# Ignore artifacts:
2+
build
3+
coverage
4+
5+
#
6+
pnpm-lock.yaml

.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"lucide-react": "^0.476.0",
4242
"next-themes": "^0.4.4",
4343
"nuqs": "^2.4.1",
44-
"prettier": "^3.5.2",
4544
"react": "^19.0.0",
4645
"react-dom": "^19.0.0",
4746
"react-markdown": "^10.0.1",
@@ -74,6 +73,8 @@
7473
"globals": "^15.14.0",
7574
"next": "^15.2.3",
7675
"postcss": "^8.5.3",
76+
"prettier": "^3.5.3",
77+
"prettier-plugin-tailwindcss": "^0.6.11",
7778
"tailwind-scrollbar": "^4.0.1",
7879
"tailwindcss": "^4.0.13",
7980
"typescript": "~5.7.2",

pnpm-lock.yaml

Lines changed: 68 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prettier.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @see https://prettier.io/docs/configuration
3+
* @type {import("prettier").Config}
4+
*/
5+
const config = {
6+
endOfLine: "auto",
7+
singleAttributePerLine: true,
8+
plugins: ["prettier-plugin-tailwindcss"],
9+
};
10+
11+
export default config;

src/components/thread/agent-inbox/components/inbox-item-input.tsx

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function ResetButton({ handleReset }: { handleReset: () => void }) {
1616
variant="ghost"
1717
className="flex items-center justify-center gap-2 text-gray-500 hover:text-red-500"
1818
>
19-
<Undo2 className="w-4 h-4" />
19+
<Undo2 className="h-4 w-4" />
2020
<span>Reset</span>
2121
</Button>
2222
);
2323
}
2424

2525
function ArgsRenderer({ args }: { args: Record<string, any> }) {
2626
return (
27-
<div className="flex flex-col gap-6 items-start w-full">
27+
<div className="flex w-full flex-col items-start gap-6">
2828
{Object.entries(args).map(([k, v]) => {
2929
let value = "";
3030
if (["string", "number"].includes(typeof v)) {
@@ -34,11 +34,14 @@ function ArgsRenderer({ args }: { args: Record<string, any> }) {
3434
}
3535

3636
return (
37-
<div key={`args-${k}`} className="flex flex-col gap-1 items-start">
38-
<p className="text-sm leading-[18px] text-gray-600 text-wrap">
37+
<div
38+
key={`args-${k}`}
39+
className="flex flex-col items-start gap-1"
40+
>
41+
<p className="text-sm leading-[18px] text-wrap text-gray-600">
3942
{prettifyText(k)}:
4043
</p>
41-
<span className="text-[13px] leading-[18px] text-black bg-zinc-100 rounded-xl p-3 w-full max-w-full">
44+
<span className="w-full max-w-full rounded-xl bg-zinc-100 p-3 text-[13px] leading-[18px] text-black">
4245
<MarkdownText>{value}</MarkdownText>
4346
</span>
4447
</div>
@@ -104,9 +107,9 @@ function ResponseComponent({
104107
};
105108

106109
return (
107-
<div className="flex flex-col gap-4 p-6 items-start w-full rounded-xl border-[1px] border-gray-300">
108-
<div className="flex items-center justify-between w-full">
109-
<p className="font-semibold text-black text-base">
110+
<div className="flex w-full flex-col items-start gap-4 rounded-xl border-[1px] border-gray-300 p-6">
111+
<div className="flex w-full items-center justify-between">
112+
<p className="text-base font-semibold text-black">
110113
Respond to assistant
111114
</p>
112115
<ResetButton
@@ -120,8 +123,8 @@ function ResponseComponent({
120123
<ArgsRenderer args={interruptValue.action_request.args} />
121124
)}
122125

123-
<div className="flex flex-col gap-[6px] items-start w-full">
124-
<p className="text-sm min-w-fit font-medium">Response</p>
126+
<div className="flex w-full flex-col items-start gap-[6px]">
127+
<p className="min-w-fit text-sm font-medium">Response</p>
125128
<Textarea
126129
disabled={streaming}
127130
value={res.args}
@@ -132,8 +135,12 @@ function ResponseComponent({
132135
/>
133136
</div>
134137

135-
<div className="flex items-center justify-end w-full gap-2">
136-
<Button variant="brand" disabled={streaming} onClick={handleSubmit}>
138+
<div className="flex w-full items-center justify-end gap-2">
139+
<Button
140+
variant="brand"
141+
disabled={streaming}
142+
onClick={handleSubmit}
143+
>
137144
Send Response
138145
</Button>
139146
</div>
@@ -154,7 +161,7 @@ function AcceptComponent({
154161
) => Promise<void>;
155162
}) {
156163
return (
157-
<div className="flex flex-col gap-4 items-start w-full p-6 rounded-lg border-[1px] border-gray-300">
164+
<div className="flex w-full flex-col items-start gap-4 rounded-lg border-[1px] border-gray-300 p-6">
158165
{actionRequestArgs && Object.keys(actionRequestArgs).length > 0 && (
159166
<ArgsRenderer args={actionRequestArgs} />
160167
)}
@@ -251,9 +258,9 @@ function EditAndOrAcceptComponent({
251258
};
252259

253260
return (
254-
<div className="flex flex-col gap-4 items-start w-full p-6 rounded-lg border-[1px] border-gray-300">
255-
<div className="flex items-center justify-between w-full">
256-
<p className="font-semibold text-black text-base">{header}</p>
261+
<div className="flex w-full flex-col items-start gap-4 rounded-lg border-[1px] border-gray-300 p-6">
262+
<div className="flex w-full items-center justify-between">
263+
<p className="text-base font-semibold text-black">{header}</p>
257264
<ResetButton handleReset={handleReset} />
258265
</div>
259266

@@ -276,11 +283,11 @@ function EditAndOrAcceptComponent({
276283

277284
return (
278285
<div
279-
className="flex flex-col gap-1 items-start w-full h-full px-[1px]"
286+
className="flex h-full w-full flex-col items-start gap-1 px-[1px]"
280287
key={`allow-edit-args--${k}-${idx}`}
281288
>
282-
<div className="flex flex-col gap-[6px] items-start w-full">
283-
<p className="text-sm min-w-fit font-medium">{prettifyText(k)}</p>
289+
<div className="flex w-full flex-col items-start gap-[6px]">
290+
<p className="min-w-fit text-sm font-medium">{prettifyText(k)}</p>
284291
<Textarea
285292
disabled={streaming}
286293
className="h-full"
@@ -294,8 +301,12 @@ function EditAndOrAcceptComponent({
294301
);
295302
})}
296303

297-
<div className="flex items-center justify-end w-full gap-2">
298-
<Button variant="brand" disabled={streaming} onClick={handleSubmit}>
304+
<div className="flex w-full items-center justify-end gap-2">
305+
<Button
306+
variant="brand"
307+
disabled={streaming}
308+
onClick={handleSubmit}
309+
>
299310
{buttonText}
300311
</Button>
301312
</div>
@@ -480,12 +491,12 @@ export function InboxItemInput({
480491
};
481492

482493
return (
483-
<div className="w-full flex flex-col items-start justify-start gap-2">
494+
<div className="flex w-full flex-col items-start justify-start gap-2">
484495
{showArgsOutsideActionCards && (
485496
<ArgsRenderer args={interruptValue.action_request.args} />
486497
)}
487498

488-
<div className="flex flex-col gap-2 items-start w-full">
499+
<div className="flex w-full flex-col items-start gap-2">
489500
<EditAndOrAccept
490501
humanResponse={humanResponse}
491502
streaming={streaming}
@@ -495,7 +506,7 @@ export function InboxItemInput({
495506
handleSubmit={handleSubmit}
496507
/>
497508
{supportsMultipleMethods ? (
498-
<div className="flex gap-3 items-center mx-auto mt-3">
509+
<div className="mx-auto mt-3 flex items-center gap-3">
499510
<Separator className="w-[full]" />
500511
<p className="text-sm text-gray-500">Or</p>
501512
<Separator className="w-full" />
@@ -511,7 +522,7 @@ export function InboxItemInput({
511522
/>
512523
{streaming && <p className="text-sm text-gray-600">Running...</p>}
513524
{streamFinished && (
514-
<p className="text-base text-green-600 font-medium">
525+
<p className="text-base font-medium text-green-600">
515526
Successfully finished Graph invocation.
516527
</p>
517528
)}

0 commit comments

Comments
 (0)