agentleFS
kasvithkasvith/tic/CLAUDE.md

tic

CLAUDE.md76 starsChanged 34 days agoMITView on GitHub

Tic is a macOS app of floating, Stickies-style task notes that live on the desktop. It's a SwiftPM executable (no .xcodeproj), SwiftUI for views, AppKit for windows, and SQLite via GRDB for storage. Deployment target is macOS 14; the dev toolchain is Swift 6.2 / Xcode 26. PLAN.md is the design doc and roadmap (what's built vs. deferred). - Landing page (tic.kasvith.me) is a self-contained Astro + pnpm project in site/ — all Node tooling stays there (see site/README.md); never…

  • Pipes a download into a shell
  • In this repositoryOne other file it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test it with TIC_DEST=<tmp dir> and a stub open first on PATH.

    line 27
  2. Very specific:

    Update Now. Update Now (UpdateInstaller.install) downloads the pinned version's Tic.zip, checks Tic.zip.sha256, unpacks with ditto, refuses …

    line 324

≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

Tic is a macOS app of floating, Stickies-style task notes that live on the desktop. It's a SwiftPM executable (no .xcodeproj), SwiftUI for views, AppKit for windows, and SQLite via GRDB for storage. Deployment target is macOS 14; the dev toolchain is Swift 6.2 / Xcode 26. PLAN.md is the design doc and roadmap (what's built vs. deferred).

Commands

