Commit Graph
161 Commits
Author SHA1 Message Date
dong.nguyen a3a31de704 trigger CI rerun 2026-10-26 21:38:13 +07:00
dong.nguyen cff981c5f3 ci: move both pipelines to GitHub Actions (spec-v6)
GitHub becomes the primary repository host; the site keeps its VPS + nginx + Dockge host, the three-job pipeline and the same concurrency, so what moves is the CI host and the write-path target. .github/workflows/{deploy,deploy-infra}.yml are ports of the Gitea files with permissions: contents: read on every job. .gitea/workflows/ stays until the first green GitHub run (D9); its infra test step carries the new template variable names because the template it validates is the one this repository now ships.

The write-path values are renamed GITEA_TOKEN / GITEA_CONTENTS_API -> CONTENT_API_TOKEN / CONTENT_API_BASE and the upstream header becomes Bearer — in nginx.conf, in the compose envsubst filter and in the dev proxy, so dev and production send the identical header (D4). draft.ts learns GitHub's answer to a stale blob sha (409) while keeping the 422 "does not match" and 412 legs; smoke-draft.ts check 14 drives a stubbed proxy that answers 409 with GitHub's body and asserts the conflict refreshes the base, keeps the draft and never stops the save sequence.

Both workflows read the stack directory and the compose service / container name from the STACK_DIR and CONTAINER_NAME repository variables instead of hard-coding them, and each job refuses a missing, relative, trailing-slash or compose-disagreeing value in its first step, before any artifact download or rsync reaches the VPS (D15).

Verified: tsc -b and oxlint pass with no new warnings; validate:content, smoke-draft (14 checks) and smoke-generated-ids (7 checks) pass; both workflows parse, every run/script block passes bash -n with the variables substituted, and the guard refuses every bad value against the real compose.yaml. Owner-side variables, secrets, the write token and the VPS config rewrite stay open in spec-v6 §6.
2026-10-26 20:49:34 +07:00
dong.nguyen 1cfeda7987 content: src/i18n/locales/vi/content/profile.json (1 path) 2026-10-25 21:45:11 +07:00
dong.nguyen 3fafbefe24 fix(edit): probe a file that is not a draft document
The auth probe fetched src/data/profile.json, which every page manifest claims (the footer renders profile.name on every route), so the probe and the page's own document read hit the identical URL twice per session. PROBE_FILE is now AGENTS.md — a stable tracked file outside the draft scope. Spec row 27 records the fix and why nginx caching was rejected.
2026-10-25 00:16:10 +07:00
dong.nguyen fcf8768d1a content: src/i18n/locales/en/content/projects.json (1 path) 2026-10-24 18:09:46 +07:00
dong.nguyen d08ef3f3d6 content: src/i18n/locales/vi/content/projects.json (1 path) 2026-10-24 18:09:44 +07:00
dong.nguyen a7ac41307c content: src/data/projects.json (0 paths) 2026-10-24 18:09:43 +07:00
dong.nguyen 1246f933e8 content: src/data/skills.json (1 path) 2026-10-24 17:56:43 +07:00
dong.nguyen 4de82c4538 content: src/i18n/locales/en/content/profile.json (1 path) 2026-10-24 17:56:42 +07:00
dong.nguyen 40750b73e3 content: src/i18n/locales/en/content/profile.json (1 path) 2026-10-24 15:28:47 +07:00
dong.nguyen 5c71b52d81 perf(edit): read only the documents the current route needs
Edit-mode document scope comes from the page manifests (src/i18n/edit-scope.ts): an entity's structure document and its two text documents are read as one unit, the category labels only where a project renders. A route change fetches only the still-missing documents and adopts them through DraftStore.adoptBase, which refuses a document the draft has already changed. A bundle-seeded baseline is never PUT over the branch: saveDraft reads the branch first and reports a conflict. Every manifest now claims profile.name, which the footer renders on every route.
2026-10-24 15:24:08 +07:00
dong.nguyen ee1d524bd0 content: src/i18n/locales/en/content/projects.json (1 path) 2026-10-24 14:49:45 +07:00
dong.nguyen 1d15028dc4 content: src/i18n/locales/vi/content/projects.json (1 path) 2026-10-24 14:49:44 +07:00
dong.nguyen 468f0237ea content: src/data/projects.json (1 path) 2026-10-24 14:49:43 +07:00
dong.nguyen 83da513931 perf(edit): load the draft documents as one concurrent wave
EditModeShell issued the 12 draft documents with a for-loop of awaits, then the
2 category-label files. It now starts two concurrent requests whose success and
failure handlers are attached in the same tick, so a label rejection landing
while the documents are still in flight is not an unhandled rejection. The two
failure branches are unchanged: a document failure is the offline state, a label
failure only disables the category rule. Measured through the dev proxy, the
same transport the app uses: 12 documents sequential 902 ms -> 210 ms for the
whole 14-request wave, 38768 bytes and 12 distinct payloads byte-identical to
the sequential loop.

