Commit Graph
169 Commits
Author SHA1 Message Date
dong.nguyen 7bb7bd68ae feat: intro video + /how-it-works page (spec-v7) — Remotion video/ project (62s explainer, centered scene composition), self-hosted MP4 + poster + EN/VI VTT, lazy page + manifest + UI group 15 + nav entry, spec-v7 + AGENTS updates 2026-10-28 23:12:44 +07:00
dong.nguyen 9124f569fb updated profile photo 2026-10-28 22:04:42 +07:00
dong.nguyen eee662a62d infra: htpasswd write mode 600 → 644 (spec-v6 D16 follow-up) — nginx worker (uid 101) opens auth_basic_user_file per request; 600 answered 13: Permission denied on /api/content/ 2026-10-28 12:15:03 +07:00
dong.nguyen a5ff55bacf infra: Basic-auth file leaves the repository (spec-v6 D16) — deploy/htpasswd gitignored, written on the VPS from the HTPASSWD_CONTENT secret; Gitea mirrors brought to full parity (permissions, STACK_DIR/CONTAINER_NAME guards) 2026-10-28 11:57:23 +07:00
dong.nguyen c535e7a295 update deploy workflow to master branch 2026-10-27 19:54:32 +07:00
dong.nguyen 33fa6ebefd resume: rename EN output to resume-en.pdf, show bare filenames in the dialog (spec-v3 follow-up 24) 2026-10-27 12:34:22 +07:00
dong.nguyen 61a01e25ca trigger workflow 2026-10-27 09:35:09 +07:00
dong.nguyen 5486086297 rerun nginx workflow 2026-10-26 21:46:13 +07:00
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