117 Commits

Author SHA1 Message Date
48dacdb445 Add design spec for B-auth (login + WebAuthn passkeys) 2026-05-02 21:31:45 +08:00
43db97aeaa fix(api): drop flask_cors from cm_api (CORS-A defense-in-depth)
api-server is internal-only after C5 (no host port in prod compose),
so the permissive 'CORS(app)' default never fires in normal operation.
Removing it eliminates a stale '*' Access-Control-Allow-Origin that
would become attack surface if a host port were ever accidentally
re-exposed.

Server-side fetches from web-view (legacy Flask) and web-next
(Next.js RSC) don't trigger CORS — that's a browser-only mechanism.

flask_cors stays in requirements.txt because cm_web_view.py still
imports it; both get removed in B4 when the legacy web-view retires.
2026-05-02 21:27:06 +08:00
3bfd35ef8d fix(web): PWA notch safe-area + skip autoFocus on touch devices
Adds viewportFit: 'cover' so the PWA can draw under the notch /
Dynamic Island when installed. Nav and Toast read env(safe-area-inset-*)
to keep their content out of the hardware cutouts (no-op on browsers
without a notch — env() resolves to 0).

Replaces autoFocus on the first field of CreateAccountDialog and
CreateUserDialog with a useEffect that only focuses on pointer devices
(matchMedia '(hover: hover) and (pointer: fine)'). Phones no longer
get the soft keyboard popping the instant a dialog opens.
2026-05-02 21:26:42 +08:00
eebbcb3db2 feat(web): success toast on confirmed create/delete
Adds a small top-centered <Toast> that fires only when the Server
Action returns { ok: true } (i.e., the DB write actually succeeded).
Auto-dismisses after 3s.

Wires both create dialogs (CreateAccountDialog, CreateUserDialog) with
an onSuccess callback that the table parent uses to push the toast,
and the delete confirm-flow does the same. Inline-edit success stays
quiet (no toast) — only add/delete trigger it, per the requested
scope.
2026-05-02 21:20:25 +08:00
e3ac94cada feat(web): manual create flow with input dialog for acc and user
api-server gets /create-acc-data and /create-user-data POST routes
that INSERT into the respective tables with required-field validation.
Frontend adds an 'Add' button next to Refresh in each table head;
opens a native <dialog> form with all fields. Inputs use 16px font on
phone (sm:text-[13px] desktop) so iOS doesn't auto-zoom.

A small form-dialog-shell helper centralizes the modal chrome,
field label, and input class so create-account-dialog and
create-user-dialog stay focused on their fields and validation.
2026-05-02 21:19:24 +08:00
e507714dc5 feat(web): delete with confirm dialog + fix iOS auto-zoom on edit
Adds × delete button per row in both tables (desktop column +
mobile card header). Click → native <dialog> confirm modal with
Esc/backdrop-cancel, destructive red button, error inline.
Wires deleteAccount/deleteUser Server Actions calling the new
api-server routes; revalidatePath refreshes the list on success.