nginx.conf now proxies /api/content/ to Gitea over HTTP/2 (proxy_http_version 2
+ a cleared Connection header), so the wave rides one pooled upstream connection
instead of one HTTP/1.1 connection per in-flight request. The stack's nginx
1.31.x already does HTTP/1.1 with upstream keepalive caching by default since
1.29.7, so no upstream block is declared and the envsubst contract is
untouched; the pipeline's test-before-touch nginx -t is what proves the image
accepts proxy_http_version 2.

Specs: spec-v4-live-edit.md row 25 + the draft-initialization bullet,
spec-v4-deploy-infra.md D14 + row 10, AGENTS.md nginx.conf line.
2026-10-24 14:45:26 +07:00
dong.nguyen 3126971852 fix(edit): one field shape for the record settings popover
Every field now renders as a 150px label column plus a control column, so the
Featured checkbox no longer inherits the 220px text-input width and its row
shares the grid with Category/Location/Logo. Project section rows become a
5-column grid with named areas (id, type, up, down, remove) that reflows to
two rows at <=520px; the close button is a 28px target and inputs/selects get
the same :focus-visible ring as the rest of the edit chrome.
2026-10-24 14:45:19 +07:00
dong.nguyen ee3e85bf4a Merge remote-tracking branch 'origin/master' 2026-10-24 14:03:47 +07:00
dong.nguyen 7b4a782f59 feat(edit): keep edit mode across navigation, only Exit leaves
Edit mode is a session, not a URL state. MaybeEditMode mounts the shell on
?edit or on the session flag; while mounted, EditModeShell re-attaches ?edit
after a route change that dropped it (replace navigation, skipped while
authenticating so it never fights a failed auth). The session initializes once
per mount - entry URL from a ref, stripEditQuery reads window.location - so
navigation neither re-authenticates, re-fetches, nor re-restores the draft.

?edit parsing, the session/branch flags and the portfolio-draft key move to a
dependency-free src/i18n/edit-session.ts so App.tsx can read the gate without
pulling the Basic-auth probe (and through it draft.ts) into the entry chunk;
edit-mode.ts is now the auth handshake alone.

Verified: tsc -b, pnpm build (entry chunk carries no probe literal,
EditModeShell stays a separate lazy chunk), pnpm lint (no new warnings),
throwaway smokes for the session semantics (17/17) and the router behaviour
behind the guard (5/5), both deleted after the run.
2026-10-24 13:56:16 +07:00
dong.nguyen a09d80ad29 content: src/i18n/locales/en/content/projects.json (1 path) 2026-10-24 13:49:49 +07:00
dong.nguyen fdbc530366 content: src/i18n/locales/vi/content/projects.json (1 path) 2026-10-24 13:49:48 +07:00
dong.nguyen 42b666664f content: src/data/projects.json (1 path) 2026-10-24 13:49:47 +07:00
dong.nguyen 7b5bd79086 content: src/i18n/locales/en/content/projects.json (1 path) 2026-10-24 13:48:04 +07:00
dong.nguyen 5867a5e089 content: src/i18n/locales/vi/content/projects.json (1 path) 2026-10-24 13:48:03 +07:00
dong.nguyen dd0b4fa735 content: src/data/projects.json (1 path) 2026-10-24 13:48:02 +07:00
dong.nguyen 369404924f content: src/data/projects.json (3 paths) 2026-10-24 13:43:31 +07:00
dong.nguyen 1bc12d23a6 feat(edit): pick a project's category in the record settings
category had no edit control anywhere: the settings popover covered featured + sections only, the badge is display-only, and a new project silently got category 'experiment' from the draft template. ProjectSettingsPanel now renders a category select whose options are the label map of ui/projects.json (the vocabulary rule 7 checks a project against) with the project's current value appended, so opening the panel never rewrites a project whose label is missing; the write goes through setStructured('projects', '[i].category', ...), the path smoke-draft check 11 already gates.

ui.edit.label added to both languages. .record-settings-field select joins the field-control rule in App.css, which also styles the timeline variant select that had none. Out of scope by design: a category with no labels - UI documents stay read-only in v4, so its labels are a repository edit.

