158 Commits

Author SHA1 Message Date
4e28b812bd chore: gitignore runtime artifacts, drop orphan 00 and AI roadmap
Add loadtest/run.pid and loadtest/run.err to .gitignore so k6 runtime
state stops tagging along on git add. Also ignore the orphan /00 file
(stray redirect of pkg/observability/tracing.go) and ROADMAP.md (AI-
synthesised audit doc, not part of the project canon).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 09:51:14 +02:00
7b92636b64 add video
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 18:16:21 +02:00
17df27ae20 some updates
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 17:48:07 +02:00
52d58583e9 db telemetry
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 16:29:07 +02:00
327bb9c867 cleanup
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 11:28:28 +02:00
9a5fff81bf fix: defer component logger creation past package init
Some checks failed
Deploy / deploy (push) Has been cancelled
Package-level slog.With() vars are evaluated at init time, before
observability.InitLogger() runs in main. They captured the original default
slog handler and bypassed the countingHandler that increments
log_messages_total — so warn/error calls from these packages weren't being
counted.

Convert to functions so each call resolves slog.Default() at use time and
inherits the active counting handler.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 22:26:03 +02:00
1c10cf4390 feat: structured logging with component tags + severity levels
Some checks failed
Deploy / deploy (push) Has been cancelled
Convert log.Printf calls in webhook, reconcile, addresses, and auth handlers
to slog with a consistent `component` attribute. Severity now reflects
operational urgency:

- warn: signature failures, declined cards, unknown fingerprints, vendor
  validation rejections, reconciler patching a missed charge
- error: DB write failures, malformed Stripe payloads, token generation
  failures
- info: successful order/card events, normal reconciler ticks

Lets Loki/Prometheus filter by component (e.g. {component="webhook"}) and
gives the log-level dashboard panel real warn/error series instead of a
flat info line.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 22:14:06 +02:00
ae7eaa8e97 feat: route audit + recovery through slog levels
Some checks failed
Deploy / deploy (push) Has been cancelled
Audit events now emit at Info/Warn/Error so the log-level counter has variety
instead of being pinned to info. Panic recovery uses structured slog.Error
with method/path/stack attrs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 13:55:54 +02:00
8ca209a4cc feat: add cart/auth/stripe metrics and slog-based log-level counter
Some checks failed
Deploy / deploy (push) Has been cancelled
Adds Prometheus instrumentation across the checkout funnel, auth flow,
Stripe calls, rate limiters, and HTTP middleware (inflight gauge, request
and response sizes). Introduces a slog handler that counts log lines by
level so the dashboard can show error/warn rates; existing log.Printf
calls are routed through slog and counted as info.

Backs the new "terminalshop — Service Overview" Grafana dashboard.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 13:38:24 +02:00
9e9a8325a8 feat: track created orders metric
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-30 14:37:46 +02:00
179c8011ca added logger
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-30 12:07:21 +02:00
9d4549a32d feat: add OpenTelemetry tracing
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-30 11:35:10 +02:00
31b8e82e47 fix: widen histogram buckets to resolve sub-5ms latency
Some checks failed
Deploy / deploy (push) Has been cancelled
Default prometheus.DefBuckets bottoms out at 5ms, which made every
route's p95 collapse to 4.75ms (histogram_quantile interpolation
within the smallest bucket). Custom buckets from 100µs to 5s now
distinguish microsecond-fast routes (health) from slower ones
(stripe-backed cart endpoints).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 08:44:56 +02:00
67c8a6bafb feature: expose /metrics with prometheus client_golang
Some checks failed
Deploy / deploy (push) Has been cancelled
Adds Counter (http_requests_total) and Histogram
(http_request_duration_seconds) labeled by method, chi route pattern,
and status. Wired through a new Metrics middleware (after Recovery so
panics-turned-500s are still counted) and an unauthenticated /metrics
endpoint at the root for Prometheus to scrape.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 20:40:39 +02:00
67f01f4a38 feature: accpet HEAD on /health and /ping for monitoring probes
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-29 15:49:26 +02:00
f47c10ed8a refactor: structured error handling + CreateBox/formatListItem in checkout
Some checks failed
Deploy / deploy (push) Has been cancelled
Replace ErrorMsg string with typed VisibleError struct. Add catch-all
error handler at top of Update() that auto-recovers cart on shop/cart
errors. ESC now dismisses error banners. Refactor shipping address and
payment card checkout lists to use CreateBox + formatListItem for
consistent bordered cards with radio indicators.