EditableCell input switches to text-base (16px) on phone (sm:text-[13px]
above 640px), preventing iOS Safari auto-zoom-on-focus that was
shifting the layout when the soft keyboard appeared.
2026-05-02 21:17:19 +08:00
dac1e10b5d feat(api): add /delete-acc-data and /delete-user-data routes 2026-05-02 21:15:21 +08:00
f13e3993e9 feat(web): reskin to refined SaaS aesthetic (per Dribbble reference)
Drop the brutalist hazard-tape vocabulary in favor of refined modern
SaaS: white cards on zinc-50, soft ring-1 zinc-200 borders (no hard
2px black), rounded-full pills, sans for chrome + mono for tabular
data, emerald replacing yellow as the saturated accent. Theme color
shifts to zinc-900 with an emerald dot on the icon.
2026-05-02 21:15:02 +08:00
3fe33772ce fix(web): editable cell wraps long values instead of overflowing
Long URLs in the link column would overflow on mobile because
truncate + inline-flex without min-w-0 expanded the cell beyond the
card width. Switch to flex+items-start, min-w-0 on the value span,
break-all so unbreakable strings wrap. Edit hint stays pinned right
with shrink-0.
2026-05-02 21:08:19 +08:00
b497e133bd feat(web): add PWA icons via Next.js ImageResponse (frontend-design) 2026-05-02 21:02:58 +08:00
afc94e613e feat(web): add PWA manifest config (theme_color matches layout viewport) 2026-05-02 21:01:18 +08:00
7a5c00d08a feat(web): add layout, nav, and error boundary (frontend-design) 2026-05-02 21:01:15 +08:00
c0749d1af0 feat(web): add Server Component entry pages for / and /users 2026-05-02 20:56:56 +08:00
7b97e593e5 feat(web): add data tables and editable-cell primitive (frontend-design) 2026-05-02 20:56:49 +08:00
0ebd35f964 feat(web): add 30s auto-refresh client component 2026-05-02 20:50:55 +08:00
b398faba0a feat(web): add updateAccount and updateUser Server Actions 2026-05-02 20:50:50 +08:00
3297c500a4 feat(web): add server-side api-server fetch helper 2026-05-02 20:50:45 +08:00
aa76131b23 feat(web): add TypeScript types for Acc and User 2026-05-02 20:50:38 +08:00
a9642a7121 Add implementation plan for B2+B3 (UI port + PWA) 2026-05-02 20:49:13 +08:00
2de545e854 Add design spec for B2+B3 (UI port + PWA) 2026-05-02 20:45:52 +08:00
21bb1f0dde fix(web): bump tailwind to ^4.1 (4.0.0 had a postcss/oxide serde mismatch) 2026-05-02 20:39:04 +08:00
ccb6c27c3d fix(web): pin typescript to 5.7.2 (5.7.0 was never published) 2026-05-02 20:37:33 +08:00
5cac356007 docs(spec): hide /api entirely — drop Route Handler section, document RSC+Server-Actions choice 2026-05-02 20:36:11 +08:00
ff99b1248a feat(web): hide /api entirely — RSC + Server Actions instead
The Route Handler proxy and hash mapping are gone. Browser never
hits a JSON endpoint: data reads happen in React Server Components
fetching api-server:3000 server-side; mutations (B2) will use
Next.js Server Actions. Zero public API surface to scrape or
enumerate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 20:34:31 +08:00
a04d7ecc50 docs(agents): document web/ Next.js project and cm-web-next dev URL 2026-05-02 20:33:00 +08:00
203ab5daef feat(scripts): include web-next in dev.sh and publish.sh 2026-05-02 20:32:47 +08:00
e78d8c8fa8 feat(envs): add CM_WEB_NEXT_HOST_PORT to all .env.example templates 2026-05-02 20:32:24 +08:00
17b38a7c35 feat(compose): add web-next service (side-by-side with web-view) 2026-05-02 20:32:20 +08:00
96fa650caf feat(docker): add multi-stage Dockerfile for cm-web-next 2026-05-02 20:31:53 +08:00
addc40e851 feat(web): hash-encoded API paths + catch-all Route Handler proxy 2026-05-02 20:31:38 +08:00
17e60db935 feat(web): add scaffold layout and page (frontend-design generated) 2026-05-02 20:31:16 +08:00
a556b4e3a0 feat(web): add .gitignore and .dockerignore 2026-05-02 20:25:43 +08:00
3b8973ba20 feat(web): bootstrap Next.js 15 project configs (no lockfile yet) 2026-05-02 20:25:36 +08:00
f0fbd01a79 feat(plan): wire hash-encoded API paths into B1 plan 2026-05-02 18:15:35 +08:00
31b092f231 feat(spec): hash-encode API paths at the cm-web-next public boundary 2026-05-02 18:14:40 +08:00
d60c5c97a9 Add implementation plan for B1 (Next.js scaffold) 2026-05-02 18:12:59 +08:00
bdcea8b9bc docs(spec): route web UI code through frontend-design skill 2026-05-02 18:09:58 +08:00
572b200603 Add design spec for B1 (Next.js scaffold + side-by-side deploy) 2026-05-02 18:07:47 +08:00
abc2f1b78d fix(scripts): dev.sh down --remove-orphans (cleans up prod-test leftovers) 2026-05-02 18:01:41 +08:00
e68e64065a refactor(scraper): make get_register_link and get_user_credit dump on failure 2026-05-02 17:55:12 +08:00
698e5bf22a refactor(scraper): convert input-value extractions to helper 2026-05-02 17:54:58 +08:00
b7bc534681 feat(scraper): add ScraperError + _dump_html + _find_input_value helpers 2026-05-02 17:54:21 +08:00
9ec0d2ade4 Add implementation plan for R3 (scraper resilience) 2026-05-02 17:52:58 +08:00
d4ab9f9c49 Add design spec for R3 (cm_bot.py scraper resilience) 2026-05-02 17:50:27 +08:00
f6505c1d1d docs(plan): fix Task 9 step 3 — rebuild with override, run with base 2026-05-02 17:43:05 +08:00
614718cd43 docs: add aaPanel hardening guide (C3/C4/C7 + dev vhost) 2026-05-02 17:39:35 +08:00
145f071ca4 docs(agents): drop stale 'hardcoded credentials' note (moved to env in 45303d0) 2026-05-02 17:38:35 +08:00
86b329340c chore(compose): drop api-server host port from base (internal only) 2026-05-02 17:38:26 +08:00
5c8483fa09 feat(compose): keep Flask dev server in dev override; expose api-server on localhost 2026-05-02 17:38:15 +08:00
1d4ecadfaa feat(docker): swap Flask dev server for gunicorn in api and web images 2026-05-02 17:38:01 +08:00