swift build                 # compile (resolves the GRDB SPM dependency); the source of truth
swift run                   # build + launch the GUI app (long-running; kill it when done)
open Package.swift          # opens the package in Xcode for GUI editing / previews
./scripts/package.sh        # build release + assemble dist/Tic.app (add --open to launch it)
  • Landing page (tic.kasvith.me) is a self-contained Astro + pnpm project in site/ — all Node tooling stays there (see site/README.md); never add JS files to the repo root.
  • Install/update script: site/public/install.sh, served as curl -fsSL https://tic.kasvith.me/install.sh | sh. curl adds no quarantine flag (browsers do), so the unsigned app opens without Gatekeeper's block. It verifies Tic.zip.sha256 and quits only the app process (the pgrep -f pattern is anchored, so Tic --mcp helpers and their wrappers survive). Test it with TIC_DEST=<tmp dir> and a stub open first on PATH.
  • Verification is a clean swift build, swift test (Swift Testing — AppDatabaseTests, SyncTests, TaskOutlineTests, NoteColorTests, TaskImageTests, …), plus running the app. The outline logic lives in pure, testable functions (TaskOutline) precisely so it can be covered without a DB or the main actor. Tests share the Mac with its user, so they must never take the real keyboard or mouse: nothing runs the app under swift test (NSApp.isRunning is false), and there a NotePanel ignores the pointer and never becomes key (a key non-activating panel takes whatever the user types). Probe scripts follow suit: no window ordered front, no posted or warped events.
  • swift run produces a bare executable (no bundle): fine for dev, but it has no Dock identity and can't register as a login item (SMAppService needs a real bundle).
  • Packaging (scripts/package.sh + Packaging/Info.plist) assembles a real dist/Tic.app with bundle id com.kasvith.tic and the icon from Assets/AppIcon/Tic.icns (→ Resources/AppIcon.icns, referenced by CFBundleIconFile). That's what gives the Dock icon/name and makes Launch-at-Login work. It's ad-hoc signed; a Developer ID + notarization is needed for distribution. For the login item to persist, run from a stable location (move Tic.app to /Applications).
  • Tests: swift test (Swift Testing; @testable import Tic works on the executable target — no separate library). Assets/ holds source icon art (AppIcon / Flat / MenuBar); the menu-bar glyph is also copied to Sources/Tic/Resources/MenuBarIcon.png and bundled via SwiftPM.
  • CI/Release: .github/workflows/ — ci.yml (build + test + lint) and release.yml (push a v* tag → builds Tic.app, git-cliff release notes, publishes a GitHub Release (versioned DMG + a stable-named Tic.zip and Tic.zip.sha256, which releases/latest/download/… always resolves), commits the regenerated CHANGELOG.md to main, then POSTs the CF_DEPLOY_HOOK secret so the site's What's new rebuilds — that commit is [skip ci], which Cloudflare honours).
  • To launch headlessly for a no-crash smoke check (the GUI can't be screenshotted from a sandbox), run .build/debug/Tic in the background and grep its stderr for the [Tic] restored N note panel(s) log line.

Inspecting / resetting state

The database is a plain SQLite file you can read and edit directly:

DB="$HOME/Library/Application Support/Tic/tic.sqlite"
sqlite3 -header -column "$DB" "SELECT title,color,material,floatOnTop,isCollapsed FROM note;"
rm "$DB"                    # wipe; the welcome note is re-seeded on next launch

In DEBUG builds the migrator sets eraseDatabaseOnSchemaChange = true, so changing the schema auto-wipes the DB instead of crashing.

Architecture

The defining constraint: a desktop sticky note needs borderless/float/all-Spaces/custom-drag behavior that pure SwiftUI windows can't provide. So SwiftUI views are hosted inside AppKit panels, and a few responsibilities are deliberately split across the AppKit/SwiftUI boundary.

  • NotePanel (AppKit NSPanel) — one window per note. Titled but with a hidden transparent title bar + fullSizeContentView (gives rounded corners, shadow, edge-resize while the SwiftUI content fills everything). isMovableByWindowBackground is off on purpose.
  • NoteWindowManager (@MainActor) — owns [UUID: NotePanel] + [UUID: NoteController], is each panel's NSWindowDelegate, and is the single chokepoint for all window mutation: restoreAll (launch: only notes with isOpen — the header X clears it, quitting doesn't, so relaunch shows what was on screen), openNote, close, debounced frame persistence, roll-up resize, and applying float-on-top / show-on-all-Spaces (all Spaces counts only while pinned: ⋯ › Over full-screen apps). No collection behaviour moves a window off a Space once it's there, so a note let go of all Spaces over a full-screen app is hidden until its display shows a desktop again (applyBehavior / activeSpaceDidChange). SkyLight.isFullScreen tells which, using the private space-type call window managers use, looked up at run time; if a macOS drops it, notes simply stay put. Frames are global coordinates spanning all displays, exactly as Stickies stores them. Only user drags/resizes persist a frame: place puts a note at its saved frame when any connected display shows it, else parks it at the nearest edge of the main display, and re-runs on didChangeScreenParametersNotification with saves suppressed (placing + a 2s blackout) — so unplugging a monitor never overwrites the note's spot on it, and plugging it back returns the note exactly, with or without a relaunch in between.
  • NoteController (@MainActor @Observable) — one per open note. Holds the Note, streams its tasks live via GRDB ValueObservation, and turns user actions into DB writes. It stays AppKit-free: window side effects go through closures the manager sets on it (onApplyBehavior, onClose, onSetCollapsed).
  • AppDatabase (Sendable) — GRDB DatabaseQueue + DatabaseMigrator, async CRUD, and ValueObservation streams.
  • TaskOutline (pure, no AppKit / no DB) — all the subtask/outline maths over a note's flat [TaskItem]: subtree/parent/children queries, the bidirectional completion cascade (applyingToggle), indent/outdent, drag-move (movingSubtree), level normalizedLevels, and the id-matched indentLevelChanges diff. Kept separate so it's unit-testable in isolation.
  • PlainTextEditor (NSViewRepresentable over NSTextView) — the task / quick-add editor. AppKit, not SwiftUI TextField, because that control can't reliably insert newlines or intercept Tab on macOS (see the editing convention below). QuickAddBar is the add-a-task bar along the bottom of a note (owns the typed text and pending indent). ShortcutHint is the small keycap-chip label.
  • TaskImage (pure CoreGraphics/ImageIO, no AppKit / no DB) + TaskImageView — pasted images: normalise/thumbnail/crop/preview-file helpers and the crop maths (dragging, moving), and the view that draws a task's image with its hover buttons, context menu, and crop mode. ImageViewer is the image window a double-click opens (AppKit ZoomScrollView zoom + Open in Preview), dressed like its note (paper/glass background, note-style header, hints) — one reusable ImageWindow owned by NoteWindowManager; far quicker than launching Preview.
  • MCP server (MCP/) — lets AI agents drive Tic. MCPService runs an NWListener on a Unix socket beside the DB (~/Library/Application Support/Tic/mcp.sock, 0600) — one official-SDK Server session per connection (per agent). MCPTools is the tool surface (create_note, add_tasks, update_task, move_task, …): pure AppDatabase writes plus three window pokes (WindowActions), reusing TaskOutline for every structural rule so tools and UI can't diverge. Clients speak stdio to Tic --mcp (MCPProxy), which pipes to the socket — one config works for every client, and the server lives in the app next to the observers. Off by default (AppModel.mcpEnabled); switched on, with per-client setup snippets, in Settings › AI Agents. Live updates are free: tools write the DB, the existing ValueObservation streams push into open panels; the one addition is observeNote(id:) so the controller streams its own note row too (an agent's title/colour/flag write shows live).
  • Sync between Macs (Sync/) — one person's Macs share lists through a folder something else syncs (iCloud Drive by default, or any Dropbox / Google Drive / OneDrive / Syncthing folder). No CloudKit: every iCloud API needs an entitlement an ad-hoc app can't carry; plain files need none. Each Mac writes only devices/<id>.json (a SyncSnapshot) and reads the others, so a sync service never sees a conflict. SyncMerge (pure, like TaskOutline) is a state-based CRDT: every synced field is a Register (newest stamp wins), a note's whole outline (order + nesting) is one register, delete always wins, and stamps are max(now, clock + 1) so an edit made after seeing a change beats it on a slow clock. record diffs the DB against resolve(snapshot) (not the raw registers), so values this Mac adjusted on apply never look like local edits. AppDatabase.syncCycle does record → merge → apply in one write transaction, touching only synced columns: frame, isOpen, collapsed, float, all-Spaces and the note's own sortIndex stay per Mac, and lists from another Mac arrive closed. Per list, opt-in (note.isSynced, off for new lists): the switch is itself a register (sharing), so off on one Mac is off on all, each keeping its copy. Every Mac still records every list (sync-state.json holds them all), but the folder file is published() — synced lists only — so a list switched back on merges with real stamps. Deletes are scoped: a list deleted while synced is tombstoned everywhere; one deleted while not synced only leaves this Mac (the syncLocalDelete table, filled by an AFTER DELETE trigger, notes the switch at the moment of deletion — a switch-off followed at once by a delete wasn't recorded yet and used to delete everywhere; the fuzz run caught it). Task tombstones are made only for lists that ever synced. Images travel as images/<sha256>.png (immutable, named by taskImage.hash, filled on write or lazily by the first sync); a task's image register holds the hash and crop. A picture whose file hasn't arrived keeps this Mac's own register for that cycle (waitingImages), so it never reads as a removal; files are loaded only when their hash checks out, and unreferenced ones are deleted after a week. observeTaskImageCrops carries the hash so a replacement with the same crop reloads its thumbnail. UI: ⋯ › Sync (shown only once sync is on in Settings) and Sync Now (for a list that syncs); the header's sync mark shows only while a cycle touches the list (FolderSync.activity) and stays, orange, while there's a problem. NoteWindowManager.sync is injected into note views as an optional environment object (nil in tests). FolderSync (@MainActor) runs a cycle at start, 2 s after a synced edit (observeSyncedChanges, a column-limited region observation, so frame drags don't trigger it), every 30 s, on wake, and at once on sleep; file IO is off the main actor (an iCloud file may download as it's read). It keeps its own snapshot in sync-state.json beside the DB and its device id in the syncDeviceID default (issued once, so a lost state file never leaves a ghost Mac in the folder), refuses to recreate a folder whose parent vanished (an unmounted Dropbox reads as "can't reach"), and skips files with a newer schema — bump it when the format changes or NoteColor / NoteMaterial gains a case. A field added as an optional register (SyncNote.icon, isPrivate) needs no bump: older files still decode and older Macs ignore it. Off by default (syncEnabled default).
  • Edge dock (DockLayout, pure + NoteWindowManager › Edge dock) — drag a note's header to the left or right edge of any display (between two displays too: a note dragged across folds for a moment and docks only if let go there) and it folds into a tab; note.dockEdge is per Mac (not synced), and while docked the saved frame is where it peeks. Tab and peek are the same panel: NoteView draws DockTabView whenever the window is ≤ DockLayout.maxTabWidth wide (a note is never that narrow), as it draws the bar by height, so the manager only sets frames. NotePanel.performDrag asks onDragMove for each step's frame. A click on the tab opens the note (no hover: users found it jumpy) with its quick-add taking the keyboard (autoFocus while docked: the list is built afresh each time it opens). It goes back on a click elsewhere (resign key), Esc (NotePanel.cancelOperation; an empty editor passes Esc on), the header's →|, or by itself a second after the pointer has left it (watchPointer: only once the pointer has been on it, counted at the click that opened it; never with typed text not yet in, nor while isInUse: a drag or resize, its popover or a sheet, its picture, a menu via menusOpen; the second is timed by the clock, since on a busy main thread the 100 ms checks come late). A click elsewhere (scheduleRetract) also waits while it's in use: ⋯ › Icon › All emoji…'s viewer takes the keyboard. Going back while key hands the keyboard back to the app you were in (a brief orderOut), or the tab kept taking your typing. Open, its header shows →| and a lit dock button (Undock) instead of roll-up and the pin; Undock (that button, ⋯, the tab's right-click menu) slides it 40pt in from the edge. Opening slides the window 18pt out of its edge as it fades in, and closing slides it back (no slide with Reduce Motion): only the origin animates, never the size, since growing the window from tab to note re-laid out the whole list every frame and lagged. The list lays out synchronously at alpha 0 first (probed: about 34 ms). A docked note rests as a 6pt sliver (DockLayout.restFrame) on top of every window, so nothing can hide it; hovering springs the window out to the full tab (tabHover / slideTab, cheap since a tab lays out almost nothing), whose content fades in with its width. It goes back only once pointerLocation has really been off the tab for ~0.1 s: following the tracking area's "left" made a hovered tab flash in and out (most likely spurious leaves while its window resized under a still pointer; not confirmed). (An earlier design kept tabs under windows and watched the pointer with a global mouseMoved monitor; in tests installing that stalled the main thread. Gone with the sliver.) A plain setFrame doesn't stop a running frame animation (probed: the animation wins), so frames set over a possible slide go through setFrameNow (a zero-length animation replaces it), and performDrag starts the same way; a plain drag only moves (setFrameOrigin), resizing just to fold or unfold. A tab's height is whole points (tabSize): AppKit rounds a window's size (asked 87.3, got 88), so a fractional one never matched and every step of a drag along the edge resized and redrew the tab. A docked note's saved frame changes only on a user live-resize while it's open. The manager keeps its own dockEdges: the controller's note can hold a stale observed row, so setDockEdge always writes (skipping "unchanged" once left a note docked in the DB after undocking). Settings › General › Docked tabs: what a hovered tab shows (dockTabStyle) and Show tabs over full-screen apps.
  • List icons (NoteIcon, pure) — note.icon holds one emoji or symbol:<name> from a fixed set of SF Symbols every macOS 14 has (so any Mac draws what another picked; anything else reads as no icon). Emoji draw in colour, symbols in the note's title ink (NoteIconView). ⋯ › Icon is one row opening IconPicker (Emoji / Symbols tabs, All emoji…, Remove). All emoji… types into EmojiCatcher, an invisible field in the picker itself: macOS opens the Character Viewer at the text cursor of what has the keyboard, so it comes up beside the menu; Tic leaves the menus open (it can't be put inside them). Emoji you pick lead the Emoji grid in every list's picker (NoteIcon.recentEmoji, kept in the recentEmoji default as one string of emoji).
  • Private lists — note.isPrivate (⋯ › Private), or every list via Settings › General (everyListPrivate). A private list's panel and image window get sharingType = .none, which only capture paths that honour it respect (ScreenCaptureKit on macOS 15.4+ is reported not to), so menu bar › Cover Private Lists (coveringPrivate) draws a plain cover instead (NoteController.isCovered). The manager pushes both flags into each controller (applyPrivacy). A dim lock after the title marks one.
  • Settings window (SettingsView) — a SwiftUI Settings scene (⌘, and Tic › Settings… come free) with three Form(.grouped) tabs: General (Launch at Login, version, update frequency + Check Now), Sync (switch, folder, other Macs, and a switch per list), AI Agents (the MCP switch and per-client snippets). The selected tab is remembered in the settingsTab default. The menu-bar item calls openSettings after NSApp.activate(): a window opened from a menu-bar menu otherwise appears behind the frontmost app.
  • App shell — TicApp provides a MenuBarExtra; main.swift (not @main) routes --mcp to the proxy, else TicApp.main(); AppDelegate (NSApplicationDelegateAdaptor) builds the shared AppDatabase + NoteWindowManager and calls restoreAll() on launch. The app is a hybrid: Dock icon and menu bar item.

