Skip to content

Commit 44e4278

Browse files
committed
CI fix, autoformat
1 parent 8bc3d07 commit 44e4278

32 files changed

Lines changed: 105 additions & 217 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
${{ runner.os }}-go-
3333
3434
- name: Build check tool
35-
run: go build -o scripts/check/check scripts/check/main.go
35+
run: go build -o check .
36+
working-directory: ./scripts/check
3637
env:
3738
GOTOOLCHAIN: auto
3839

@@ -101,7 +102,8 @@ jobs:
101102
${{ runner.os }}-go-
102103
103104
- name: Build check tool
104-
run: go build -o scripts/check/check scripts/check/main.go
105+
run: go build -o check .
106+
working-directory: ./scripts/check
105107

106108
- name: Check Prettier
107109
run: ./scripts/check/check --check prettier --ci

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ frontend/test-results/
1515

1616
# Air's logs and the built Go binary
1717
/backend/tmp
18+
19+
# Check script binary
20+
/scripts/check/check

frontend/.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"bracketSameLine": false,
1111
"arrowParens": "always",
1212
"endOfLine": "lf",
13-
"printWidth": 100,
13+
"printWidth": 120,
1414
"proseWrap": "always"
1515
}

frontend/e2e/tests/inbox.spec.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ test.describe('Existing User Read-Only Flow', () => {
4646
} else {
4747
// Check for empty state message (in main content area)
4848
await expect(
49-
page
50-
.locator('main text=No threads found, [role="main"] text=No threads found')
51-
.first(),
49+
page.locator('main text=No threads found, [role="main"] text=No threads found').first(),
5250
).toBeVisible()
5351
}
5452
})
@@ -69,9 +67,9 @@ test.describe('Existing User Read-Only Flow', () => {
6967
})
7068

7169
// Verify thread content is visible (Message component or article)
72-
await expect(
73-
page.locator('article, [data-testid="message"], .message, main').first(),
74-
).toBeVisible({ timeout: 5000 })
70+
await expect(page.locator('article, [data-testid="message"], .message, main').first()).toBeVisible({
71+
timeout: 5000,
72+
})
7573
}
7674
})
7775

