Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
55f9380
docs: add design spec for multi-tab scratchpad
bakedbean May 3, 2026
0a1442d
docs: add implementation plan for multi-tab scratchpad
bakedbean May 3, 2026
54a419b
refactor: extract storage layer into Scratchpad.Storage module
bakedbean May 3, 2026
4e54375
refactor: extract editor concerns into Scratchpad.Editor module
bakedbean May 3, 2026
e3fe903
feat: migrate legacy scratchpadContent to tabIndex schema
bakedbean May 3, 2026
476295e
fix: sweep orphaned scratchpadContent on every load
bakedbean May 3, 2026
54b297c
feat: add tab bar markup and styles
bakedbean May 3, 2026
8b68103
feat: introduce Tabs module with per-tab editors and basic switching
bakedbean May 3, 2026
892e403
fix: serialize per-tab saves via promise chain to prevent stale writes
bakedbean May 3, 2026
53daaef
feat: close tab with undo toast
bakedbean May 3, 2026
9218219
docs: align recentlyClosed comment with field name
bakedbean May 3, 2026
2e5ec49
feat: rename tab with double-click
bakedbean May 3, 2026
815a2b1
feat: tab navigation keyboard shortcuts
bakedbean May 3, 2026
0416ec5
feat: cross-device sync for tab content with per-tab dirty guard
bakedbean May 3, 2026
edd8ee1
fix: drop stale Sync.pollOnce guard and align lastSavedContent serial…
bakedbean May 3, 2026
2b705e3
feat: cross-device sync for tab list with deletion banner
bakedbean May 3, 2026
a3fc98b
fix: drop deleted-tab placeholder before persisting save-as-new-tab
bakedbean May 3, 2026
e0bbc5b
feat: orphan recovery for concurrent tab creation
bakedbean May 3, 2026
62c9e30
fix: catch async errors from Sync._handleChanges to avoid unhandled r…
bakedbean May 3, 2026
2f8cee9
feat: tab overflow with ⋯ dropdown menu
bakedbean May 3, 2026
2658f9b
perf: suppress per-tab overflow recompute during hydration
bakedbean May 3, 2026
0a256bc
feat: per-tab fallback to local storage on sync quota error
bakedbean May 3, 2026
3439b52
fix: don't overwrite local-fallback content during sync poll/onChanged
bakedbean May 3, 2026
6a7f424
chore: bump version to 2.0 for multi-tab release
bakedbean May 3, 2026
59bda47
fix: prevent closed-tab resurrection, ignore shortcuts during rename,…
bakedbean May 3, 2026
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
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Scratchpad - Firefox Extension

A simple, synced scratchpad extension for Firefox that lets you quickly jot down notes that automatically sync across all your Firefox devices.
A synced multi-tab scratchpad extension for Firefox. Each tab maintains its own content, with rich text formatting and hyperlinks, and syncs across all your Firefox devices.

## Features

- **Clean Interface**: Full-screen textarea for distraction-free note-taking
- **Auto-Save**: Your notes are automatically saved as you type
- **Cross-Device Sync**: Notes sync across all your Firefox devices using Firefox Sync
- **Simple & Fast**: No login required, no configuration needed - just install and start typing
- **Multiple Tabs**: Organize separate notes in tabs; double-click to rename, click × to close (with undo)
- **Rich Text**: Bold, italic, underline, bullet/numbered lists, and hyperlinks
- **Auto-Save**: Each tab saves automatically as you type
- **Cross-Device Sync**: Tabs and content sync across all your Firefox devices using Firefox Sync
- **Keyboard Shortcuts**: `Ctrl+Alt+T` new tab, `Ctrl+Alt+W` close tab, `Ctrl+Tab` / `Ctrl+Shift+Tab` cycle tabs, `Ctrl+B/I/U/K` formatting

## Installation

Expand Down Expand Up @@ -50,18 +51,26 @@ The extension uses Firefox's `storage.sync` API, which:
## Technical Details

- **Manifest Version**: 2 (Firefox standard)
- **Extension Version**: 2.0 (multi-tab)
- **Permissions**: `storage` (for sync functionality)
- **Storage API**: `browser.storage.sync`
- **Auto-save Delay**: 500ms after typing stops
- **Storage**: `browser.storage.sync` for tab content; falls back to `browser.storage.local` per-tab when sync quota is exceeded
- **Storage Layout**: `tabIndex` lists all tabs; each tab's content lives in its own `tab_<id>` key
- **Auto-save Delay**: 500ms debounce after typing stops; 5s periodic flush; 10s sync poll
- **Active Tab**: Persisted per-device in `browser.storage.local` (each device remembers its own focus)

## Files

- `manifest.json` - Extension configuration
- `background.js` - Handles opening scratchpad tabs
- `scratchpad.html` - Main scratchpad interface
- `scratchpad.css` - Styling
- `scratchpad.js` - Save/load functionality with sync
- `icons/` - Extension icons
- `manifest.json` — Extension configuration
- `background.js` — Handles opening scratchpad tabs
- `scratchpad.html` — Main interface (tab bar, toolbar, editor stack)
- `scratchpad.css` — Styling
- `scratchpad.js` — Lifecycle and wiring
- `storage.js` — Storage area initialization (sync with local fallback)
- `editor.js` — HTML/URL sanitization, formatting commands, link creation
- `migration.js` — One-time migration from the legacy single-key schema
- `tabs.js` — Tab CRUD, switching, undo, rename, overflow, document-level shortcuts
- `sync.js` — Cross-device sync via storage.onChanged + 10s poll, with orphan recovery
- `icons/` — Extension icons

## Privacy

Expand Down
Loading