Skip to content

ruanwenjun/quick-thoughts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ญ Quick Thoughts

Catch fleeting thoughts before they slip away.

A menu barโ€“resident macOS app for capturing thoughts: hit a global shortcut, type, press return.

License: Apache 2.0 macOS Swift SwiftUI

English ยท ไธญๆ–‡


๐Ÿ’ก Motivation

While coding, reading docs, or sitting in a meeting, ideas flash by: a possible cause for a bug, a small improvement, a message to send, an email to reply to. They vanish in seconds.

Opening Notion / Apple Notes / Bear is too heavy โ€” switch apps, find the notebook, place the cursor, type, save, switch back, and the thread of thought is already broken.

Quick Thoughts does exactly one thing: from any app, โŒฅโŒ˜T โ†’ type โ†’ Enter, three steps. Light enough not to interrupt your flow, structured enough to browse / search / clean up later.

โœจ Features

  • โŒจ๏ธ Global hotkey (default โŒฅโŒ˜T, customizable) โ€” never break the current flow
  • ๐Ÿ“ Spotlight-style popup: multi-line input, Enter to save, Shift+Enter for newline, Esc to cancel
  • ๐Ÿ—‚ Draft preservation: closing the popup (clicking outside / Esc) keeps your text for next time
  • ๐Ÿ” Full-text search: instant filtering in the main panel, case-insensitive
  • โœ๏ธ Inline edit / delete: hover-revealed actions, delete asks for confirmation
  • ๐Ÿ’พ Single-file JSON storage: easy to back up, migrate, grep
  • ๐Ÿ›ก๏ธ Crash-safe: atomic writes, auto-backup of corrupt files, schema version guard
  • ๐ŸŒ— Light / dark adaptive: follows the system appearance
  • ๐ŸŒ Bilingual UI: English + ็ฎ€ไฝ“ไธญๆ–‡, switch in Settings
  • ๐Ÿชถ Featherweight: menu barโ€“only, no Dock icon, native Swift + SwiftUI, no Electron baggage

๐Ÿš€ Install

Requirements

  • Runtime: macOS 13.0 or later
  • Build from source: full Xcode (free, Mac App Store).
    • Command Line Tools alone (xcode-select --install) is not enough: the KeyboardShortcuts dependency uses #Preview macros (needs the Xcode macro plugin), and swift test needs Xcode's bundled XCTest framework.
    • After installing Xcode, let it install additional components on first launch, then switch the toolchain:
      sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Option A โ€” Download from Releases (recommended for end users)

