Commit Graph

7 Commits

Author SHA1 Message Date
egutierrez 41bafa57cc chore: auto-commit (17 archivos)
- app.md
- applog.go
- frontend/package.json
- frontend/package.json.md5
- frontend/vite.config.ts
- go.mod
- main.go
- matrix_service.go
- sqlite_driver.go
- .wails_dev.log
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:38:16 +02:00
egutierrez 23c933bfa2 feat: persist last user + diagnostics + logging + icon + defensive whoami
Backend:
- last_user.go: writes/reads <UserConfigDir>/matrix_client_pc/last_user.txt.
  Login persists; Logout clears.
- GetLastUserID bind replaces fragile localStorage in App.tsx.
- GetDiagnostics bind: live snapshot (started, client_ready, crypto_init,
  sync_active, rooms_count, encrypted_rooms, dms_count, last_error).
- applog.go: slog to stderr + <UserConfigDir>/matrix_client_pc/app.log.
  GetLogTail + GetLogPath binds.
- matrix_service.go logs throughout Login/Start. After MatrixClientInit,
  if client.DeviceID empty -> retry whoami + persist back (defensive).
- main.go inits logger before wails.Run, OnShutdown logs close.

Frontend:
- App.tsx awaits GetLastUserID() instead of localStorage.
- HomeScreen.tsx Health modal (green stethoscope button) with HealthRow
  status dots — comprobar chats.
- Auto-relogin on token-rejected error in Start().

Icon:
- appicon.ico (Phosphor chat-circle + #7c3aed) generated via generate_app_icon.
- build/windows/icon.ico replaced (Wails embeds via windres).
- build/appicon.png regenerated from ico (256x256).

Refs: issues 0147 + 0148 + 0150 (partial). Fixes M_UNKNOWN_TOKEN auto-recovery.
2026-05-25 17:20:52 +02:00
Egutierrez 1d3744f2d7 test(e2e): Playwright UI smoke + Go integration tests against MAS
- Playwright e2e against Vite dev server (LoginScreen renders, homeserver
  visible, version pinned). Fallback documented to swap to `wails dev
  -browser` via WAILS_DEV_URL when full backend bindings are required.
- Go integration tests (//go:build integration,goolm) for Start +
  ListRooms + LoadTimeline + SendText + GetDiagnostics against real
  Synapse. Skip cleanly if MATRIX_INTEGRATION_TOKEN/USER env vars unset
  so CI never breaks unattended.
- pnpm e2e/e2e:ui/e2e:report scripts. Per-run keyring namespace +
  t.TempDir XDG_CONFIG_HOME so integration tests don't clobber the
  production keyring entry.

E2E.md explains how to run each layer + limits (OIDC not automated).
2026-05-25 17:20:05 +02:00
egutierrez 1a2e9b2cc0 test: Vitest + RTL component tests with mocked Wails bindings
- vitest + jsdom + @testing-library/react setup
- mocked wailsjs/go/main/MatrixService + runtime
- tests for: LoginScreen, App routing, HomeScreen auto-relogin,
  RoomList, Composer, EventBubble
- pnpm test runs the suite

Frontend coverage for matrix_client_pc (flow 0010 PC client).
2026-05-25 12:20:32 +02:00
Egutierrez 36a485ea26 feat: chat E2EE MVP - rooms list + timeline + composer + sync (issues 0148+0149+0150)
Backend extends MatrixService with Start()/Stop()/ListRooms()/LoadTimeline()/
SendText()/SendMarkdown(). On login the service initialises the crypto store
(cryptohelper, Olm/Megolm via goolm build tag) and a sync loop that fans
events out through Wails events ("matrix:event", "matrix:error"). Pickle
key is 32 random bytes hex-encoded in the OS keyring alongside the access
token, so the crypto SQLite store survives restarts.

Vendors 4 fresh helpers from fn_registry/functions/infra/:
  matrix_crypto_init.go (//go:build goolm || libolm)
  matrix_sync_service.go
  matrix_message_send.go
  matrix_room_list.go
Plus the existing 3 (mas_oidc_loopback, keyring_token_store, matrix_client_init).
go-sqlite3 driver pulled explicitly via sqlite_driver.go.

Frontend rewires HomeScreen as a 3-zone AppShell (sidebar / timeline /
composer). useMatrixRooms polls + reacts to the sync stream; useMatrixTimeline
loads the last 50 events of the selected room and appends live ones. New
components: RoomList, Timeline, EventBubble, Composer. Composer supports
plain text (default) and a markdown toggle; Enter sends, Shift+Enter newline.

wails.json now passes "build:tags": "goolm" by default. Tested with
wails build -tags goolm on linux/amd64 and windows/amd64.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 01:03:31 +02:00
egutierrez f28c2b121e feat: login MAS OIDC end-to-end (issue 0147)
Backend Go:
- MatrixService with Login/GetSession/Logout bindings
- Uses 3 registry helpers via go.work:
  - mas_oidc_loopback_go_infra (PKCE flow)
  - keyring_token_store_go_infra (SO keychain)
  - matrix_client_init_go_infra (mautrix client)
- whoami helper to discover user_id+device_id pre-init

Frontend React+Vite+TS:
- Mantine v7 + @tabler/icons-react
- LoginScreen with 'Sign in with Matrix' button
- HomeScreen with profile card + logout
- Dark theme violet accent
- @mantine/notifications wired

Wails config:
- Switched to pnpm (workspace: protocol)
- Bindings auto-generated for MatrixService
- 1280x800 default window

Build: 68MB linux/amd64 binary in build/bin/
2026-05-24 23:23:35 +02:00
egutierrez 42adfdfd97 feat: scaffold matrix_client_pc (Wails + React-TS + mautrix-go + keyring)
Initial scaffold for issue 0147. App lives at
projects/element_agents/apps/matrix_client_pc/.

Deps:
- github.com/wailsapp/wails/v2 v2.11.0
- maunium.net/go/mautrix v0.25.2
- github.com/zalando/go-keyring v0.2.6

Next: MatrixService bindings + Login/Home React screens + helpers
(matrix_client_init, mas_oidc_loopback, keyring_token_store).
2026-05-24 23:08:58 +02:00