Written with Claude Code (claude.ai/code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-27 20:52:52 +02:00
b35103657d refactor: add formatListItem helper and apply address/card lists
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 20:13:25 +02:00
42abf11d04 refactor: extract reusable CreateBox component for bordered card styling
Some checks failed
Deploy / deploy (push) Has been cancelled
replacing duplicated border/selection logic in
  account_orders.go and cart.go. Also fixes a latent SSH rendering bug
  in cart.go where lipgloss.NewStyle() was used instead of theme.Base().
2026-04-27 15:04:00 +02:00
96c9be61ff updating the about section
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 10:54:58 +02:00
80166ae8d0 lets try this instead
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 10:48:30 +02:00
6bcf651afd fix: my last change was very wrong, i think i made it in my sleep. this should do the trick though
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 10:40:41 +02:00
cbb3e59878 update: update the not-selected address items in th address list
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 08:15:10 +02:00
00dd63668b fix: fix address not appending to address list in account page after adding it
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 13:16:14 +02:00
bd93989036 fix: all keybinds becoming unreactive after completing an order
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 12:50:51 +02:00
4083495704 fix: fixed payment not going through if no address and card were saved
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 12:21:16 +02:00
7bebdeebed fix: fixed card and address list having duplicate items, and a checkout flow infinate loop condition
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 11:59:24 +02:00
e0ff8f5f76 update: update the FAQ section
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 11:12:05 +02:00
011bf3a4ff fix: use theme.Base() for order card border so colors render over SSH
Some checks failed
Deploy / deploy (push) Has been cancelled
lipgloss.NewStyle() uses the default renderer which can't output colors
over SSH. Switching to m.theme.Base() uses the session renderer, fixing
BorderForeground. Also reverted to NormalBorder since color now works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 22:39:36 +02:00
d51912917e fix: use DoubleBorder for selected order card
Some checks failed
Deploy / deploy (push) Has been cancelled
BorderForeground color wasn't rendering differently over SSH. Use
DoubleBorder (╔═╗║╚═╝) for selected vs NormalBorder (┌─┐│└─┘) for
unselected — visually distinct regardless of color support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 22:31:17 +02:00
c8a5f4806d fix: hardcode steel blue border and bold for selected order card
Some checks failed
Deploy / deploy (push) Has been cancelled
Use explicit #4682B4 with bold to ensure the selected border is
visually distinct on all terminal themes including gruvbox.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 22:24:31 +02:00
e2dc2854b7 fix: add 1-item scroll buffer and use highlight color for selected border
Some checks failed
Deploy / deploy (push) Has been cancelled
Scroll triggers when the next item would be off-screen, not when the
current item hits the edge. Selected border now uses highlight color
(steel blue) instead of accent (white) for visibility on all themes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 22:18:43 +02:00
f9885e2d5e fix: use fixed-height order cards and correct viewport height
Some checks failed
Deploy / deploy (push) Has been cancelled
Simplify order list cards to 2 content lines (matching reference) so
itemHeight is always 4. Remove extra margin/buffer from viewport height
calc since account is a viewport page with no margins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 22:11:49 +02:00
34bb7a7c7f fix: correct scroll height estimates and improve order selection visibility
Some checks failed
Deploy / deploy (push) Has been cancelled
The scroll-to-item calculations used wrong item heights (7/5 instead of
9/7) and ignored the 5-line title header offset, causing the viewport to
under-scroll. Selected order cards now light up in accent color for
better visibility across terminal themes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 22:00:44 +02:00
79c8238f1b fix: scrolling stopped working in last commit. this change is made by claude so it just might break again
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-25 21:48:33 +02:00
5c38c7e726 update scroll handling
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-25 11:41:20 +02:00
4024cf4b40 fix: fixed the border on order history currently selected item not showing up for some terminal themes
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-25 11:01:45 +02:00
c78f5eb12b refactor: remove putting ssh key in memory at all, just use it for auth
Some checks failed
Deploy / deploy (push) Has been cancelled
changed the ssh key to just do fingerprinting and not store it at all, and not be able to edit it either in the account page
2026-04-25 10:50:19 +02:00
c8af9cb551 change: change the proceed warning to red to make it easier to catch
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 17:02:05 +02:00
d7b172843e resolve splash screen deadlock and auth 500 soft-deleted ssh keys
Some checks failed
Deploy / deploy (push) Has been cancelled
Auth handler used FirstOrCreate which couldn't see soft-deleted keys
  (GORM filters by deleted_at IS NULL) but also couldn't insert (unique
  index still covers deleted rows), returning 500 on every login after
  a key deletion. Use Unscoped lookup and restore soft-deleted keys.

  Splash screen also got permanently stuck when auth failed because
  splashViewInitCmd was never fired, leaving splash.dataReady false.
2026-04-24 16:51:19 +02:00
d66b41eed3 refactor: refactor the footer handling
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 12:13:26 +02:00
6db7748d9f change the BuildAccountView inline sub-views to use 4 different files to make it better
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 11:37:42 +02:00
abe11853f6 refactor: add helper functions for subtotal, cart empty, and cart item count
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 10:29:15 +02:00
280585c2d0 sdfsdf
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 10:17:46 +02:00
8a86965981 update .gitignore
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 10:07:03 +02:00
edc032d6d4 bug fixes: various small bug fixes and typos
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 10:04:31 +02:00
53c1b5e254 update: removed stale errors
Some checks failed
Deploy / deploy (push) Has been cancelled
when encountering an error, the error would never be removed, i just reset the error msg in the switchPage function, this will have to be redone later to make error messages dissapear after a while even on the same page
2026-04-24 09:45:32 +02:00
1bc03822b1 security: remove SSH public key from TUI memory
Some checks failed
Deploy / deploy (push) Has been cancelled
replace SSHPublicKeyStr field on Model with a closure-based authCmd that
fires, the public key lives only in the goroutine stack not on the
long-lived Model struct

Prevents key material exposure in heap dumps if the process crashed
2026-04-24 09:39:26 +02:00
6006f9617d refactor: add dedicated *Switch() methods
Some checks failed
Deploy / deploy (push) Has been cancelled
added dedicated *Switch() methods (ShopSwitch, CartSwitc, AccountSwitch, ...) for page transitions and remove the catch-all resetPageState(). Each switch owns its pages zero-init, viewport setup, and async data fetching
2026-04-24 09:25:31 +02:00
1c3ebf789c refactor: update the flat model struct with nested structs
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-24 08:57:04 +02:00
bef7f85bda rewrite: update the slice sort to use built-in lib sort
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-19 14:15:14 +02:00