Skip to content

Commit 965e8a4

Browse files
committed
Enable tailwind class sorting.
1 parent b732985 commit 965e8a4

File tree

11 files changed

+68
-65
lines changed

11 files changed

+68
-65
lines changed

browser-extension/biome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
"noUnusedVariables": "error",
4848
"useValidTypeof": "error"
4949
},
50+
"nursery": {
51+
"useSortedClasses": "error"
52+
},
5053
"recommended": true,
5154
"style": {
5255
"noDefaultExport": "off",

browser-extension/src/components/Badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Badge = ({ text, type }: BadgeProps) => {
1717
}),
1818
)}
1919
>
20-
{type === 'blank' || <Icon className='w-3 h-3' />}
20+
{type === 'blank' || <Icon className='h-3 w-3' />}
2121
{text || type}
2222
</span>
2323
)

browser-extension/src/components/MultiSegment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const MultiSegment = <T,>({ segments, value, onValueChange }: MultiSegmentProps<
3939
onClick={() => onValueChange(segment.value)}
4040
type='button'
4141
>
42-
{segment.type === 'blank' || <Icon className='w-3 h-3' />}
42+
{segment.type === 'blank' || <Icon className='h-3 w-3' />}
4343
{segment.text}
4444
</button>
4545
)

browser-extension/src/components/PopupRoot.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@ export function PopupRoot({ drafts }: PopupRootProps) {
109109
<div className='bg-white'>
110110
{/* Bulk actions bar - floating popup */}
111111
{selectedIds.size > 0 && (
112-
<div className='fixed bottom-6 left-1/2 transform -translate-x-1/2 p-3 bg-blue-50 rounded-md shadow-lg border border-blue-200 flex items-center gap-3 z-50'>
113-
<span className='text-sm font-medium'>{selectedIds.size} selected</span>
114-
<button type='button' className='text-sm text-blue-600 hover:underline'>
112+
<div className='-translate-x-1/2 fixed bottom-6 left-1/2 z-50 flex transform items-center gap-3 rounded-md border border-blue-200 bg-blue-50 p-3 shadow-lg'>
113+
<span className='font-medium text-sm'>{selectedIds.size} selected</span>
114+
<button type='button' className='text-blue-600 text-sm hover:underline'>
115115
Copy
116116
</button>
117-
<button type='button' className='text-sm text-blue-600 hover:underline'>
117+
<button type='button' className='text-blue-600 text-sm hover:underline'>
118118
Preview
119119
</button>
120-
<button type='button' className='text-sm text-blue-600 hover:underline'>
120+
<button type='button' className='text-blue-600 text-sm hover:underline'>
121121
Discard
122122
</button>
123-
<button type='button' className='text-sm text-blue-600 hover:underline'>
123+
<button type='button' className='text-blue-600 text-sm hover:underline'>
124124
Open
125125
</button>
126126
</div>
@@ -133,7 +133,7 @@ export function PopupRoot({ drafts }: PopupRootProps) {
133133
<col className='w-10' />
134134
<col />
135135
</colgroup>
136-
<thead className='border-b border-gray-400'>
136+
<thead className='border-gray-400 border-b'>
137137
<tr>
138138
<th scope='col' className='px-3 py-3'>
139139
<input
@@ -144,20 +144,20 @@ export function PopupRoot({ drafts }: PopupRootProps) {
144144
className='rounded'
145145
/>
146146
</th>
147-
<th scope='col' className='px-3 py-3 text-left text-xs text-gray-500'>
147+
<th scope='col' className='px-3 py-3 text-left text-gray-500 text-xs'>
148148
<div className='relative'>
149149
<div className='flex items-center gap-1'>
150150
<div className='relative flex-1'>
151-
<Search className='absolute left-1 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400' />
151+
<Search className='-translate-y-1/2 absolute top-1/2 left-1 h-4 w-4 text-gray-400' />
152152
<input
153153
type='text'
154154
placeholder='Search drafts...'
155155
value={filters.searchQuery}
156156
onChange={(e) => updateFilter('searchQuery', e.target.value)}
157-
className='w-full pl-5 pr-3 h-5 border border-gray-300 rounded-sm text-sm font-normal focus:outline-none focus:border-blue-500'
157+
className='h-5 w-full rounded-sm border border-gray-300 pr-3 pl-5 font-normal text-sm focus:border-blue-500 focus:outline-none'
158158
/>
159159
</div>
160-
<div className='relative flex overflow-hidden gap-1'>
160+
<div className='relative flex gap-1 overflow-hidden'>
161161
<button
162162
type='button'
163163
onClick={() => updateFilter('showTrashed', !filters.showTrashed)}
@@ -169,11 +169,11 @@ export function PopupRoot({ drafts }: PopupRootProps) {
169169
'border',
170170
)}
171171
>
172-
<Trash2 className='w-3 h-3' />
172+
<Trash2 className='h-3 w-3' />
173173
{filters.showTrashed ? (
174-
<Eye className='w-3 h-3' />
174+
<Eye className='h-3 w-3' />
175175
) : (
176-
<EyeOff className='w-3 h-3' />
176+
<EyeOff className='h-3 w-3' />
177177
)}
178178
</button>
179179
<MultiSegment<FilterState['sentFilter']>
@@ -207,7 +207,7 @@ export function PopupRoot({ drafts }: PopupRootProps) {
207207
'border',
208208
)}
209209
>
210-
<Settings className='w-3 h-3' />
210+
<Settings className='h-3 w-3' />
211211
</button>
212212
</div>
213213
</div>
@@ -244,11 +244,11 @@ function commentRow(
244244
<td className='px-3 py-3'>
245245
<div className='space-y-1'>
246246
{/* Context line */}
247-
<div className='flex items-center justify-between gap-1.5 text-xs text-gray-600'>
248-
<div className='flex items-center gap-1.5 min-w-0 flex-1'>
247+
<div className='flex items-center justify-between gap-1.5 text-gray-600 text-xs'>
248+
<div className='flex min-w-0 flex-1 items-center gap-1.5'>
249249
{enhancer.tableUpperDecoration(row.spot)}
250250
</div>
251-
<div className='flex items-center gap-1 flex-shrink-0'>
251+
<div className='flex flex-shrink-0 items-center gap-1'>
252252
{row.latestDraft.stats.links.length > 0 && (
253253
<Badge type='link' text={row.latestDraft.stats.links.length} />
254254
)}
@@ -266,14 +266,14 @@ function commentRow(
266266

267267
{/* Title */}
268268
<div className='flex items-center gap-1'>
269-
<a href='TODO' className='text-sm font-medium hover:underline truncate'>
269+
<a href='TODO' className='truncate font-medium text-sm hover:underline'>
270270
{enhancer.tableTitle(row.spot)}
271271
</a>
272272
<Badge type={row.isSent ? 'sent' : 'unsent'} />
273273
{row.isTrashed && <Badge type='trashed' />}
274274
</div>
275275
{/* Draft */}
276-
<div className='text-sm truncate'>
276+
<div className='truncate text-sm'>
277277
<span className='text-gray-500'>{row.latestDraft.content.substring(0, 100)}</span>
278278
</div>
279279
</div>
@@ -283,9 +283,9 @@ function commentRow(
283283
}
284284

285285
const EmptyState = () => (
286-
<div className='max-w-4xl mx-auto text-center py-16'>
287-
<h2 className='text-2xl font-semibold mb-4'>No comments open</h2>
288-
<p className='text-gray-600 mb-6'>
286+
<div className='mx-auto max-w-4xl py-16 text-center'>
287+
<h2 className='mb-4 font-semibold text-2xl'>No comments open</h2>
288+
<p className='mb-6 text-gray-600'>
289289
Your drafts will appear here when you start typing in comment boxes across GitHub and Reddit.
290290
</p>
291291
<div className='space-y-2'>
@@ -301,8 +301,8 @@ const EmptyState = () => (
301301
)
302302

303303
const NoMatchesState = ({ onClearFilters }: { onClearFilters: () => void }) => (
304-
<div className='text-center py-16'>
305-
<p className='text-gray-600 mb-4'>No matches found</p>
304+
<div className='py-16 text-center'>
305+
<p className='mb-4 text-gray-600'>No matches found</p>
306306
<button type='button' onClick={onClearFilters} className='text-blue-600 hover:underline'>
307307
Clear filters
308308
</button>

browser-extension/src/lib/enhancers/CommentEnhancerMissing.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class CommentEnhancerMissing implements CommentEnhancer {
88
return (
99
<button
1010
type='button'
11-
className='relative inline-block border-none bg-transparent p-0 text-left cursor-pointer underline'
11+
className='relative inline-block cursor-pointer border-none bg-transparent p-0 text-left underline'
1212
style={{
1313
display: 'inline-block',
1414
position: 'relative',
@@ -24,10 +24,10 @@ export class CommentEnhancerMissing implements CommentEnhancer {
2424
>
2525
hover for json
2626
<div
27-
className='popup absolute top-full left-0 bg-gray-100 border border-gray-300 rounded shadow-lg p-2 z-50 min-w-[320px]'
27+
className='popup absolute top-full left-0 z-50 min-w-[320px] rounded border border-gray-300 bg-gray-100 p-2 shadow-lg'
2828
style={{ display: 'none' }}
2929
>
30-
<pre className='m-0 text-xs font-mono select-text cursor-text whitespace-pre-wrap break-words'>
30+
<pre className='m-0 cursor-text select-text whitespace-pre-wrap break-words font-mono text-xs'>
3131
{JSON.stringify(spot, null, 2)}
3232
</pre>
3333
</div>

browser-extension/src/lib/enhancers/github/githubIssueAddComment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export class GitHubIssueAddCommentEnhancer implements CommentEnhancer<GitHubIssu
6262
tableUpperDecoration(spot: GitHubIssueAddCommentSpot): React.ReactNode {
6363
return (
6464
<>
65-
<span className='w-4 h-4 flex items-center justify-center flex-shrink-0'>
65+
<span className='flex h-4 w-4 flex-shrink-0 items-center justify-center'>
6666
<IssueOpenedIcon size={16} />
6767
</span>
6868
#{spot.number}
69-
<a href={`https://${spot.domain}/${spot.slug}`} className='hover:underline truncate'>
69+
<a href={`https://${spot.domain}/${spot.slug}`} className='truncate hover:underline'>
7070
{spot.slug}
7171
</a>
7272
</>

browser-extension/src/lib/enhancers/github/githubIssueNewComment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class GitHubIssueNewCommentEnhancer implements CommentEnhancer<GitHubIssu
5757
return (
5858
<>
5959
<span>New Issue</span>
60-
<span className='font-mono text-sm text-muted-foreground'> {slug} </span>
60+
<span className='font-mono text-muted-foreground text-sm'> {slug} </span>
6161
</>
6262
)
6363
}

browser-extension/src/lib/enhancers/github/githubPRAddComment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class GitHubPRAddCommentEnhancer implements CommentEnhancer<GitHubPRAddCo
6767
const { slug, number } = spot
6868
return (
6969
<>
70-
<span className='font-mono text-sm text-muted-foreground'>{slug}</span>
70+
<span className='font-mono text-muted-foreground text-sm'>{slug}</span>
7171
<span className='ml-2 font-medium'>PR #{number}</span>
7272
</>
7373
)

browser-extension/src/lib/enhancers/github/githubPRNewComment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class GitHubPRNewCommentEnhancer implements CommentEnhancer<GitHubPRNewCo
6262
return (
6363
<>
6464
<span>New PR</span>
65-
<span className='font-mono text-sm text-muted-foreground'> {slug} </span>
65+
<span className='font-mono text-muted-foreground text-sm'> {slug} </span>
6666
</>
6767
)
6868
}

browser-extension/tests/playground/claude.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ export const ClaudePrototype = () => {
105105
<div className='bg-white'>
106106
{/* Bulk actions bar - floating popup */}
107107
{selectedIds.size > 0 && (
108-
<div className='fixed bottom-6 left-1/2 transform -translate-x-1/2 p-3 bg-blue-50 rounded-md shadow-lg border border-blue-200 flex items-center gap-3 z-50'>
109-
<span className='text-sm font-medium'>{selectedIds.size} selected</span>
110-
<button type='button' className='text-sm text-blue-600 hover:underline'>
108+
<div className='-translate-x-1/2 fixed bottom-6 left-1/2 z-50 flex transform items-center gap-3 rounded-md border border-blue-200 bg-blue-50 p-3 shadow-lg'>
109+
<span className='font-medium text-sm'>{selectedIds.size} selected</span>
110+
<button type='button' className='text-blue-600 text-sm hover:underline'>
111111
Copy
112112
</button>
113-
<button type='button' className='text-sm text-blue-600 hover:underline'>
113+
<button type='button' className='text-blue-600 text-sm hover:underline'>
114114
Preview
115115
</button>
116-
<button type='button' className='text-sm text-blue-600 hover:underline'>
116+
<button type='button' className='text-blue-600 text-sm hover:underline'>
117117
Discard
118118
</button>
119-
<button type='button' className='text-sm text-blue-600 hover:underline'>
119+
<button type='button' className='text-blue-600 text-sm hover:underline'>
120120
Open
121121
</button>
122122
</div>
@@ -129,7 +129,7 @@ export const ClaudePrototype = () => {
129129
<col className='w-10' />
130130
<col />
131131
</colgroup>
132-
<thead className='border-b border-gray-400'>
132+
<thead className='border-gray-400 border-b'>
133133
<tr>
134134
<th scope='col' className='px-3 py-3'>
135135
<input
@@ -140,20 +140,20 @@ export const ClaudePrototype = () => {
140140
className='rounded'
141141
/>
142142
</th>
143-
<th scope='col' className='px-3 py-3 text-left text-xs text-gray-500'>
143+
<th scope='col' className='px-3 py-3 text-left text-gray-500 text-xs'>
144144
<div className='relative'>
145145
<div className='flex items-center gap-1'>
146146
<div className='relative flex-1'>
147-
<Search className='absolute left-1 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400' />
147+
<Search className='-translate-y-1/2 absolute top-1/2 left-1 h-4 w-4 text-gray-400' />
148148
<input
149149
type='text'
150150
placeholder='Search drafts...'
151151
value={filters.searchQuery}
152152
onChange={(e) => updateFilter('searchQuery', e.target.value)}
153-
className='w-full pl-5 pr-3 h-5 border border-gray-300 rounded-sm text-sm font-normal focus:outline-none focus:border-blue-500'
153+
className='h-5 w-full rounded-sm border border-gray-300 pr-3 pl-5 font-normal text-sm focus:border-blue-500 focus:outline-none'
154154
/>
155155
</div>
156-
<div className='relative flex overflow-hidden gap-1'>
156+
<div className='relative flex gap-1 overflow-hidden'>
157157
<button
158158
type='button'
159159
onClick={() => updateFilter('showTrashed', !filters.showTrashed)}
@@ -165,11 +165,11 @@ export const ClaudePrototype = () => {
165165
'border',
166166
)}
167167
>
168-
<Trash2 className='w-3 h-3' />
168+
<Trash2 className='h-3 w-3' />
169169
{filters.showTrashed ? (
170-
<Eye className='w-3 h-3' />
170+
<Eye className='h-3 w-3' />
171171
) : (
172-
<EyeOff className='w-3 h-3' />
172+
<EyeOff className='h-3 w-3' />
173173
)}
174174
</button>
175175
<MultiSegment<FilterState['sentFilter']>
@@ -203,7 +203,7 @@ export const ClaudePrototype = () => {
203203
'border',
204204
)}
205205
>
206-
<Settings className='w-3 h-3' />
206+
<Settings className='h-3 w-3' />
207207
</button>
208208
</div>
209209
</div>
@@ -240,11 +240,11 @@ function commentRow(
240240
<td className='px-3 py-3'>
241241
<div className='space-y-1'>
242242
{/* Context line */}
243-
<div className='flex items-center justify-between gap-1.5 text-xs text-gray-600'>
244-
<div className='flex items-center gap-1.5 min-w-0 flex-1'>
243+
<div className='flex items-center justify-between gap-1.5 text-gray-600 text-xs'>
244+
<div className='flex min-w-0 flex-1 items-center gap-1.5'>
245245
{enhancer.tableUpperDecoration(row.spot)}
246246
</div>
247-
<div className='flex items-center gap-1 flex-shrink-0'>
247+
<div className='flex flex-shrink-0 items-center gap-1'>
248248
{row.latestDraft.stats.links.length > 0 && (
249249
<Badge type='link' text={row.latestDraft.stats.links.length} />
250250
)}
@@ -262,14 +262,14 @@ function commentRow(
262262

263263
{/* Title */}
264264
<div className='flex items-center gap-1'>
265-
<a href='TODO' className='text-sm font-medium hover:underline truncate'>
265+
<a href='TODO' className='truncate font-medium text-sm hover:underline'>
266266
{enhancer.tableTitle(row.spot)}
267267
</a>
268268
<Badge type={row.isSent ? 'sent' : 'unsent'} />
269269
{row.isTrashed && <Badge type='trashed' />}
270270
</div>
271271
{/* Draft */}
272-
<div className='text-sm truncate'>
272+
<div className='truncate text-sm'>
273273
<span className='text-gray-500'>{row.latestDraft.content.substring(0, 100)}</span>
274274
</div>
275275
</div>
@@ -279,9 +279,9 @@ function commentRow(
279279
}
280280

281281
const EmptyState = () => (
282-
<div className='max-w-4xl mx-auto text-center py-16'>
283-
<h2 className='text-2xl font-semibold mb-4'>No comments open</h2>
284-
<p className='text-gray-600 mb-6'>
282+
<div className='mx-auto max-w-4xl py-16 text-center'>
283+
<h2 className='mb-4 font-semibold text-2xl'>No comments open</h2>
284+
<p className='mb-6 text-gray-600'>
285285
Your drafts will appear here when you start typing in comment boxes across GitHub and Reddit.
286286
</p>
287287
<div className='space-y-2'>
@@ -297,8 +297,8 @@ const EmptyState = () => (
297297
)
298298

299299
const NoMatchesState = ({ onClearFilters }: { onClearFilters: () => void }) => (
300-
<div className='text-center py-16'>
301-
<p className='text-gray-600 mb-4'>No matches found</p>
300+
<div className='py-16 text-center'>
301+
<p className='mb-4 text-gray-600'>No matches found</p>
302302
<button type='button' onClick={onClearFilters} className='text-blue-600 hover:underline'>
303303
Clear filters
304304
</button>

0 commit comments

Comments
 (0)