Skip to content

Latest commit

 

History

History
70 lines (58 loc) · 4.74 KB

support.md

File metadata and controls

70 lines (58 loc) · 4.74 KB

Support

One window, one checkout link, and a checkbox deciding whether it may ever reopen itself. Every other surface (the website's hero and footer, the docs sidebar, the README badge) links to the same URL, so SupportCoordinator.checkout is the only place the app's destination is written down. The website hero shares the checkout page's brief offer copy from website/src/data/support.ts.

Invariants

  • Showing the window is what moves the anchor. SupportCoordinator.showSupport() calls markAsked() on every route into the window: the palette's app menu, Settings → About, the menu bar, the launcher command and the reminder itself. Someone who has just read the pitch is not asked again next week, however they came to it, and one call site is what keeps that true.
  • The reminder never takes focus from something the user started. presentIfDue() returns without presenting unless AppCore.canInterruptUser, which is UpdateReadiness over AppCore.currentActivity. A withheld ask leaves the anchor alone, so it is still owed and the pump comes back in ten minutes rather than a month.
  • The checkbox defaults on, and off leaves one ask a year. AppSettings.supportRemindersEnabled reads defaults.object(forKey:) == nil || defaults.bool(forKey:), so absence is on and a stored false survives. It rides a settings backup: it grants no capability, it silences a prompt, and a user who turned it off should stay off across a restore. Off, only SupportReminderSchedule.givingWeek(in:) asks.
  • The schedule state is a file, not a default. support-reminder.json lives under AppPaths.applicationSupport(), not caches(): a purged cache would reset the anchor and ask early. It holds firstSeenAt and lastAskedAt and nothing else; the preference stays in AppSettings, and the two never mix.
  • The first ask lands one interval after first run, not after launch. With no lastAskedAt the anchor is firstSeenAt, stamped the first time the store finds no file, so a fresh install is never asked on day one.
  • One button, one link. SupportCoordinator.checkout is the only app destination. The checkout page owns the offer and fulfillment details; the website hero reuses its brief product copy. Adding a second button means adding a second thing to keep in sync.
  • The button is the composition, not its footer. It sits under the pitch, because this window asks rather than reports; an actions row pinned to the bottom edge reads as a utility dialog.
  • Only the brand artwork is shared. The mark and backdrop are BrandArtwork, as in Onboarding; the button is the system's .borderedProminent capsule tinted brand.

How it is put together

Piece Holds
Model/SupportReminderSchedule.swift pure: the wait until the next ask, and each giving week
Service/SupportReminderStore.swift the JSON state, and the one Task pump that offers the ask
UI/SupportCoordinator.swift the window's lifecycle, the checkout link, the anchor write
UI/SupportWindowView.swift the window: mark, pitch, the button, the reminder checkbox

SupportReminderStore.advance() is one turn of the pump: it answers how long to sleep, and calls onDue when the ask is due. AppCore.start() wires that closure to supportCoordinator.presentIfDue(). The store itself never presents anything and never writes the anchor on its own; that write belongs to the coordinator, so there is exactly one of it.

Showing the window is what moves the anchor; an ask still due after onDue was withheld, and the pump retries it after the retry interval rather than spinning on it.

The window

AppWindowController at 460pt wide, taking the height its content measured through .onGeometryChange → fit(height:). It is titled and transparent-titlebar'd, so ActivationPolicy brings the Dock icon in and out on its own, and ⌘W or the close button dismisses it.

The composition is centred: the 64pt BrandArtwork.Mark, the ask in .largeTitle, the pitch, the button, then the reminder checkbox. BrandArtwork.Atmosphere runs under the transparent titlebar. Nothing carries a keyboard shortcut: ↵ silently opening a payment page is a surprise rather than a convenience.

Where it is reachable from

The palette's bottom-left menu circle (beside About), Settings → About, the menu bar menu, and the launcher as CommandID.support. All four land on showSupport(). The launcher arm hides the palette first, the way .about does; the menu-circle row does not, because the panel dismisses itself on windowDidResignKey.