Docs: inline-editing spec 2.4 + component inventory + progress rows 10 (the add-button fix) and 11; spec-v5 5.4 links the picker to rule 7; AGENTS.md editable-surface bullet corrected (category is a single structure value, not a chip list). Verified: pnpm build, pnpm validate:content, pnpm lint (5 pre-existing warnings only), smoke-draft 11/11.
2026-10-24 13:37:42 +07:00
dong.nguyen 8776247176 fix(edit): keep the tag add button out of the project card link
The project card body is a MotionLink (Projects.tsx, ProjectsListPage.tsx). The chips inside it were safe because they render through EditableText, whose edit-mode onClick does preventDefault + stopPropagation, but the ghost add button was a direct child of the anchor: its click reached the link and the card navigated instead of adding a tag. The add button now stops mousedown and does preventDefault + stopPropagation on click before writing the array - the same guards the item controls and EditableText use. Covers the technologies and the metrics add on both card surfaces.
2026-10-24 13:37:42 +07:00
dong.nguyen b334348387 content: src/i18n/locales/en/content/projects.json (1 path) 2026-10-24 13:33:42 +07:00
dong.nguyen dccecd8ced content: src/i18n/locales/vi/content/projects.json (1 path) 2026-10-24 13:33:41 +07:00
dong.nguyen 2284db80ce content: src/data/projects.json (0 paths) 2026-10-24 13:33:40 +07:00
dong.nguyen 9e036ff574 content: src/i18n/locales/en/content/profile.json (1 path) 2026-10-24 13:24:43 +07:00
dong.nguyen a3662a9521 refactor(ids): generate content id unions from the structure documents
scripts/generate-content-types.ts writes the gitignored src/types/content-ids.ts (id unions + project category values) from the four structure documents; wired as generate:ids / predev / prebuild / prepare. src/types/index.ts re-exports them type-only and keeps only the code-owned unions.

Edit mode now writes JSON only: the v4 union leg is deleted (saveIdUnions, diffIdsWithUnions, applyUnionChanges, readUnionBlock, the EditBar union card, edit.union.* labels). Validator rule 7 requires a label for every category a project uses, in both ui/projects.json documents.

Tests: smoke-draft.ts 11/11 (rename re-sluging + category-label rule replace checks 9-12); new scripts/smoke-generated-ids.ts 7/7. Verified: pnpm build (chunk names unchanged, no runtime reference to the generated module), lint with no new warnings, validate:content, resume HTML byte-identical before/after with identical documents.