@@ -89,16 +87,12 @@ test.describe('Existing User Read-Only Flow', () => {
8987

9088
// Verify email body is visible
9189
// The exact selector depends on your Message component
92-
const messageBody = page
93-
.locator('[data-testid="message-body"], .message-body, article, main')
94-
.first()
90+
const messageBody = page.locator('[data-testid="message-body"], .message-body, article, main').first()
9591
await expect(messageBody).toBeVisible({ timeout: 5000 })
9692

9793
// Check for attachments if they exist
9894
// This is optional - only check if attachments are present
99-
const attachments = page.locator(
100-
'[data-testid="attachment"], .attachment, a[href*="attachment"]',
101-
)
95+
const attachments = page.locator('[data-testid="attachment"], .attachment, a[href*="attachment"]')
10296
const attachmentCount = await attachments.count()
10397
if (attachmentCount > 0) {
10498
await expect(attachments.first()).toBeVisible()
@@ -180,9 +174,7 @@ test.describe('Existing User Read-Only Flow', () => {
180174

181175
if (bannerVisible) {
182176
// eslint-disable-next-line no-console
183-
console.log(
184-
'WebSocket connection banner is visible - connection may not be established',
185-
)
177+
console.log('WebSocket connection banner is visible - connection may not be established')
186178
// eslint-disable-next-line no-console
187179
console.log(
188180
'Console messages:',
@@ -216,9 +208,7 @@ test.describe('Existing User Read-Only Flow', () => {
216208

217209
if (response.status !== 204) {
218210
// eslint-disable-next-line no-console
219-
console.log(
220-
`Test endpoint returned status ${String(response.status)}: ${response.statusText}`,
221-
)
211+
console.log(`Test endpoint returned status ${String(response.status)}: ${response.statusText}`)
222212
}
223213

224214
// Wait for the new subject to appear without reloading the page.
@@ -233,9 +223,7 @@ test.describe('Existing User Read-Only Flow', () => {
233223
expect(updatedSubjects).not.toEqual(initialSubjects)
234224
})
235225

236-
test('clicking email navigates to thread with correct URL and displays body', async ({
237-
page,
238-
}) => {
226+
test('clicking email navigates to thread with correct URL and displays body', async ({ page }) => {
239227
const result = await setupInboxTest(page)
240228
if (!result) {
241229
// Skip if redirected to settings
@@ -277,9 +265,7 @@ test.describe('Existing User Read-Only Flow', () => {
277265

278266
// Verify email body/content is visible
279267
// Message component should render the email body
280-
const messageContent = page
281-
.locator('article, [data-testid="message"], .message, main div.border-b')
282-
.first()
268+
const messageContent = page.locator('article, [data-testid="message"], .message, main div.border-b').first()
283269
await expect(messageContent).toBeVisible({ timeout: 5000 })
284270

285271
// Verify sender is displayed in the message

frontend/e2e/tests/onboarding.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import { test, expect } from '@playwright/test'
22

33
import { setupAuth } from '../fixtures/auth'
44
import { defaultTestUser } from '../fixtures/test-data'
5-
import {
6-
fillSettingsForm,
7-
navigateAndWait,
8-
submitSettingsForm,
9-
testSettingsFormValidation,
10-
} from '../utils/helpers'
5+
import { fillSettingsForm, navigateAndWait, submitSettingsForm, testSettingsFormValidation } from '../utils/helpers'
116

127
/**
138
* Test 1: New User Onboarding Flow
@@ -69,9 +64,7 @@ test.describe('New User Onboarding', () => {
6964

7065
// Verify we're no longer on the settings page
7166
// Use main content area to avoid sidebar h1
72-
await expect(page.locator('main h1, [role="main"] h1').first()).not.toContainText(
73-
'Settings',
74-
)
67+
await expect(page.locator('main h1, [role="main"] h1').first()).not.toContainText('Settings')
7568
})
7669

7770
test('shows validation errors for empty required fields', async ({ page }) => {

frontend/e2e/tests/search.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ test.describe('Search Functionality', () => {
4747
await waitForEmailList(page)
4848

4949
// Verify search results page shows query (use data-testid for style-independent testing)
50-
await expect(page.locator('[data-testid="search-page-heading"]').first()).toContainText(
51-
'Search results',
52-
)
50+
await expect(page.locator('[data-testid="search-page-heading"]').first()).toContainText('Search results')
5351

5452
// Verify we found the expected message from sampleMessages
5553
const expectedMessage = sampleMessages.find((m) => m.subject.includes('Special Report'))

frontend/e2e/tests/sidebar.spec.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ test.describe('Sidebar and Folder Navigation', () => {
3939

4040
// Verify common folders are present (at least Inbox should be there)
4141
// Inbox link should be href="/" (inbox is special and doesn't use folder parameter)
42-
const inboxLink = page
43-
.locator('a[href="/"], a:has-text("Inbox"), a:has-text("INBOX")')
44-
.first()
42+
const inboxLink = page.locator('a[href="/"], a:has-text("Inbox"), a:has-text("INBOX")').first()
4543
await expect(inboxLink).toBeVisible({ timeout: 5000 })
4644
})
4745

@@ -54,9 +52,7 @@ test.describe('Sidebar and Folder Navigation', () => {
5452

5553
// Wait for sidebar folders to be visible
5654
// Inbox link should be href="/" (inbox is special and doesn't use folder parameter)
57-
const inboxLink = page
58-
.locator('a[href="/"], a:has-text("Inbox"), a:has-text("INBOX")')
59-
.first()
55+
const inboxLink = page.locator('a[href="/"], a:has-text("Inbox"), a:has-text("INBOX")').first()
6056
await expect(inboxLink).toBeVisible({ timeout: 5000 })
6157

6258
// Click the Inbox link
@@ -109,9 +105,7 @@ test.describe('Sidebar and Folder Navigation', () => {
109105
const currentURL = page.url()
110106
if (currentURL.includes('/settings')) {
111107
// Already on settings page, just verify
112-
await expect(page.locator('main h1, [role="main"] h1').first()).toContainText(
113-
'Settings',
114-
)
108+
await expect(page.locator('main h1, [role="main"] h1').first()).toContainText('Settings')
115109
return
116110
}
117111

frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"scripts": {
1111
"dev": "vite",
1212
"build": "tsc -b && vite build",
13-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
14-
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
13+
"lint": "eslint .",
14+
"lint:fix": "eslint . --fix",
1515
"format": "prettier --write \"src/**/*.{ts,tsx,css}\"",
1616
"format:check": "prettier --check \"src/**/*.{ts,tsx,css}\"",
1717
"preview": "vite preview",

frontend/src/components/EmailListItem.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,7 @@ describe('EmailListItem', () => {
353353

354354
render(<EmailListItem thread={thread} />, { wrapper: createWrapper() })
355355

356-
expect(
357-
screen.getByText(/This is the body text from the first message/i),
358-
).toBeInTheDocument()
356+
expect(screen.getByText(/This is the body text from the first message/i)).toBeInTheDocument()
359357
})
360358

361359
it('displays preview snippet from HTML email body (extracted text)', () => {

frontend/src/components/EmailListItem.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ function formatDate(sentAt: string | null | undefined): string {
3434
return dateFormatter.format(date)
3535
}
3636

37-
function getPreviewSnippet(
38-
previewSnippet: string | undefined,
39-
bodyText: string | undefined,
40-
): string {
37+
function getPreviewSnippet(previewSnippet: string | undefined, bodyText: string | undefined): string {
4138
// Prefer backend preview_snippet, fallback to first message body_text
4239
const source = previewSnippet || bodyText
4340
if (!source) {
@@ -145,10 +142,7 @@ export default function EmailListItem({ thread, isSelected }: EmailListItemProps
145142

146143
{/* Star column */}
147144
<div className='flex justify-center text-base'>
148-
<span
149-
className={isStarred ? 'text-amber-400' : 'text-slate-500'}
150-
aria-hidden='true'
151-
>
145+
<span className={isStarred ? 'text-amber-400' : 'text-slate-500'} aria-hidden='true'>
152146
{isStarred ? '★' : '☆'}
153147
</span>
154148
</div>
@@ -175,9 +169,7 @@ export default function EmailListItem({ thread, isSelected }: EmailListItemProps
175169
{previewSnippet && (
176170
<>
177171
<span className='opacity-60 text-slate-400'> - </span>
178-
<span className='truncate opacity-60 text-slate-400'>
179-
{previewSnippet}
180-
</span>
172+
<span className='truncate opacity-60 text-slate-400'>{previewSnippet}</span>
181173
</>
182174
)}
183175
</div>

0 commit comments

Comments
 (0)