Conventions that matter (and why)

  • Targeted column writes prevent clobbering. Window frame, title, appearance, and flags each have their own UPDATE-one-column method on AppDatabase (updateNoteFrame, updateNoteTitle, …). For tasks, applyStructuralUpdate (optional delete + sortIndex reorder + indentLevel, all in one transaction) and updateTaskCompletion (isDone/completedAt) each touch only their own columns. This is load-bearing: dragging a window (frequent frame saves) must not overwrite a title edit, a reorder must not clobber a just-edited task's text, and a checkbox toggle must not clobber a concurrent text edit. A whole-record update() is used only for a task text commit (where the controller owns the full current value).
  • Subtasks are a flat list + an indentLevel, not a parent-id tree. A task's parent is implicit — the nearest preceding row with a smaller level (max 3 levels). TaskOutline keeps the outline invariant (first row level 0; no row more than one level deeper than the row above) via normalizedLevels after every structural edit, so an orphaned/jumped level can never render. When persisting level changes, diff by id against the current tasks (indentLevelChanges), not by position — a drag reorders and re-nests, so a positional diff would miss the level change (this was a real bug). New subtasks insert mid-list via insertTask(_:reordering:); everything else appends with insertTask (atomic MAX(sortIndex)+1, so deletes leaving gaps can't collide).
  • Completion changes only via toggle; structural edits preserve ticks. toggle runs the bidirectional cascade (checking a parent checks its whole subtree; finishing the last child auto-completes the parent — TaskOutline.applyingToggle). Move / indent / outdent / delete / add never touch isDone — moving a checked item around leaves every tick exactly as it was.
  • The editor is AppKit (PlainTextEditor/NSTextView), not SwiftUI TextField. On macOS that control neither reliably inserts line breaks nor lets us intercept Tab (the key-view loop eats it before .onKeyPress). EditorTextView.keyDown gives deterministic chords: Return commits, Shift/Option-Return inserts a newline, Shift-Tab nests, Ctrl-Shift-Tab outdents. It forces TextKit 1 (_ = view.layoutManager) so usedRect can size it (TextKit 2's layoutManager is nil and multiline would clip), reports height via sizeThatFits, and an editorFirstBaseline() guide aligns the adjacent checkbox to the editor's first line (an NSView has no SwiftUI text baseline). A blank/whitespace-only task is deleted on commit, so an abandoned new row just disappears.
  • Images: one per task, own table, crop is just a rect. taskImage (PK taskId, cascades with the task) holds the original PNG plus a crop normalised 0…1 with a top-left origin (CGImage pixel space — no flip). It's a separate table so observeTasks never loads blobs, and the crop has its own targeted updateTaskImageCrop. The controller observes only crops (observeTaskImageCrops, never data) and decodes a downsampled thumbnail off the main actor; rows draw that through CroppedImageCache, never the full image (a drag re-renders every row each frame). ⌘V routing: a focused EditorTextView.paste (row → attach; quick-add → stageImage), otherwise NotePanel.paste (also stageImage, which focuses the quick-add via quickAddFocusRequest). A staged image waits in the quick-add until Return adds it with the typed text; focus loss doesn't submit while one waits; NSPasteboard.pastableImageData decides image vs text (an image file wins; raw image data only when there's no plain text). An image keeps an empty-text task from the blank-task delete. Open in Preview renders a temp PNG of the cropped image (TaskImage.writePreviewFile). Crop mode's mouse and keys are AppKit (CropTrackingView), SwiftUI only draws it: a SwiftUI DragGesture there kept following the pointer after mouse-up, and SwiftUI focus never arrived, so ⏎ / ⎋ / click-away did nothing. Images size through the AspectFit layout: .aspectRatio(.fit) + .frame(maxHeight:) laid out row-wide, dragging the hover chrome to the note's edge. Pointing at or cropping an image pauses its row's reorder drag (GestureMask.subviews) — SwiftUI's row DragGesture otherwise also fires over the image's buttons and even the AppKit crop view.
  • Rendered Markdown is memoised (MarkdownRenderCache). Parsing inline Markdown per line on every body re-eval made dragging janky (the whole list re-renders each frame); the cache re-parses only when a task's text/colour actually changes.
  • Glass is NSVisualEffectView(.behindWindow), not .glassEffect. NoteBackground renders the .glass material with a behind-window visual-effect view so it shows the desktop through it (and adopts the macOS 26 Liquid Glass look automatically). The SwiftUI .glassEffect API is for in-app controls and won't sample the desktop behind a window.
  • The window drags only by its header. isMovableByWindowBackground is off; WindowMoveArea (an NSViewRepresentable calling window.performDrag) is placed behind the header / collapsed bar. This is what lets task rows be dragged to reorder without moving the window. The panel is isMovable = false, so macOS never drags a note itself (code still moves it): its drag from the hidden title-bar strip the header sits in ran alongside performDrag, tiled the note at a screen edge, and pulled it toward edges while ours followed the pointer, so notes wiggled near edges. (A handle with mouseDownCanMoveWindow = false alone wasn't enough.) The title is plain text inside that handle, not a click target: the header row sits in the window's hidden title-bar strip, where a title taking clicks let a double-click through to macOS's zoom. Renaming is ⋯ › Rename… (or a new list), via NoteController.requestRename, which swaps in a field.
  • The hover reveal is an AppKit tracking area (HoverArea), not .onHover. SwiftUI's hover often didn't reveal the header controls until the note had been clicked into; HoverArea's .activeAlways tracking area goes by geometry alone. (Synthetic mouseMoved events drive neither, so tests can't.)
  • Reorder uses a direct DragGesture, not system .onDrag. System drag has a sluggish pickup; the gesture is immediate. The dragged block (row + subtree) lifts into an overlay (LiftedRow) and its head row turns into a ghost DropPlaceholder at the drop slot and level; the receiving parent is tinted with an elbow (DropThread) into it. The dragged row stays mounted (invisible, one line tall) under the placeholder: it took the mouse-down, and removing it makes SwiftUI silently stop the drag's events (no end, no cancel — a stuck drag). ReorderDragTests hosts a real NoteView in a NotePanel and drives it with synthetic events via window.sendEvent (not NSApp.postEvent + a nextEvent pump, which stalls the main actor for later tests; hit-test first — a press on a text field starts a tracking loop that never returns). Rows publish their frames via a PreferenceKey; the slot counts rest-row midpoints with the gap open (so it only moves once a neighbour is fully crossed — no flicker). Per-frame pointer state lives in the @Observable ReorderDrag, read only by LiftedRow, so the list re-renders on slot/level changes, not every frame. Drop rules are pure in TaskOutline (dropLevels: never adopt the row below; levelSteps: ~70% of an indent step to re-nest). Safe on macOS because scrolling is the wheel/trackpad, so click-drag doesn't fight the ScrollView.
  • Roll-up keeps the top edge fixed — or the bottom, near the screen's bottom. NoteWindowManager.setCollapsed resizes the panel to NoteLayout.collapsedHeight from the edge rolledFrame picks (pure, tested) — and a bar let go near the bottom glides there too (NotePanel.performDrag returns on mouse-up → snapToBottom) — remembers the real height in expandedHeights, and scheduleFrameSave persists the expanded frame while collapsed so nothing is lost. The bar is frameless (NotePanel.setRolledUp; it draws its own capsule) because macOS rounds a titled window at a fixed 16pt that splits from a thin bar's fill. The bar is the note's top row (NoteHeaderView: title + hover controls, isRolledUp adds the count and trims the controls), so the roll is a pure window shade; NoteView drops the list only once the window is down to bar height (showsBar). The roll is an animator() frame animation, not the blocking setFrame(_:display:animate:) (SwiftUI only swapped the content after it); the system frame returns before expanding and goes only after rolling up, since a titled window's shadow tracks a resize. The bar has no shadow: a frameless window's traces the capsule with a dark rim that reads as a border. NotePanel sets hosting.sizingOptions = [], so only the manager sizes a note: left on, the hosting view resized the window from inside a layout pass when the hover controls raised the content's minimum, and a bar has so few views that AppKit's limit on layout passes (one per view) aborted the app (issue 22). So the minimums live in windowWillResize, which also locks the bar's height, and the content has minHeight: 0 to fit a window mid-roll.
  • Theming via roles, not raw colors. NoteColor.color(_:on:) resolves a role (title/task/secondary/completed/checkbox) for a Surface (.solid uses per-theme tuned inks; .glass uses adaptive .primary/.secondary). Views read a resolved NoteTheme, never branch on material themselves.
  • Updates install in place, after a confirmation (UpdateChecker + UpdateInstaller). A GET of the GitHub releases list at launch and then daily or weekly (Frequency, Settings › General; Never turns it off; lastChecked is remembered and re-evaluated hourly) (one request brings every release's git-cliff notes, parsed by ReleaseNotes), compared numerically against CFBundleShortVersionString (nil under swift run → checker off). The menu item and the banner open the update window (UpdateView, a floating panel from AppModel.openUpdate): the notes for every version since the installed one, then Update Later / Update Now. Update Now (UpdateInstaller.install) downloads the pinned version's Tic.zip, checks Tic.zip.sha256, unpacks with ditto, refuses a different bundle id, version, or a broken codesign --verify --strict, then swaps it in with two renames (old copy restored on failure); relaunchAfterExit + NSApp.terminate restart into it. A folder Tic can't write to (standard account, App Translocation) fails with a message and Open Release Page. No Sparkle and no signing needed: files Tic downloads get no quarantine flag (it isn't sandboxed and doesn't set LSFileQuarantineEnabled), same as curl in site/public/install.sh. The installer and the restart are injected closures, so tests never quit the runner. A newer tag also shows a menu-bar item, a dot on the menu-bar icon until the menu is opened, the window shown, or the item clicked (isUnseen, remembered in the updateSeenVersion default; "opened" is detected via NSMenu.didEndTrackingNotification on a menu containing our item; the dot is drawn into a second template NSImage because the status item renders only the label's image, never a SwiftUI overlay), and one notification banner per version (updateNotifiedVersion; authorization is requested only then, so the system prompt appears in context). UNUserNotificationCenter needs a bundle id, so both the delegate and the banner are guarded. package.sh defaults VERSION to the latest git tag so a local build isn't "outdated".
    • Seeing it locally: VERSION=0.1.0 ./scripts/package.sh --open shows the menu item and the dot. The banner is stricter: macOS refuses notification authorization (UNErrorDomain code 1, "Notifications are not allowed for this application") for an ad-hoc bundle outside /Applications, and the refusal seemed to stick to the bundle id afterwards. So to test the banner, copy the build to /Applications/Tic Dev.app, give it a unique CFBundleIdentifier (PlistBuddy), re-sign ad-hoc, then open it. Re-arm with defaults delete <bundle id> updateNotifiedVersion updateSeenVersion, and delete the copy after.
  • Models are sync-friendly. Note/TaskItem use UUID PKs, which is what lets SyncMerge key every register by id across Macs.

Swift 6 strict concurrency

swift-tools-version: 6.0 enables Swift 6 language mode. AppDatabase is Sendable; controller and manager are @MainActor. Recurring gotchas when editing: don't capture a mutable var in a @Sendable/Task closure (snapshot to a let first); PreferenceKey.defaultValue must be a let; qualify CGFloat.greatestFiniteMagnitude to avoid Double ambiguity in NSSize.

Note: SourceKit sometimes reports Cannot find 'X' in scope for newly added files in the same module — trust swift build, which resolves them.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.