Docs: spec-v5-generated-content-ids.md added; spec-v4-live-edit.md §3.1 marked superseded + §12 row 23; AGENTS.md and README.md updated.
2026-10-24 13:16:18 +07:00
dong.nguyen 1a1fc14d0e content: update id union members (-facility-management, -local-llm-experiments) 2026-10-24 12:32:36 +07:00
dong.nguyen 35b5f514ba content: src/i18n/locales/en/content/projects.json (2 paths) 2026-10-24 12:32:35 +07:00
dong.nguyen 3f15a2c700 content: src/i18n/locales/vi/content/projects.json (2 paths) 2026-10-24 12:32:34 +07:00
dong.nguyen 229c5b84d5 content: src/data/projects.json (0 paths) 2026-10-24 12:32:33 +07:00
dong.nguyen 150ef90c73 fix(edit): balance id unions when a record is deleted
Deleting a record in edit mode removed the structure row and its text but left the id union member in src/types/index.ts, so Record<SkillGroupId, SkillGroupText> rejected the shortened text document (TS2741) and pnpm build failed. draft.ts: readUnionBlock reads a union as its declaration span (CRLF/LF safe, never round-trips), diffIdsWithUnions reports missing and stale members against committedStructures(), applyUnionChanges rewrites only that member list in one PUT; newIdsInCommitted/patchUnionSource removed. types/index.ts drops logistics-technology. Verified: smoke-draft 12/12 (new checks 9-12), validate:content, lint (no new warnings), build.
2026-10-24 10:08:58 +07:00
dong.nguyen a0a1451272 content: src/i18n/locales/vi/content/skills.json (1 path) 2026-10-24 09:29:02 +07:00
dong.nguyen 47dc1d4f15 content: src/data/skills.json (0 paths) 2026-10-24 09:29:01 +07:00
dong.nguyen 96cb74507f content: src/i18n/locales/en/content/profile.json (2 paths) 2026-10-24 09:29:00 +07:00
dong.nguyen deb33f6ae1 content: src/i18n/locales/en/content/profile.json (1 path) 2026-10-24 09:06:31 +07:00
dong.nguyen 435d2e2c46 content: src/i18n/locales/en/content/profile.json (1 path) 2026-10-24 09:05:16 +07:00
dong.nguyen 86821befa1 content: src/i18n/locales/en/content/profile.json (3 paths) 2026-10-24 08:48:47 +07:00
dong.nguyen cf216e5962 fix(infra): working container entrypoint; add local-only ports override
- compose.yaml: set -a before sourcing (sourced assignments were shell-only, envsubst saw nothing) + inline nginx command (a compose entrypoint override drops the image CMD; empty $@ exit-0 restart-looped locally and on the VPS)
- compose.override.yaml: local-only auto-merged override publishing 127.0.0.1:8081 (8080 taken on the dev machine); never shipped by the pipeline
- verified locally end-to-end: stack Up, probe 200, rendered default.conf carries real values, nginx -t OK; built site + 401-protected /api/content/ served through the published port
- docs: spec D13/§4.1 entrypoint corrected, §6 port-exposure open question + docker inspect check, rows 4/9; README local-stack section; AGENTS.md inventory
2026-10-24 00:44:20 +07:00
dong.nguyen a5a525ff14 fix(infra): envsubst filter as |-regex; test placeholder as resolvable IP
Run 3 failed at the test step: nginx's official entrypoint matches NGINX_ENVSUBST_FILTER as a regex against variable names (^filter$), so the comma form GITEA_TOKEN,GITEA_CONTENTS_API matched nothing — ${…} tokens stayed in the rendered config and nginx -t failed with 'unknown "gitea_contents_api" variable'. A literal hostname in proxy_pass is resolved during the config test, so the test placeholder must be a resolvable literal IP. Both reproduced and fixed locally against the repo files: the exact test-step container now passes nginx -t (exit 0). compose.yaml + deploy-infra.yml use GITEA_TOKEN|GITEA_CONTENTS_API (quoted in the shell script) and http://127.0.0.1:1. Spec rev.8: status line, D11, §4 sketch + resolved note, rows 2/4.
2026-10-23 23:59:32 +07:00
dong.nguyen 773000a42a fix(ci): drop -R from infra rsync; per-step remote_path (action prefixes GITHUB_WORKSPACE)
Run 2026-10-23 shipped files to dong-site/workspace/dong.nguyen/cv/… on the VPS: the action builds the rsync source as "/" (entrypoint.sh) and -R mirrors that absolute path; deploy/htpasswd also landed as a directory. Each step now uses plain -avz with an explicit remote_path (dong-site/ for nginx.conf + compose.yaml, dong-site/deploy/ for htpasswd). Spec §4 sketch/notes resolved, §8 rows 2/4 record both run outcomes and the owner-side VPS cleanup before the next dispatch.
2026-10-23 23:45:39 +07:00
dong.nguyen 6d7cae40d4 fix(ci): deploy-infra rsync as three single-path steps (action quotes path input)
First real run 2026-10-23: burnett01/rsync-deployments passes the comma-list path input to rsync as one quoted argument — link_stat "nginx.conf,compose.yaml,deploy/htpasswd" failed, nothing shipped, live container untouched. Apply the spec §4 fallback: one rsync step per file with full remote_* config, -avzR kept. Spec: §4 sketch + inference note resolved, §6 paths-filter risk annotated, §8 rows 2/4 record the run outcome and the re-run-via-dispatch step.
2026-10-23 23:15:03 +07:00
dong.nguyen 85f9e3429c docs(readme): local setup + production deploy via Gitea CI; refresh live-edit spec status
README replaces the Vite starter template: requirements, .env variables (SITE_URL/SITE_NAME build identity, GITEA_* edit path), all scripts with validation gate and PDF-lock gotcha, optional local nginx stack, deploy.yml/deploy-infra.yml pipeline table, one-time Gitea setup (Actions variables SITE_URL/SITE_NAME per deploy-infra rev.7, DEPLOY_* SSH secrets with the Windows key procedure, stack secrets/site_config, htpasswd edit login). spec-v4-live-edit.md: status line refreshed (content docs on master, nginx step automated repo-side, remaining owner-side items), date typo 2022->2026, section 6.3 marked superseded by deploy-infra.
2026-10-23 22:58:16 +07:00
dong.nguyen 5e9c76c62b feat(ci): deploy-infra pipeline + env-driven site identity (spec-v4-deploy-infra rev.6-7)
Repo side of spec-v4-deploy-infra: deploy-infra.yml (paths-filtered nginx redeploy, test-before-touch, health probe); compose.yaml rename + secrets/site_config entrypoint override; site identity externalized - SITE_URL/SITE_NAME read from env (site.ts, vite site-identity plugin, index.html tokens, generated robots.txt); nginx.conf/vite dev proxy read GITEA_CONTENTS_API; .env.example; AGENTS.md + specs updated. Rev.7: site identity delivered as Gitea Actions variables (vars. context, public values) instead of secrets; upload-artifact unified to v7 across jobs.
2026-10-23 22:34:23 +07:00
dong.nguyen a1c249c504 content: src/i18n/locales/vi/content/profile.json (1 path) 2026-10-23 11:23:43 +07:00