First release pending.

  1. Grab the latest Quick-Thoughts-x.y.z.zip from Releases
  2. Unzip, drag Quick Thoughts.app to /Applications
  3. First launch: right-click โ†’ Open โ†’ click Open in the warning dialog (one-time Gatekeeper bypass since the app isn't notarized yet; double-click works thereafter)

Option B โ€” Build from source (recommended for developers)

git clone https://github.com/ruanwenjun/quick-thoughts.git
cd quick-thoughts
make install        # โ†’ /Applications, requires sudo
# or sudo-free:
make install-user   # โ†’ ~/Applications

make install runs a release build, produces the .app bundle, ad-hoc signs it, and copies it to the target directory.

๐ŸŽฏ Usage

Action Shortcut
Open capture popup โŒฅโŒ˜T (configurable)
Newline in popup Shift+Enter
Save & close popup Enter
Cancel popup (keep draft) Esc
Open Settings โŒ˜,

Click the menu bar icon for "New Thought / Open Panel / Settingsโ€ฆ / Quit".

In the main panel, hover any row to reveal โœ๏ธ edit and ๐Ÿ—‘๏ธ delete (delete shows an inline confirmation first to prevent mistakes); the toolbar search box filters in real time.

The Settings window has a Language picker โ€” Auto / English / ไธญๆ–‡. Auto follows the system language (Chinese variants โ†’ ไธญๆ–‡, otherwise English).

Launch at login

The recommended path is to add Quick Thoughts under System Settings โ†’ General โ†’ Login Items.

Settings also has a "Launch at login" toggle (built on SMAppService), but that API needs a properly signed app to work reliably; with the current ad-hocโ€“signed build it may fail โ€” the inline red error is expected. The System Settings approach is more reliable.

โš™๏ธ Data Storage

~/Library/Application Support/QuickThoughts/thoughts.json

A simple, stable format โ€” easy to back up, grep, or migrate by hand:

{
  "schemaVersion": 1,
  "thoughts": [
    {
      "id": "5C9E1F8A-...",
      "content": "Saw a nice design today",
      "createdAt": "2026-05-09T10:23:45Z",
      "updatedAt": "2026-05-09T10:23:45Z"
    }
  ]
}

Settings shows the current path with a "Show in Finder" button.

File I/O strategy:

  • Atomic writes: write thoughts.json.tmp first, then replaceItemAt / moveItem โ€” a crash doesn't lose the previous file
  • Debounced: continuous edits flush 500 ms after the last keystroke; a forced flush runs on willTerminate
  • Corruption recovery: JSON decode failure โ†’ backs up the original as thoughts.json.corrupt-<timestamp>-<uuid>, starts with an empty database
  • Schema guard: reading a higher schemaVersion than supported aborts writes and prompts the user to upgrade

๐Ÿ›ฃ๏ธ Roadmap

v1 shipped: capture, browse, search, edit, delete, settings, JSON persistence, menu bar app, Spotlight-style popup, card-style main panel, bilingual UI.

Explicitly not in v1 (YAGNI): iCloud sync, iOS / web clients, tags / folders, rich text / Markdown rendering, image attachments, reminders / alarms, multi-account.

Possible future work (issues / discussion welcome):

  • Apple Developer signing + notarization โ†’ double-click .dmg install, stable SMAppService launch-at-login
  • Homebrew Cask (brew install --cask quick-thoughts)
  • GitHub Actions CI: tag โ†’ build / sign / publish Release
  • Tags / lightweight Markdown rendering
  • Export / one-click zip backup

๐Ÿ› ๏ธ Development

make build      # swift build (debug)
make test       # swift test โ€” 16 cases covering the data layer
make run        # swift run (terminal blocks; closing it kills the app)
make bundle     # bundle .app into dist/ only
make uninstall  # remove the installed .app
make clean      # wipe .build / dist

Project structure

Sources/QuickThoughts/
โ”œโ”€โ”€ QuickThoughtsApp.swift                 entry; MenuBarExtra + Window + Settings
โ”œโ”€โ”€ Models/Thought.swift                   data model
โ”œโ”€โ”€ Storage/
โ”‚   โ”œโ”€โ”€ JSONFileRepository.swift           atomic write, corruption backup, schema guard
โ”‚   โ””โ”€โ”€ ThoughtStore.swift                 ObservableObject + CRUD + debounced flush
โ”œโ”€โ”€ Features/
โ”‚   โ”œโ”€โ”€ MenuBarContent.swift               menu bar menu
โ”‚   โ”œโ”€โ”€ Capture/                           capture popup (NSPanel + NSTextView bridge)
โ”‚   โ””โ”€โ”€ Browse/                            main panel + card row
โ”œโ”€โ”€ Localization/                          bilingual UI (Auto / English / ไธญๆ–‡)
โ””โ”€โ”€ Settings/                              shortcut Recorder + login launch

One runtime dependency: KeyboardShortcuts โ€” global shortcut registration + SwiftUI Recorder component.

Test coverage

ThoughtTests              Codable round-trip
JSONFileRepositoryTests   read / write / missing file / corrupt file / higher schema / nested dirs
ThoughtStoreTests         CRUD / whitespace trim / search / sort / flush / fatalLoadError

UI is not unit-tested; relies on manual smoke testing. Please attach before/after screenshots in PRs that touch UI.

๐Ÿค Contributing

Issues and PRs are welcome. Before submitting:

  1. make test passes
  2. make build has no new warnings
  3. Keep changes surgical โ€” don't "improve" unrelated code along the way
  4. UI changes should include before/after screenshots
  5. Use lowercase verb-prefixed commits (feat: / fix: / style: / chore: etc.)

๐Ÿ“„ License

Apache License 2.0 ยฉ 2026 ruanwenjun

๐Ÿ™ Acknowledgements

  • Sindre Sorhus' KeyboardShortcuts โ€” global shortcuts + recording UI with nearly zero code
  • macOS native MenuBarExtra / NSPanel / Settings scenes โ€” the menu bar app substrate

About

๐Ÿ’ญ A featherweight macOS menu bar app โ€” press โŒฅโŒ˜T, type, hit return. Catch fleeting thoughts before they slip away.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors