Skip to content

Desktop app with Dock icon, menu-bar & Notification Center widgets, full test suite and CI - #1

Merged
yairixStudio merged 7 commits into
mainfrom
feature/desktop-app-tests-ux
Oct 8, 2026
Merged

yairixStudio merged 7 commits into
mainfrom
feature/desktop-app-tests-ux

Conversation

@yairixStudio

Copy link
Copy Markdown
Owner

Why

The installed Clockwize.app was a shell script that opened Terminal + a browser and exited, so nothing stayed in the Dock (and the separate menu-bar app hid its Dock icon on purpose).

What

  • Desktop app (desktop/) – one Electron app: window with a unified title bar, Dock icon, native menus; runs the API server in a utility process from the project folder (same DB/.env/uploads); menu-bar popover with the live timer, totals and recent work; passkey sign-in handed to the browser with automatic session hand-off; npm run desktop:install.
  • Widgets (desktop/widget/) – WidgetKit Notification Center widgets + a Control Center / menu-bar toggle, fed over a loopback endpoint with a per-install secret.
  • Server reliability – one server per DB file (lock), atomic coalesced DB writes, all data paths overridable by env, createApp() for tests; suspended users signed out immediately; many fixes surfaced by the tests (cross-workspace leaks, partial updates wiping fields, 500s, share-link bypasses).
  • UI/UX – layer and spacing tokens, focus rings, sidebar timer, time log, payments filters, mobile layouts, nested links, edge tabs no longer covering buttons; extension token bridge locked down.
  • Tests & CI – 396 server (vitest + supertest), 329 client (vitest + Testing Library), 30 Playwright e2e (desktop + mobile, no horizontal scroll at 390px), 5 Electron tests; GitHub Actions on every push, including a macOS job for the desktop app.

Notes

  • Follow-ups are in BACKLOG.md (proposed).
  • The first commit is pre-existing local work (security hardening, passkeys, branding) that had not been committed.

🤖 Generated with Claude Code

Clockwize and others added 7 commits October 8, 2026 00:36
Commits the local work that was sitting uncommitted since August:
encrypted secrets via ENCRYPTION_SECRET, required JWT_SECRET, passkey
login, input sanitising, an error boundary, new icons and branding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Split index.js into createApp() (app.js) and the listen step; every data
  path (DB, uploads, backups, port/session files, client build) is
  overridable via CLOCKWIZE_* env (paths.js), so tests never touch real data
- One server per database file (dbLock.js): a second server bows out and
  reports the running one, instead of silently overwriting its writes
- Database saves are coalesced per tick and written atomically
  (temp file + fsync + rename), flushed on exit
- Serve the built client with an SPA fallback, JSON 404 for unknown /api
  routes, backup endpoints now require a login
- /api/desktop/summary for the menu-bar popover and widget,
  /api/auth/desktop-handoff for passkey sign-in through the browser
- Passkeys accept any http://localhost:<port> origin when RP_ORIGINS is unset
- Suspended/deleted users lose access immediately; seeded admin gets a
  workspace on a fresh install; time entries listed newest first
- 396 vitest + supertest tests (auth, workspace isolation, timer math,
  payments, sharing, credentials encryption, files, leads, ...) and the
  route fixes they surfaced: cross-workspace leaks, partial updates wiping
  fields, 500s on missing fields, GCM tag length, share-link bypasses

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- vitest + Testing Library suite (329 tests): utils, api client, store,
  hooks, components, login; fixes for UTC date inputs, month navigation,
  file download workspace header, modal context re-render loop
- Layout tokens: spacing scale, a single z-index layer scale, visible
  keyboard focus, reduced-motion support
- Sidebar timer no longer clipped; compact mobile header timer
- Time log: newest first, inline toolbar, readable durations, correct
  time ranges in RTL, card layout on phones; payments filters in a grid
  with labelled date fields; search icons no longer cover the text
- Dashboard: no nested links, carousel edge fade, dots fit on phones;
  notes/AI edge tabs no longer cover row buttons
- Desktop app: hidden title bar layout, system font, passkey sign-in via
  the browser with automatic hand-off; lock the extension token bridge
  to the extension's own frame
- Login/Register labels linked to their fields with autocomplete hints;
  closed mobile menu is inert; client timer saves with real start/end

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- e2e against a throwaway server (temp data dir, random secrets): auth,
  client -> project -> task -> timer -> entry, every route loads without
  errors, sharing, mobile menu, no horizontal scroll at 390px
- CI on every push: server tests, client tests + build, e2e, and the
  desktop app's Electron tests on macOS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The installed Clockwize.app was a shell script that opened Terminal and a
browser and then exited, so nothing stayed in the Dock (and the separate
menu-bar app hid its Dock icon on purpose). It is now one Electron app:

- Window with a unified title bar, native Edit/View/Window menus and a
  right-click menu; closing hides it, the Dock icon brings it back, Cmd+Q
  quits and stops the server
- Runs server/index.js in a utility process on Electron's bundled Node,
  from the project folder (same database, .env and uploads), or attaches
  to a server that already owns the database; loading/error screen
- Menu-bar popover (vibrancy panel): live timer, pause/resume/stop/discard,
  today and week totals, start recent work; right-click menu; Dock menu
- Passkey sign-in hands off to the default browser and the window adopts
  the session automatically
- WidgetKit extension (desktop/widget): small/medium Notification Center
  widgets and a Control Center / menu-bar toggle, fed over a loopback
  endpoint with a per-install secret (no App Group or token sharing)
- install-app: builds client + widget, signs with the local certificate
  (ad-hoc without one), backs up the database, installs to /Applications
- Playwright tests for the Electron app: Dock icon visible, window loads,
  close keeps running, popover keeps the Dock icon, widget feed auth

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReminderItem imports date-fns, which only resolved locally through the
root node_modules (a dependency of concurrently). A clean client install,
as in CI, failed to build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yairixStudio
yairixStudio merged commit 2d36517 into main Oct 8, 2026
8 checks passed
@yairixStudio
yairixStudio deleted the feature/desktop-app-tests-ux branch October 8, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants