Commit Graph
24 Commits
Author SHA1 Message Date
westfarn 400549268c Fix password reset UI (pairs with backend #1) (#40)
Unit Tests / test (push) Successful in 12s
## Summary
- Pair with chat_backend password reset (#1)
- Fix forgot-password request: execute invisible reCAPTCHA, POST `user/reset_password/` with await, correct `/signin/` back link
- Restyle confirmation + set-password pages to match Sign In glass UI
- Set-password: validate link via GET, await POST, enforce ≥8 chars + number + special char
- Sign In “Forgot Password?” navigates to `/password_reset/`

## Test plan
- [ ] `npm test -- --watchAll=false --testPathPattern=PasswordReset.test`
- [ ] From Sign In → Forgot Password → submit email → confirmation page
- [ ] Open email link `/set_password/?slug=…` → set password → redirected to Sign In
- [ ] Invalid/expired slug redirects to Sign In
- [ ] End-to-end with backend `feature/password-reset-1`Reviewed-on: #40
2026-07-27 04:42:36 -07:00
westfarn 1e660c56a8 Add self-serve sign-up + Stripe Checkout (#31) (#34)
Unit Tests / test (push) Successful in 11s
## Summary
- Closes #31
- Public `/signup/` page (Sign In–matched UI): register → JWT → `POST /api/finance/checkout/` → redirect to Stripe hosted Checkout
- `/billing/success` and `/billing/cancel` return URLs
- Sign In ↔ Sign Up links; Sign Up link only when backend `enable_account_registration` is true

Depends on backend PR: registration flag + public settings + gated `/user/create/`

## Test plan
- [ ] `cd llm-fe && CI=true npm run test:ci -- --testPathPattern='SignIn|SignUp'`
- [ ] With registration disabled: `/signup/` shows unavailable; Sign In has no Sign up link
- [ ] With registration enabled: form validates, happy path redirects to Checkout URL
- [ ] Cancel return explains retry; success prompts continue / sign-inReviewed-on: #34
2026-07-27 04:20:20 -07:00
westfarn a4a28ef13e Ship Android app by wrapping the web build with Capacitor (#20) (#28)
Unit Tests / test (push) Successful in 11s
## Summary
- Closes #20
- Add Capacitor 7 to `llm-fe/` (`capacitor.config.ts`, appId `com.aimloperations.chat`, `webDir: build`) and commit the generated `android/` project
- npm scripts: `build:mobile` (`.env.mobile` + CRA build + `cap sync`), `android:open`, `android:sync`, `assets:generate`
- `.env.mobile` defaults to prod backend; override independently of web deploys
- Native chrome: Android back button (history / exit at root), status bar + keyboard resize, safe-area CSS; Preferences registered for JWT mirror (#22)
- Icons/splash via `@capacitor/assets`; signing via optional `keystore.properties`; docs in `llm-fe/ANDROID.md` + root README

Blockers #22 / #23 / #24 already on master.

## Test plan
- [x] `npm run test:ci` (79 tests)
- [x] `npm run build` + `npx cap add android` / `cap sync`
- [ ] `npm run build:mobile` + open in Android Studio on a machine with SDK
- [ ] Emulator/device QA: login, chat stream, theme, back button, keyboard/safe-area, WS resume
- [ ] Generate upload keystore outside repo; `./gradlew bundleRelease` for internal testing trackReviewed-on: #28
2026-07-26 17:12:48 -07:00
westfarn b7f23eb16c Rebrand product to Hesychia (hesychia.ai) (#29) (#32)
Unit Tests / test (push) Successful in 10s
## Summary
- Closes #29
- Rename user-facing product from AIML Operations chat to **Hesychia** (headers, sidenav brand, footer, ToS welcome, sample page)
- Update page metadata (`title`, description, Open Graph, `manifest.json` app name)
- Point README / env comments at **hesychia.ai**; keep live API hosts and deploy webroots until infra cutover

## Android display name
Capacitor tree is not on `master` yet ([#28](#28)). Display name / `appName` → **Hesychia** pushed on `ship-android-capacitor-20` so it lands with that wrap. Package id stays `com.aimloperations.chat` (Play identity; rename later if desired).

## Out of scope (per issue)
- New logo artwork (#30)
- Backend system-prompt identity (`chat_backend` #20)

## Test plan
- [ ] Web UI shows **Hesychia** in header / sidenav / footer (no old product name)
- [ ] Browser tab title and PWA manifest name are Hesychia
- [ ] Footer still credits AI ML Operations, LLC as developer
- [ ] `npm run test:ci` (Footer test updated)
- [ ] After #28 merges: Android launcher / activity title shows HesychiaReviewed-on: #32
2026-07-26 17:07:26 -07:00
westfarn 3162ed1f7f Make auth JWT-only for Capacitor WebView origins (#22) (#26)
Unit Tests / test (push) Successful in 10s
## Summary
- Closes #22
- Drop CSRF cookie / `js-cookie` path; axios uses JWT `Authorization` only (`withCredentials: false`)
- Unified token storage: `localStorage` sync source of truth + optional Capacitor Preferences mirror/hydrate for native shells
- Request interceptor always attaches fresh bearer token; 401 refresh + sign-in redirect use hash-safe native paths
- Companion backend PR: `ai_ml_operations/chat_backend` branch `capacitor-cors-csrf-22` (CORS/CSRF Capacitor origins)

## Test plan
- [x] Unit tests: `tokenStorage`, `nativePlatform`, `jwtHelpers`, Auth/SignIn/WebSocket (`npm run test:ci`)
- [ ] Login from Capacitor Android (`https://localhost`) and iOS (`capacitor://localhost`)
- [ ] Token refresh after access expiry; logout blacklist; password reset; 401 → sign-in
- [ ] Confirm browser build at `chat.aimloperations.com` unchanged
- [ ] Merge companion backend PR so prod CORS includes Capacitor origins when `CORS_ORIGIN_ALLOW_ALL=false`Reviewed-on: #26
2026-07-26 14:09:19 -07:00
westfarn 0fc8739d26 Make routing work from a file-served Capacitor bundle (#24) (#27)
Unit Tests / test (push) Successful in 10s
## Summary
- Closes #24
- Introduce `AppRouter` + `getAppRouter()` so Capacitor uses `HashRouter` (filesystem bundle, no nginx rewrite) while web keeps `BrowserRouter`
- Isolate platform checks in `nativePlatform` (no `Capacitor.isNativePlatform()` sprinkled through the route tree)
- Auth forced redirects (`axiosApi` → `/signin/`) use hash-safe `redirectToAppPath` on native
- Leave CRA `homepage` / absolute `PUBLIC_URL` asset paths unchanged so `/var/www/{env}.chat.aimloperations/html` deploy stays intact; HashRouter keeps document URL at the bundle root so assets resolve

## Test plan
- [x] Unit tests: `AppRouter` + `nativePlatform` (`npm run test:ci`)
- [ ] Capacitor build: open nested route (`/#/account/`), force WebView reload — no blank/404
- [ ] Browser back/forward + Android hardware back with HashRouter
- [ ] Web deploy smoke: deep link reload at `/account/` still works via nginx rewrite
- [ ] Confirm login redirects after 401 still land on sign-in (web path + native hash)Reviewed-on: #27
2026-07-26 13:46:41 -07:00
westfarn 7f16a3dca8 Harden chat WebSocket for mobile lifecycle (#23) (#25)
Unit Tests / test (push) Successful in 11s
## Summary
- Closes #23
- Add WebSocket reconnect with exponential backoff + jitter (capped attempts), heartbeat keepalives, and reconnect on browser visibility/`online` plus Capacitor `App`/`Network` plugins when present
- Refresh JWT before reconnect (coordinates with #22) so conversation refetch after a drop still works
- Mid-stream drop recovery: mark interrupted + refetch conversation; surface connecting/reconnecting/disconnected state and disable send while down

## Test plan
- [x] Unit tests: `websocketReconnect` helpers + `WebSocketProvider` reconnect/resume/send (`npm run test:ci`)
- [ ] Background app ~30s and ~10min, then resume — chat reconnects without reload
- [ ] Airplane mode on/off and cellular↔WiFi — reconnect indicator then restored send
- [ ] Drop mid-stream response — interrupted banner + conversation refetch
- [ ] Confirm nginx/`/ws/` proxy idle timeout stays above heartbeat (25s) or allows ping payloadsReviewed-on: #25
2026-07-26 13:35:39 -07:00
westfarn 2b8d8fba79 Update favicon to new logo (#19)
Unit Tests / test (push) Successful in 9s
## Summary
- Closes #18
- Replace stale `favicon.jpg` / old ICO with multi-size `favicon.ico`, PNG variants (`16x16`, `32x32`), `logo192.png` / `logo512.png`, and `apple-touch-icon.png` generated from the new brand mark
- Point `index.html` and `manifest.json` at the new assets; drop the CRA placeholder app name in the manifest

## Test plan
- [ ] Hard-refresh the app (or clear site data) and confirm the new logo appears in the browser tab
- [ ] Check DevTools Network for `favicon.ico` / PNG icons — no 404s and no requests for `favicon.jpg`
- [ ] On mobile Safari / iOS home-screen add, confirm apple-touch-icon looks correct
- [ ] Confirm PWA/manifest icons resolve to the new 192/512 assetsReviewed-on: #19
2026-07-26 04:35:22 -07:00
westfarn 45d441dcba Fix ESLint and CSS Minimizer errors blocking npm run build (#17)
Unit Tests / test (push) Successful in 10s
## Summary
- Closes #16
- Clear unused imports/bindings, empty `{}` prop patterns, `==` vs `===`, and hook dependency gaps across App, contexts, and pages
- Replace invalid `calc(3rem + unset)` in `index.css` so Css Minimizer no longer fails

## Test plan
- [x] `npm run build` in `llm-fe` succeeds (no ESLint / postcss-calc errors)
- [ ] Spot-check SignIn, dashboard, account, feedback, document storage pages still render
- [ ] Confirm WebSocket/message flows still work after MessageContext dep cleanupReviewed-on: #17
2026-07-25 04:43:21 -07:00
westfarn 5a7a4dd4eb Deploy chat_web_app via server-infra (node-static) (#15)
Unit Tests / test (push) Successful in 10s
## Summary

Implements [chat_web_app#13](#13) Part A: wire the CRA frontend into the same **node-static** deploy path as `dta_webapp` (no Docker for serving).

- `build:prod` / `build:beta` write into `/var/www/{env}.chat.aimloperations/html`
- API/WS URLs come from `REACT_APP_*` (`.env.production` / `.env.beta`) instead of hardcoded localhost
- Gitea unit tests + auto deploy-prod on `master`; deploy-beta via `workflow_dispatch`
- README documents local dev, env files, and webroot layout

Branch includes the #11 unit-test commit (`test:ci`) so CI has a green suite.

Companion server-infra branch (Part B): `issue-13-register-chat-web-app` on `ai_ml_operations/server-infra`.

## Test plan

- [ ] `cd llm-fe && npm run test:ci`
- [ ] Merge + ensure Unit Tests workflow passes on PR
- [ ] Merge server-infra `issue-13-register-chat-web-app`, then sync/pull on runner
- [ ] Redeploy web-static (or full host provision) so nginx listens on **8082**
- [ ] Manual: `server-infra/scripts/deploy.sh --app chat_web_app --env prod --ref <sha>`
- [ ] NPM: point `chat.aimloperations.com` at `adama:8082` + `roslin:8082` + `ai-server-4080:8082`
- [ ] Confirm built assets hit `https://chatbackend.aimloperations.com`Reviewed-on: #15
2026-07-25 04:34:12 -07:00
westfarn c0d83359cc Add unit tests (#11) (#14)
## Summary
- Add Jest/RTL unit tests for data models, Card, Footer, CustomTextField/PasswordField, CustomToastMessage, ConversationCard, AuthContext, and SignIn
- Remove the broken CRA `App.test.tsx` placeholder that expected "learn react"
- Add `npm run test:ci` for non-interactive CI runs

Closes #11

## Test plan
- [ ] `cd llm-fe && npm install`
- [ ] `npm run test:ci` — expect 9 suites / 32 tests passing

Reviewed-on: #14
2026-07-14 18:03:24 -07:00
westfarn 40db2495f2 Closes #10 2025-12-09 05:39:35 -06:00
westfarn caf2c6481f host of Quality of life fixes 2025-12-08 13:51:29 -06:00
westfarn 95f351c5aa final set of updates for the upgrade 2025-12-07 06:17:48 -06:00
westfarn 5c449e1036 UI Redesin! 2025-11-24 06:26:50 -06:00
westfarn 2657334e0c fixing the rebase 2025-09-24 12:02:59 -05:00
westfarn b120f85ccd update button based on state 2025-09-24 11:58:38 -05:00
westfarn 0acfcc0d08 Updated the FE to be able to display warnings and images 2025-09-24 11:57:40 -05:00
westfarn 1306ba9ed1 Removed the model selector 2025-05-18 06:12:12 -05:00
westfarn f7a6fefa2a Fix some base html 2025-05-14 03:25:29 -05:00
westfarn 004153617b Tons of updates. Rags paginated tables, site tracking 2025-05-14 03:23:18 -05:00
westfarn 5d054026d8 Update llm-fe/src/index.tsx 2025-04-27 07:31:56 +00:00
westfarn 626d471a15 inital check in 2025-03-07 12:21:37 -06:00
westfarn a1d67c7c15 inital checkin 2025-03-07 12:18:16 -06:00