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
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ It keeps the workflow inside the editor you are already using and calls the mode

1. Install Simple Words from the [Chrome Web Store](https://chromewebstore.google.com/detail/simple-words/kmlhfcjpmhcoclpcghckibfkgpfbjfbb).
2. Use the options page that opens after install to choose a model provider.
3. Write a rough reply in Gmail, Outlook, Yahoo Mail, iCloud Mail, Proton Mail, or another enabled domain.
3. Write a rough reply in Gmail, Outlook, Yahoo Mail, iCloud Mail, Proton Mail, Slack, or another enabled domain.
4. Click **Simple Words**, review the refined draft, then click **Replace draft**.

## Install
Expand Down Expand Up @@ -137,16 +137,16 @@ If the button or panel disappears after the extension reloads or updates while a
Simple Words stores configuration in `chrome.storage.local`.
There is no hosted Simple Words backend in the request path.

| Setting | Default |
| --------------- | ------------------------------------------------------------------------------------------------------------- |
| Provider | `openai` |
| OpenAI base URL | `https://api.openai.com/v1` |
| OpenAI model | `gpt-5.5` |
| Codex base URL | `https://chatgpt.com/backend-api/codex` |
| Codex model | `gpt-5.5-fast` |
| Ollama base URL | `http://localhost:11434/v1` |
| Ollama model | `gemma4` |
| Enabled domains | `mail.google.com`, `outlook.live.com`, `outlook.office.com`, `mail.yahoo.com`, `icloud.com`, `mail.proton.me` |
| Setting | Default |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Provider | `openai` |
| OpenAI base URL | `https://api.openai.com/v1` |
| OpenAI model | `gpt-5.5` |
| Codex base URL | `https://chatgpt.com/backend-api/codex` |
| Codex model | `gpt-5.5-fast` |
| Ollama base URL | `http://localhost:11434/v1` |
| Ollama model | `gemma4` |
| Enabled domains | `mail.google.com`, `outlook.live.com`, `outlook.office.com`, `mail.yahoo.com`, `icloud.com`, `mail.proton.me`, `app.slack.com` |

## Development

Expand Down
3 changes: 2 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const DEFAULT_ENABLED_DOMAINS = [
'outlook.office.com',
'mail.yahoo.com',
'icloud.com',
'mail.proton.me'
'mail.proton.me',
'app.slack.com'
]

export const DEFAULT_SETTINGS: SimpleWordsSettings = {
Expand Down
50 changes: 50 additions & 0 deletions test/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1167,4 +1167,54 @@ describe('content script button visibility', () => {
})
)
})

test('attaches to a Quill composer without following its off-screen clipboard node', () => {
document.body.innerHTML = `
<div class="ql-container">
<div class="ql-editor" contenteditable="true" data-qa="texty_input"><p>hey</p><p>can you take a look</p></div>
<div class="ql-clipboard" contenteditable="true"></div>
</div>
`

const composer = document.querySelector('.ql-editor') as HTMLDivElement
const clipboard = document.querySelector('.ql-clipboard') as HTMLDivElement
Object.defineProperty(composer, 'isContentEditable', { value: true })
Object.defineProperty(clipboard, 'isContentEditable', { value: true })
vi.spyOn(composer, 'getBoundingClientRect').mockReturnValue({
top: 500,
left: 100,
right: 950,
bottom: 538,
width: 850,
height: 38,
x: 100,
y: 500,
toJSON: () => null
})
vi.spyOn(clipboard, 'getBoundingClientRect').mockReturnValue({
top: 0,
left: -99363,
right: -99362,
bottom: 1,
width: 1,
height: 1,
x: -99363,
y: 0,
toJSON: () => null
})

composer.dispatchEvent(new FocusEvent('focusin', { bubbles: true }))

const button = document.getElementById(
'simplewords-button'
) as HTMLButtonElement
expect(button.hidden).toBe(false)
expect(Number.parseFloat(button.style.top)).toBeGreaterThanOrEqual(500)
expect(Number.parseFloat(button.style.top)).toBeLessThan(538)
expect(Number.parseFloat(button.style.left)).toBeLessThan(950)

clipboard.dispatchEvent(new FocusEvent('focusin', { bubbles: true }))

expect(button.hidden).toBe(true)
})
})
18 changes: 14 additions & 4 deletions test/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ import {
normalizeSettings
} from '../src/settings'

const DEFAULT_EMAIL_DOMAINS = [
const DEFAULT_DOMAINS = [
'mail.google.com',
'outlook.live.com',
'outlook.office.com',
'mail.yahoo.com',
'icloud.com',
'mail.proton.me'
'mail.proton.me',
'app.slack.com'
]

describe('domain enablement settings', () => {
test('enables Simple Words by default only on popular email services', () => {
expect(DEFAULT_SETTINGS.enabledDomains).toEqual(DEFAULT_EMAIL_DOMAINS)
test('enables Simple Words by default on popular email and chat clients', () => {
expect(DEFAULT_SETTINGS.enabledDomains).toEqual(DEFAULT_DOMAINS)
})

test('normalizes configured domains to lowercase unique entries', () => {
Expand Down Expand Up @@ -63,9 +64,18 @@ describe('domain enablement settings', () => {
expect(
isSimpleWordsEnabledForUrl?.(DEFAULT_SETTINGS, 'https://www.icloud.com/')
).toBe(true)
expect(
isSimpleWordsEnabledForUrl?.(
DEFAULT_SETTINGS,
'https://app.slack.com/client/T0123ABCD/C0123ABCD'
)
).toBe(true)
expect(
isSimpleWordsEnabledForUrl?.(DEFAULT_SETTINGS, 'https://docs.google.com/')
).toBe(false)
expect(
isSimpleWordsEnabledForUrl?.(DEFAULT_SETTINGS, 'https://slack.com/')
).toBe(false)
})
})

Expand Down