Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added e2e/issues/14/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions e2e/issues/14/demo.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { test, expect } from '@playwright/test'
import { getTauriMockScript } from '../../tauri-mocks'

test.beforeEach(async ({ page }) => {
await page.addInitScript(getTauriMockScript())
})

test('demo: checkbox green color on check', async ({ page }) => {
test.slow()

// Compact viewport - no sidebar, just the editor
await page.setViewportSize({ width: 600, height: 450 })

await page.goto('/')
await expect(page.locator('.cm-editor')).toBeVisible()

// Create a task list
await page.locator('.cm-content').click()
await page.keyboard.type('My Tasks', { delay: 40 })
await page.keyboard.press('Enter')
await page.waitForTimeout(300)

// Add first task
await page.keyboard.type('- [ ] Review pull requests', { delay: 40 })
await page.waitForTimeout(800)

await page.keyboard.press('Enter')
await page.keyboard.type('Write documentation', { delay: 40 })
await page.waitForTimeout(800)

await page.keyboard.press('Enter')
await page.keyboard.type('Fix bug in checkbox styling', { delay: 40 })
await page.waitForTimeout(1000)

// Check off the first task - watch it turn green!
const checkboxes = page.locator('.checkbox-marker')
await checkboxes.nth(0).click()
await page.waitForTimeout(1200)

// Check off the third task
await checkboxes.nth(2).click()
await page.waitForTimeout(1200)

// Uncheck the first task
await checkboxes.nth(0).click()
await page.waitForTimeout(1000)

// Check it again to show the green feedback
await checkboxes.nth(0).click()
await page.waitForTimeout(1500)
})
18 changes: 18 additions & 0 deletions e2e/issues/14/pr-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Demo
![Demo](file:///Users/runner/work/drift/drift/e2e/issues/14/demo.gif)

## Summary
Added CSS styling to make checked checkboxes `[x]` display in green color (#22c55e in light mode, #4ade80 in dark mode) for satisfying visual feedback. Unchecked checkboxes `[ ]` remain in the default text color.

## Before & After
| Before | After |
|--------|-------|
| ![before](e2e/issues/14/screenshots/before.png) | ![after](e2e/issues/14/screenshots/after.png) |
| Checked checkboxes displayed in default black/gray color | Checked checkboxes now display in green, providing visual feedback |

## Files Changed
- `src/components/Editor.css`: Added `.checkbox-checked` styles with green color for both light and dark themes

## Tests
- `e2e/issues/14/verify.spec.ts` - Verification test with before/after assertions
- `e2e/issues/14/demo.spec.ts` - Demo recording showing checkboxes turning green when checked
Binary file added e2e/issues/14/screenshots/after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added e2e/issues/14/screenshots/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions e2e/issues/14/verify.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { test, expect } from '@playwright/test'
import { getTauriMockScript } from '../../tauri-mocks'
import { assertScreenshot } from '../../helpers/screenshots'
import * as path from 'path'

const SCREENSHOTS_DIR = path.join(path.dirname(import.meta.url.replace('file://', '')), 'screenshots')

test.beforeEach(async ({ page }) => {
await page.addInitScript(getTauriMockScript())
})

test('verify checkbox color - after fix', async ({ page }) => {
await page.goto('/')
await expect(page.locator('.cm-editor')).toBeVisible()

// Type unchecked checkboxes
await page.locator('.cm-content').click()
await page.keyboard.type('- [ ] Unchecked task')
await page.keyboard.press('Enter')
await page.keyboard.type('Checked task')

// Wait for rendering
await page.waitForTimeout(200)

// Click the second checkbox to check it
const checkboxes = page.locator('.checkbox-marker')
await checkboxes.nth(1).click()

// Wait a moment for the color change
await page.waitForTimeout(200)

// Save "after" screenshot showing the green checkbox
await page.screenshot({ path: path.join(SCREENSHOTS_DIR, 'after.png') })

// Verify the checked checkbox is now green
const result = await assertScreenshot(page, 'Check if the checked checkbox [x] appears in green color')
console.log('Assertion result:', result)

expect(result.passed).toBe(true)
})
15 changes: 15 additions & 0 deletions src/components/Editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,21 @@ body.cmd-held .bare-url {
}
}

/* Checked checkbox - green color */
.checkbox-checked {
color: #22c55e;
}

:root[data-theme="dark"] .checkbox-checked {
color: #4ade80;
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .checkbox-checked {
color: #4ade80;
}
}

/* First line as title */
.first-line-title {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
Expand Down