2 Adding Things
Nate edited this page 2026-11-21 20:21:39 -08:00

Adding things

  • A nav item: add the entry to sectionNav (nav.go) and the matching line to quickJumpPages (app.js), same label, Title Case. The parity test checks you.
  • A page: template in templates/, route + section wiring, and if it needs its own JS, a per-surface file gated in base.html on the section or NavPage. No executable inline scripts in templates: CSP serves scripts from 'self' only. The single inline pattern is a <script type="application/json"> data block (the planner's plan-data), which is data, not code.
  • A JS widget: a banner section in the surface's file (the // --- Name --- banners are the table of contents), an onReady subscription scoped to root, teardown on will-swap for anything global, and a node test in internal/app/jstest/ if it carries logic worth pinning: the pipeline's JS step names its files explicitly, so add new test files to .gitlab-ci.yml and .github/workflows/heavy-gates.yml too.
  • A home widget: manifest entry, registry entry, template block keyed by widget id, data from a stored source. Follow an existing widget end to end; the trade-ideas module is a recent complete example.

Testing

Mirror CI exactly before pushing: make assets, gofmt -l cmd internal, go vet ./..., go test ./..., and the node list from the workflow. Tests ship in the same commit as the behavior change: every historical CI failure here was tests lagging the code, never the reverse. While iterating, run the affected package only; run the full gate once, on the final tree.

Don'ts

  • No bundler, TypeScript, or npm dependency for the shipped front end (see "The model"). Native language features only.
  • No new global namespace. window.EveSynapseContent and window.EveSynapseModal are the existing surface; extend those patterns rather than minting another.
  • No document-level listener or timer without a will-swap teardown or a bind-once guard.
  • No fetching at render what ingest could have stored.
  • No inline event handlers or executable inline scripts in templates (JSON data blocks are the one exception).
  • No second implementation of anything in "The common pieces".