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.
- site/AGENTS.mdAGENTS.md
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
- Very specific: line 27
Test it with TIC_DEST=<tmp dir> and a stub open first on PATH.
- Very specific: line 324
Update Now. Update Now (UpdateInstaller.install) downloads the pinned version's Tic.zip, checks Tic.zip.sha256, unpacks with ditto, refuses …
≈ “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.
Files
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 (seesite/README.md); never add JS files to the repo root. - Install/update script:
site/public/install.sh, served ascurl -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 verifiesTic.zip.sha256and quits only the app process (thepgrep -fpattern is anchored, soTic --mcphelpers and their wrappers survive). Test it withTIC_DEST=<tmp dir>and a stubopenfirst onPATH. - 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 underswift test(NSApp.isRunningis false), and there aNotePanelignores 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 runproduces 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 realdist/Tic.appwith bundle idcom.kasvith.ticand the icon fromAssets/AppIcon/Tic.icns(→Resources/AppIcon.icns, referenced byCFBundleIconFile). 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 (moveTic.appto /Applications). - Tests:
swift test(Swift Testing;@testable import Ticworks on the executable target — no separate library).Assets/holds source icon art (AppIcon / Flat / MenuBar); the menu-bar glyph is also copied toSources/Tic/Resources/MenuBarIcon.pngand bundled via SwiftPM. - CI/Release:
.github/workflows/—ci.yml(build + test + lint) andrelease.yml(push av*tag → buildsTic.app, git-cliff release notes, publishes a GitHub Release (versioned DMG + a stable-namedTic.zipandTic.zip.sha256, whichreleases/latest/download/…always resolves), commits the regeneratedCHANGELOG.mdto main, then POSTs theCF_DEPLOY_HOOKsecret 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/Ticin 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 launchIn 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(AppKitNSPanel) — 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).isMovableByWindowBackgroundis off on purpose.NoteWindowManager(@MainActor) — owns[UUID: NotePanel]+[UUID: NoteController], is each panel'sNSWindowDelegate, and is the single chokepoint for all window mutation:restoreAll(launch: only notes withisOpen— 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.isFullScreentells 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:placeputs 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 ondidChangeScreenParametersNotificationwith 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 theNote, streams its tasks live via GRDBValueObservation, 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) — GRDBDatabaseQueue+DatabaseMigrator, async CRUD, andValueObservationstreams.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), levelnormalizedLevels, and the id-matchedindentLevelChangesdiff. Kept separate so it's unit-testable in isolation.PlainTextEditor(NSViewRepresentableoverNSTextView) — the task / quick-add editor. AppKit, not SwiftUITextField, because that control can't reliably insert newlines or intercept Tab on macOS (see the editing convention below).QuickAddBaris the add-a-task bar along the bottom of a note (owns the typed text and pending indent).ShortcutHintis 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.ImageVieweris the image window a double-click opens (AppKitZoomScrollViewzoom + Open in Preview), dressed like its note (paper/glass background, note-style header, hints) — one reusableImageWindowowned byNoteWindowManager; far quicker than launching Preview.- MCP server (
MCP/) — lets AI agents drive Tic.MCPServiceruns anNWListeneron a Unix socket beside the DB (~/Library/Application Support/Tic/mcp.sock, 0600) — one official-SDKServersession per connection (per agent).MCPToolsis the tool surface (create_note,add_tasks,update_task,move_task, …): pureAppDatabasewrites plus three window pokes (WindowActions), reusingTaskOutlinefor every structural rule so tools and UI can't diverge. Clients speak stdio toTic --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 existingValueObservationstreams push into open panels; the one addition isobserveNote(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 onlydevices/<id>.json(aSyncSnapshot) and reads the others, so a sync service never sees a conflict.SyncMerge(pure, likeTaskOutline) is a state-based CRDT: every synced field is aRegister(newest stamp wins), a note's whole outline (order + nesting) is one register, delete always wins, and stamps aremax(now, clock + 1)so an edit made after seeing a change beats it on a slow clock.recorddiffs the DB againstresolve(snapshot)(not the raw registers), so values this Mac adjusted on apply never look like local edits.AppDatabase.syncCycledoes record → merge → apply in one write transaction, touching only synced columns: frame,isOpen, collapsed, float, all-Spaces and the note's ownsortIndexstay 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.jsonholds them all), but the folder file ispublished()— 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 (thesyncLocalDeletetable, filled by anAFTER DELETEtrigger, 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 asimages/<sha256>.png(immutable, named bytaskImage.hash, filled on write or lazily by the first sync); a task'simageregister 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.observeTaskImageCropscarries 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 aproblem.NoteWindowManager.syncis 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 insync-state.jsonbeside the DB and its device id in thesyncDeviceIDdefault (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 newerschema— bump it when the format changes orNoteColor/NoteMaterialgains 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 (syncEnableddefault). - 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.dockEdgeis per Mac (not synced), and while docked the saved frame is where it peeks. Tab and peek are the same panel:NoteViewdrawsDockTabViewwhenever the window is ≤DockLayout.maxTabWidthwide (a note is never that narrow), as it draws the bar by height, so the manager only sets frames.NotePanel.performDragasksonDragMovefor 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 (autoFocuswhile 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 whileisInUse: a drag or resize, its popover or a sheet, its picture, a menu viamenusOpen; 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 brieforderOut), 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 oncepointerLocationhas 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 globalmouseMovedmonitor; in tests installing that stalled the main thread. Gone with the sliver.) A plainsetFramedoesn't stop a running frame animation (probed: the animation wins), so frames set over a possible slide go throughsetFrameNow(a zero-length animation replaces it), andperformDragstarts 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 owndockEdges: the controller'snotecan hold a stale observed row, sosetDockEdgealways 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.iconholds one emoji orsymbol:<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 openingIconPicker(Emoji / Symbols tabs, All emoji…, Remove). All emoji… types intoEmojiCatcher, 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 therecentEmojidefault 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 getsharingType = .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 SwiftUISettingsscene (⌘, and Tic › Settings… come free) with threeForm(.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 thesettingsTabdefault. The menu-bar item callsopenSettingsafterNSApp.activate(): a window opened from a menu-bar menu otherwise appears behind the frontmost app. - App shell —
TicAppprovides aMenuBarExtra;main.swift(not@main) routes--mcpto the proxy, elseTicApp.main();AppDelegate(NSApplicationDelegateAdaptor) builds the sharedAppDatabase+NoteWindowManagerand callsrestoreAll()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 onAppDatabase(updateNoteFrame,updateNoteTitle, …). For tasks,applyStructuralUpdate(optional delete +sortIndexreorder +indentLevel, all in one transaction) andupdateTaskCompletion(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-recordupdate()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).TaskOutlinekeeps the outline invariant (first row level 0; no row more than one level deeper than the row above) vianormalizedLevelsafter every structural edit, so an orphaned/jumped level can never render. When persisting level changes, diff by id against the currenttasks(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 viainsertTask(_:reordering:); everything else appends withinsertTask(atomicMAX(sortIndex)+1, so deletes leaving gaps can't collide). - Completion changes only via
toggle; structural edits preserve ticks.toggleruns 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 touchisDone— moving a checked item around leaves every tick exactly as it was. - The editor is AppKit (
PlainTextEditor/NSTextView), not SwiftUITextField. On macOS that control neither reliably inserts line breaks nor lets us intercept Tab (the key-view loop eats it before.onKeyPress).EditorTextView.keyDowngives deterministic chords: Return commits, Shift/Option-Return inserts a newline, Shift-Tab nests, Ctrl-Shift-Tab outdents. It forces TextKit 1 (_ = view.layoutManager) sousedRectcan size it (TextKit 2'slayoutManageris nil and multiline would clip), reports height viasizeThatFits, and aneditorFirstBaseline()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(PKtaskId, 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 soobserveTasksnever loads blobs, and the crop has its own targetedupdateTaskImageCrop. The controller observes only crops (observeTaskImageCrops, neverdata) and decodes a downsampled thumbnail off the main actor; rows draw that throughCroppedImageCache, never the full image (a drag re-renders every row each frame). ⌘V routing: a focusedEditorTextView.paste(row → attach; quick-add →stageImage), otherwiseNotePanel.paste(alsostageImage, which focuses the quick-add viaquickAddFocusRequest). 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.pastableImageDatadecides 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 SwiftUIDragGesturethere kept following the pointer after mouse-up, and SwiftUI focus never arrived, so ⏎ / ⎋ / click-away did nothing. Images size through theAspectFitlayout:.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 rowDragGestureotherwise 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.NoteBackgroundrenders the.glassmaterial 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.glassEffectAPI is for in-app controls and won't sample the desktop behind a window. - The window drags only by its header.
isMovableByWindowBackgroundis off;WindowMoveArea(anNSViewRepresentablecallingwindow.performDrag) is placed behind the header / collapsed bar. This is what lets task rows be dragged to reorder without moving the window. The panel isisMovable = 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 alongsideperformDrag, tiled the note at a screen edge, and pulled it toward edges while ours followed the pointer, so notes wiggled near edges. (A handle withmouseDownCanMoveWindow = falsealone 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), viaNoteController.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.activeAlwaystracking area goes by geometry alone. (SyntheticmouseMovedevents 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 ghostDropPlaceholderat 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).ReorderDragTestshosts a realNoteViewin aNotePaneland drives it with synthetic events viawindow.sendEvent(notNSApp.postEvent+ anextEventpump, 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 aPreferenceKey; 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@ObservableReorderDrag, read only byLiftedRow, so the list re-renders on slot/level changes, not every frame. Drop rules are pure inTaskOutline(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 theScrollView. - Roll-up keeps the top edge fixed — or the bottom, near the screen's bottom.
NoteWindowManager.setCollapsedresizes the panel toNoteLayout.collapsedHeightfrom the edgerolledFramepicks (pure, tested) — and a bar let go near the bottom glides there too (NotePanel.performDragreturns on mouse-up →snapToBottom) — remembers the real height inexpandedHeights, andscheduleFrameSavepersists 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,isRolledUpadds the count and trims the controls), so the roll is a pure window shade;NoteViewdrops the list only once the window is down to bar height (showsBar). The roll is ananimator()frame animation, not the blockingsetFrame(_: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.NotePanelsetshosting.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 inwindowWillResize, which also locks the bar's height, and the content hasminHeight: 0to fit a window mid-roll. - Theming via roles, not raw colors.
NoteColor.color(_:on:)resolves a role (title/task/secondary/completed/checkbox) for aSurface(.soliduses per-theme tuned inks;.glassuses adaptive.primary/.secondary). Views read a resolvedNoteTheme, 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;lastCheckedis remembered and re-evaluated hourly) (one request brings every release's git-cliff notes, parsed byReleaseNotes), compared numerically againstCFBundleShortVersionString(nil underswift run→ checker off). The menu item and the banner open the update window (UpdateView, a floating panel fromAppModel.openUpdate): the notes for every version since the installed one, then Update Later / Update Now. Update Now (UpdateInstaller.install) downloads the pinned version'sTic.zip, checksTic.zip.sha256, unpacks withditto, refuses a different bundle id, version, or a brokencodesign --verify --strict, then swaps it in with two renames (old copy restored on failure);relaunchAfterExit+NSApp.terminaterestart 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 setLSFileQuarantineEnabled), same ascurlinsite/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 theupdateSeenVersiondefault; "opened" is detected viaNSMenu.didEndTrackingNotificationon a menu containing our item; the dot is drawn into a second templateNSImagebecause 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).UNUserNotificationCenterneeds a bundle id, so both the delegate and the banner are guarded.package.shdefaultsVERSIONto the latest git tag so a local build isn't "outdated".- Seeing it locally:
VERSION=0.1.0 ./scripts/package.sh --openshows the menu item and the dot. The banner is stricter: macOS refuses notification authorization (UNErrorDomaincode 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 uniqueCFBundleIdentifier(PlistBuddy), re-sign ad-hoc, thenopenit. Re-arm withdefaults delete <bundle id> updateNotifiedVersion updateSeenVersion, and delete the copy after.
- Seeing it locally:
- Models are sync-friendly.
Note/TaskItemuseUUIDPKs, which is what letsSyncMergekey 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 scopefor newly added files in the same module — trustswift build, which resolves them.
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
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.

