Notechondria

Version: 0.1.62 Build Date: 2026-04-22T23:55

What's Changed

Ping command in debug log terminal + backend ping endpoint

  • Added a ping command to the shared DebugLogCard terminal. Typing ping in the nchron-shell issues a GET to a new backend /api/v1/ping/ endpoint and prints the round-trip latency plus the service identifier:

    $ / ping
    pinging backend...
    pong: 48ms — pong from notechondria-backend
    

Backend

  • New notechondria.api_views.ping view — @require_GET, returns {pong: true, service: "notechondria-backend", timestamp: ISO}. Small payload by design; the frontend only needs pong and timestamp to prove the path is live.
  • URL wired at /api/v1/ping/ in notechondria/api_urls.py.
  • New notechondria/tests.py with PingEndpointTests (200
    • pong=true, GET-only) and a fresh HandshakeEndpointTests covering the existing /handshake/ contract. Neither endpoint had test coverage before.

Frontend (shared)

  • PingResult value object (ok / latencyMs / detail) exported from notechondria_shared.
  • DebugLogCard.onPing callback (optional Future<PingResult> Function()); when null the command prints "no backend ping handler wired on this host".
  • _handlePing state method shows "pinging backend…" then renders the result line.
  • New pingBackend(String? apiBaseUrl) helper in notechondria_shared/lib/src/utils/ping_backend.dart — lightweight http.get with a 10-second timeout, returns PingResult (ok=false on non-200, timeout, malformed JSON).
  • Terminal welcome banner + help text updated to mention ping.

Per-app wiring

  • editor_app / planner_app / portal_app settings DebugLogCard callers all pass onPing: () => pingBackend(widget.apiBaseUrl). No per-app divergence — the helper is shared.

Files Changed

  • backend/notechondria/api_views.py — new ping view.
  • backend/notechondria/api_urls.py — wires /api/v1/ping/.
  • backend/notechondria/tests.py (new) — PingEndpointTests + HandshakeEndpointTests.
  • frontend/notechondria_shared/lib/src/components/debug_log.dartPingResult, DebugLogCard.onPing, _handlePing, ping case in _runCommand.
  • frontend/notechondria_shared/lib/src/utils/ping_backend.dart (new).
  • frontend/notechondria_shared/lib/notechondria_shared.dart — exports.
  • frontend/editor_app/lib/modules/settings_build.dartonPing: () => pingBackend(widget.apiBaseUrl).
  • frontend/planner_app/lib/modules/settings.dart — same.
  • frontend/portal_app/lib/modules/settings.dart — same.

Notes

  • Backend tests not run locally during the round (no venv on the dev machine). The view is a trivial mirror of the existing handshake view, so the test added in this round is review- level coverage; full validation happens in CI.