Skip to content

Commit 28e5c54

Browse files
committed
chore: lint and structure across components for consistency, upgrade deps.
1 parent ae2b697 commit 28e5c54

46 files changed

Lines changed: 511 additions & 560 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/(auth)/login/login-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function LoginForm({ redirectTo }: { redirectTo: string }) {
7979
required
8080
/>
8181
</div>
82-
{error ? <p className="text-sm text-destructive">{error}</p> : null}
82+
{error ? <p className="text-destructive text-sm">{error}</p> : null}
8383
<Button type="submit" disabled={submitting}>
8484
{submitting ? 'Signing in...' : 'Sign in'}
8585
</Button>

app/(auth)/login/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default async function LoginPage({
4040
if (!authConfig.isConfigured) {
4141
return (
4242
<main className="min-h-dvh bg-gradient-to-b from-background to-muted/20 px-6 py-12">
43-
<div className="mx-auto flex flex-col min-h-[70dvh] max-w-5xl items-center justify-center">
43+
<div className="mx-auto flex min-h-[70dvh] max-w-5xl flex-col items-center justify-center">
4444
<Card className="w-full max-w-2xl border-border/60 shadow-sm">
4545
<CardHeader>
4646
<CardTitle>Authentication setup required</CardTitle>
@@ -50,7 +50,7 @@ export default async function LoginPage({
5050
</CardDescription>
5151
</CardHeader>
5252
<CardContent className="space-y-4">
53-
<div className="rounded-md border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-950 dark:text-amber-100">
53+
<div className="rounded-md border border-amber-500/30 bg-amber-500/10 p-4 text-amber-950 text-sm dark:text-amber-100">
5454
<p>
5555
Add the missing variables to <code>.env.local</code> or{' '}
5656
<code>.env</code>, then restart the app.
@@ -60,15 +60,15 @@ export default async function LoginPage({
6060
</p>
6161
</div>
6262
<div className="space-y-2">
63-
<p className="text-sm font-medium">Example env file</p>
63+
<p className="font-medium text-sm">Example env file</p>
6464
<pre className="overflow-x-auto rounded-md bg-zinc-950 p-4 text-sm text-zinc-50">
6565
<code>{authConfig.exampleEnvFile}</code>
6666
</pre>
6767
</div>
6868
</CardContent>
6969
</Card>
7070
<div className="mt-6 w-full max-w-2xl text-center">
71-
<p className="text-sm text-muted-foreground">
71+
<p className="text-muted-foreground text-sm">
7272
Powered by{' '}
7373
<a
7474
href="https://github.com/Niapya/clawless"
@@ -95,10 +95,10 @@ export default async function LoginPage({
9595

9696
return (
9797
<main className="min-h-dvh bg-gradient-to-b from-background to-muted/20 px-6 py-12">
98-
<div className="mx-auto flex flex-col min-h-[70dvh] max-w-5xl items-center justify-center">
98+
<div className="mx-auto flex min-h-[70dvh] max-w-5xl flex-col items-center justify-center">
9999
<LoginForm redirectTo={nextPath} />
100100
<div className="mt-6 w-full max-w-2xl text-center">
101-
<p className="text-sm text-muted-foreground">
101+
<p className="text-muted-foreground text-sm">
102102
Powered by{' '}
103103
<a
104104
href="https://github.com/Niapya/clawless"

app/(workspace)/files/page.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ export default function FilesPage() {
150150
);
151151

152152
return (
153-
<div className="flex min-w-0 h-dvh flex-col bg-background">
153+
<div className="flex h-dvh min-w-0 flex-col bg-background">
154154
<header className="sticky top-0 z-10 border-b bg-background/95 px-4 py-3 backdrop-blur">
155155
<div className="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
156156
<div>
157-
<h1 className="text-lg font-semibold">Files</h1>
158-
<p className="text-sm text-muted-foreground">
157+
<h1 className="font-semibold text-lg">Files</h1>
158+
<p className="text-muted-foreground text-sm">
159159
Browse sandbox exports and jump back to the related session.
160160
</p>
161161
</div>
@@ -185,7 +185,7 @@ export default function FilesPage() {
185185
</CardHeader>
186186
<CardContent className="flex flex-col gap-3 md:flex-row md:items-center">
187187
<div className="relative w-full md:max-w-md">
188-
<Search className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
188+
<Search className="-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 size-4 text-muted-foreground" />
189189
<Input
190190
className="pl-9"
191191
placeholder="Filter by session ID"
@@ -217,7 +217,7 @@ export default function FilesPage() {
217217
</CardContent>
218218
</Card>
219219

220-
<div className="text-sm text-muted-foreground">
220+
<div className="text-muted-foreground text-sm">
221221
{summary.filter
222222
? `Showing ${summary.total} file(s) for session ${summary.filter}`
223223
: `Showing ${summary.total} file(s) from all sessions`}
@@ -237,23 +237,23 @@ export default function FilesPage() {
237237
{items.map((item) => (
238238
<Card key={item.id}>
239239
<CardContent className="flex flex-col gap-3 pt-4 md:flex-row md:items-start md:justify-between">
240-
<div className="space-y-2 min-w-0">
240+
<div className="min-w-0 space-y-2">
241241
<div className="flex items-center gap-2">
242242
<FileArchive className="size-4 text-muted-foreground" />
243-
<p className="text-sm font-medium break-all">
243+
<p className="break-all font-medium text-sm">
244244
{item.fileName}
245245
</p>
246246
</div>
247-
<div className="text-xs text-muted-foreground break-all">
247+
<div className="break-all text-muted-foreground text-xs">
248248
Source: {item.sourcePath}
249249
</div>
250-
<div className="flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground">
250+
<div className="flex flex-wrap gap-x-4 gap-y-1 text-muted-foreground text-xs">
251251
<span>Size: {formatBytes(item.size)}</span>
252252
<span>MIME: {item.mimeType}</span>
253253
<span>Created: {formatDate(item.createdAt)}</span>
254254
<span>Session: {shortSessionId(item.sessionId)}</span>
255255
</div>
256-
<div className="text-xs text-muted-foreground">
256+
<div className="text-muted-foreground text-xs">
257257
{item.sessionTitle
258258
? `Session title: ${item.sessionTitle}`
259259
: `Channel: ${item.sessionChannel ?? 'unknown'}`}

app/(workspace)/memory/page.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export default function MemoryPage() {
5555
const [activeScope, setActiveScope] = useState<Scope>('builtin');
5656

5757
return (
58-
<div className="flex flex-col min-w-0 h-dvh bg-background">
59-
<header className="flex sticky top-0 bg-background py-3 items-center px-4 border-b">
60-
<h1 className="text-lg font-semibold">Memory</h1>
58+
<div className="flex h-dvh min-w-0 flex-col bg-background">
59+
<header className="sticky top-0 flex items-center border-b bg-background px-4 py-3">
60+
<h1 className="font-semibold text-lg">Memory</h1>
6161
</header>
6262

63-
<div className="flex-1 overflow-y-auto p-4 space-y-4">
63+
<div className="flex-1 space-y-4 overflow-y-auto p-4">
6464
{/* Scope tabs */}
6565
<div className="flex flex-wrap items-center gap-2">
6666
{(['builtin', 'long_term', 'session'] as Scope[]).map((scope) => (
@@ -149,7 +149,7 @@ function BuiltinPanel() {
149149
<div className="space-y-4">
150150
<Card>
151151
<CardHeader className="space-y-3">
152-
<p className="text-sm text-muted-foreground">
152+
<p className="text-muted-foreground text-sm">
153153
These built-in memories are used to build system prompts, making
154154
your Agent customizable to you.
155155
</p>
@@ -158,7 +158,7 @@ function BuiltinPanel() {
158158
{BUILTIN_KEYS.map((key) => (
159159
<Card key={key}>
160160
<CardHeader className="pb-2">
161-
<CardTitle className="text-sm font-mono">{key}</CardTitle>
161+
<CardTitle className="font-mono text-sm">{key}</CardTitle>
162162
</CardHeader>
163163
<CardContent className="space-y-2">
164164
<Textarea
@@ -170,7 +170,7 @@ function BuiltinPanel() {
170170
placeholder={`${key} content...`}
171171
/>
172172
<div className="flex items-center justify-between">
173-
<span className="text-xs text-muted-foreground">
173+
<span className="text-muted-foreground text-xs">
174174
{memories[key]?.updatedAt
175175
? `Updated: ${new Date(memories[key].updatedAt).toLocaleString()}`
176176
: 'Not set'}
@@ -181,9 +181,9 @@ function BuiltinPanel() {
181181
onClick={() => saveKey(key)}
182182
>
183183
{savingKey === key ? (
184-
<Loader2 className="size-4 animate-spin mr-1" />
184+
<Loader2 className="mr-1 size-4 animate-spin" />
185185
) : (
186-
<Save className="size-4 mr-1" />
186+
<Save className="mr-1 size-4" />
187187
)}
188188
Save
189189
</Button>
@@ -264,11 +264,11 @@ function LongTermPanel() {
264264
<Card>
265265
<CardHeader>
266266
<CardTitle className="text-base">Add Long-term Memory</CardTitle>
267-
<p className="text-sm text-muted-foreground">
267+
<p className="text-muted-foreground text-sm">
268268
Claw can remember your preferences and knowledge across this
269269
single-user project.
270270
</p>
271-
<p className="text-sm text-muted-foreground">
271+
<p className="text-muted-foreground text-sm">
272272
Setting the <span className="font-medium">embedding model</span> in
273273
the AI configuration can make retrieval more accurate, but memory
274274
still saves even if embeddings are unavailable.
@@ -284,9 +284,9 @@ function LongTermPanel() {
284284
<div className="flex justify-end">
285285
<Button onClick={create} disabled={creating}>
286286
{creating ? (
287-
<Loader2 className="size-4 animate-spin mr-1" />
287+
<Loader2 className="mr-1 size-4 animate-spin" />
288288
) : (
289-
<Plus className="size-4 mr-1" />
289+
<Plus className="mr-1 size-4" />
290290
)}
291291
Add
292292
</Button>
@@ -299,17 +299,17 @@ function LongTermPanel() {
299299
<Loader2 className="size-6 animate-spin text-muted-foreground" />
300300
</div>
301301
) : memories.length === 0 ? (
302-
<div className="text-sm text-muted-foreground p-6 border border-dashed rounded-lg text-center">
302+
<div className="rounded-lg border border-dashed p-6 text-center text-muted-foreground text-sm">
303303
No long-term memories yet
304304
</div>
305305
) : (
306306
<div className="space-y-3">
307307
{memories.map((item) => (
308308
<Card key={item.id}>
309-
<CardContent className="pt-4 space-y-2">
310-
<p className="text-sm whitespace-pre-wrap">{item.content}</p>
309+
<CardContent className="space-y-2 pt-4">
310+
<p className="whitespace-pre-wrap text-sm">{item.content}</p>
311311
<div className="flex items-center justify-between">
312-
<span className="text-xs text-muted-foreground">
312+
<span className="text-muted-foreground text-xs">
313313
{new Date(item.createdAt).toLocaleString()}
314314
</span>
315315
<Button
@@ -365,7 +365,7 @@ function SessionPanel() {
365365
<Card>
366366
<CardHeader>
367367
<CardTitle className="text-base">Session Summaries</CardTitle>
368-
<p className="text-sm text-muted-foreground">
368+
<p className="text-muted-foreground text-sm">
369369
Session memory is isolated within each session, which is especially
370370
useful for long sessions.
371371
</p>
@@ -386,7 +386,7 @@ function SessionPanel() {
386386
</Card>
387387

388388
{summaries.length === 0 ? (
389-
<div className="text-sm text-muted-foreground p-6 border border-dashed rounded-lg text-center">
389+
<div className="rounded-lg border border-dashed p-6 text-center text-muted-foreground text-sm">
390390
{sessionId.trim()
391391
? 'No summaries for this session'
392392
: 'Enter a session ID to view summaries'}
@@ -395,19 +395,19 @@ function SessionPanel() {
395395
<div className="space-y-3">
396396
{summaries.map((s) => (
397397
<Card key={s.id}>
398-
<CardContent className="pt-4 space-y-2">
398+
<CardContent className="space-y-2 pt-4">
399399
<div className="flex items-center gap-2">
400-
<code className="px-2 py-0.5 rounded bg-muted text-xs">
400+
<code className="rounded bg-muted px-2 py-0.5 text-xs">
401401
v{s.summaryVersion}
402402
</code>
403403
{s.isCurrent && (
404-
<span className="text-xs font-medium text-green-600">
404+
<span className="font-medium text-green-600 text-xs">
405405
current
406406
</span>
407407
)}
408408
</div>
409-
<p className="text-sm whitespace-pre-wrap">{s.content}</p>
410-
<span className="text-xs text-muted-foreground block">
409+
<p className="whitespace-pre-wrap text-sm">{s.content}</p>
410+
<span className="block text-muted-foreground text-xs">
411411
{new Date(s.createdAt).toLocaleString()}
412412
</span>
413413
</CardContent>

app/(workspace)/schedule/page.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ export default function SchedulePage() {
271271
}
272272

273273
return (
274-
<div className="flex min-w-0 h-dvh flex-col bg-background">
274+
<div className="flex h-dvh min-w-0 flex-col bg-background">
275275
<header className="sticky top-0 z-10 border-b bg-background/95 px-4 py-3 backdrop-blur">
276276
<div className="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
277277
<div>
278-
<h1 className="text-lg font-semibold">Schedule</h1>
279-
<p className="text-sm text-muted-foreground">
278+
<h1 className="font-semibold text-lg">Schedule</h1>
279+
<p className="text-muted-foreground text-sm">
280280
View, edit, and archive delayed or daily tasks.
281281
</p>
282282
</div>
@@ -381,7 +381,7 @@ function SummaryCard(input: { title: string; value: string; hint: string }) {
381381
<CardTitle className="text-3xl">{input.value}</CardTitle>
382382
</CardHeader>
383383
<CardContent>
384-
<p className="text-sm text-muted-foreground">{input.hint}</p>
384+
<p className="text-muted-foreground text-sm">{input.hint}</p>
385385
</CardContent>
386386
</Card>
387387
);
@@ -406,13 +406,13 @@ function TaskSection(input: {
406406
return (
407407
<section className="space-y-3">
408408
<div>
409-
<h2 className="text-base font-semibold">{input.title}</h2>
410-
<p className="text-sm text-muted-foreground">{input.description}</p>
409+
<h2 className="font-semibold text-base">{input.title}</h2>
410+
<p className="text-muted-foreground text-sm">{input.description}</p>
411411
</div>
412412

413413
{input.tasks.length === 0 ? (
414414
<Card className="border-dashed">
415-
<CardContent className="py-6 text-sm text-muted-foreground">
415+
<CardContent className="py-6 text-muted-foreground text-sm">
416416
{input.emptyText}
417417
</CardContent>
418418
</Card>
@@ -498,7 +498,7 @@ function TaskCard(input: {
498498
<CardTitle className={archived ? 'text-sm' : 'text-base'}>
499499
{draft.title.trim() || 'Untitled Task'}
500500
</CardTitle>
501-
<span className="rounded-full border px-2 py-0.5 text-xs uppercase tracking-wide text-muted-foreground">
501+
<span className="rounded-full border px-2 py-0.5 text-muted-foreground text-xs uppercase tracking-wide">
502502
{draft.type}
503503
</span>
504504
<span
@@ -527,7 +527,7 @@ function TaskCard(input: {
527527
</span>
528528
</div>
529529

530-
<div className="grid gap-3 text-xs text-muted-foreground sm:grid-cols-2 xl:grid-cols-4">
530+
<div className="grid gap-3 text-muted-foreground text-xs sm:grid-cols-2 xl:grid-cols-4">
531531
<MetaItem label="Next Run" value={formatDateTime(task.nextRunAt)} />
532532
<MetaItem
533533
label="Last Triggered"
@@ -637,7 +637,7 @@ function TaskCard(input: {
637637
</Field>
638638

639639
<div className="flex flex-wrap items-center justify-between gap-3 border-t pt-4">
640-
<p className="text-xs text-muted-foreground">
640+
<p className="text-muted-foreground text-xs">
641641
Created {formatDateTime(task.createdAt)} · Updated{' '}
642642
{formatDateTime(task.updatedAt)}
643643
</p>
@@ -698,7 +698,7 @@ function Field(input: {
698698
}) {
699699
return (
700700
<div className="space-y-2">
701-
<span className="text-sm font-medium">{input.label}</span>
701+
<span className="font-medium text-sm">{input.label}</span>
702702
{input.children}
703703
</div>
704704
);
@@ -707,10 +707,10 @@ function Field(input: {
707707
function MetaItem(input: { label: string; value: string }) {
708708
return (
709709
<div className="rounded-md border bg-background/70 px-3 py-2">
710-
<p className="text-[11px] uppercase tracking-wide text-muted-foreground">
710+
<p className="text-[11px] text-muted-foreground uppercase tracking-wide">
711711
{input.label}
712712
</p>
713-
<p className="mt-1 truncate text-sm text-foreground">{input.value}</p>
713+
<p className="mt-1 truncate text-foreground text-sm">{input.value}</p>
714714
</div>
715715
);
716716
}

0 commit comments

Comments
 (0)