Use this when generating or editing content for taskTimer so answers match this tree (GJS + GTK desktop app), not a generic Go or React monorepo.
The following are not in the repository (do not invent or “read” them as if present):
| Assumed path | Reality |
|---|---|
internal/server/router.go |
Absent — no Go HTTP router. |
internal/service/ (or similar Go service package) |
Absent — no Go service layer. |
internal/db/, db.go, SQL migrations, db.InitDB |
Absent — persistence is JSON (standalone) and GSettings (extension). |
server.SetupRouter, shared typed constructor for main + tests |
Absent — no HTTP router setup; tests are GJS scripts, not a Go test harness reusing NewApp(...). |
There is no main.go with HTTP route registration, no explicit server or router constructor (NewServer, mux, etc.), and no single place that wires HTTP stack dependencies (NewHTTPServer, DB + router + middleware). Checklist patterns about composition roots for an HTTP server do not apply; runtime deps are OS packages (see BUILD.md), not an in-process HTTP stack.
- architecture.md — layout, Mermaid diagrams, N/A checklist table.
- deployment.md — AppImage, Docker shell, CI overview.
- BUILD.md —
maketargets and tests.
When splitting complex functions, prefer helpers in the same place first, then widen only if reuse or clarity demands it:
- Same file — private functions at module top level (e.g.
function prefsAddChild(...)next to the class inprefs.js), or methods on the same class (_foohelpers onPreferencesBuilder). - Same “package” — the same import root: e.g. only
taskTimer@CryptoD/modules, or onlyplatform/standalone/, before introducing new cross-tree coupling. - New files — add only when a helper is shared by multiple modules or the original file would become hard to navigate.
This matches how the codebase already groups extension code under taskTimer@CryptoD/ and standalone GTK under platform/standalone/.
- Preserve behavior — treat refactors as behavior-preserving unless the task explicitly calls for a user-visible or API change. When in doubt, compare before/after flows and run
make test. - Add or adjust tests before large edits — for substantial changes (big refactors, new timer/settings paths, GTK wiring), extend
tests/test*.jsor add a focused script first somake testguards the change; then apply the edit. Smaller fixes can follow tests-in-the-same-PR. See BUILD.md for how tests are run.
- Do not reuse vague checklist lines like “handlers in main” (HTTP handlers wired in
main.go). - Do refer to
main.jsas the GJS standalone entry (Gtk.Application, CLI flags), andtaskTimer@CryptoD/extension.jsfor the GNOME Shell extension.
Checklist advice such as “minimize diff in main.go” or “keep SetupRouter testable” targets a Go HTTP codebase. This repo has no main.go and no SetupRouter.
- Do not suggest splitting or slimming
main.go, extractingSetupRouterfor tests, or injecting a router for unit tests—those files and APIs do not exist. - Do treat
main.jsas the real entry; prefer small, local changes that match existing GJS style. For testability, usetests/test*.jsand shared modules undertaskTimer@CryptoD/, not HTTP router extraction. - Do not add new globals (
globalThis.foo, strayvarat top level) for features; keep module scope andimports. Keepmain.jsto wiring +Gtk.Application.run()—see “Done when (thinmain+ no stray globals — GJS analogue)” in architecture.md.