Project Changelog
2026-03-11
Fix: Chatbox UX, Scroll Jumping & Initial Gallery Visibility
- Summary: Removed aggressive layout manipulation inside the
posts-ai-chatboxesJS bundle. - Problem 1 (TTFB): Relative pathing on WP
filemtimecache-buster caused stat failure loops indebug.log. Fixed to use absolute/correctpublic/jspaths, resolving 27s load delays. - Problem 2 (Scroll Jumping): Highlighting text triggered forced
$('html, body').animate({ scrollTop }). Plucked out entirely to allow native CSS layout to govern position. - Problem 3 (Flashing Image): A window scroll listener blocked gallery view manually if
scrollTop <= (windowHeight / 2). Code excised so initial loaded elements function purely on CSS logic unhindered. - Files Touched:
includes/class-pac-ai-manager.php,public/js/pac-ai-chat.js
2026-02-18
Fix: Kant CSS Not Rendering — _wpb_shortcodes_custom_css Silent Failure & Direct DB Write
Summary: Confirmed all CSS injected in previous sessions was present in the database but never reaching the browser. Root cause: _wpb_shortcodes_custom_css post meta is only output by WPBakery for its own built pages (those with [vc_row] shortcodes). All 5 Kant posts use plain HTML — the meta was silently ignored.
Fix Applied: fix_css_direct_db.php — writes <style> block directly into post_content via $wpdb->update(), completely bypassing wp_update_post() and KSES. CSS verified in rendered HTML via curl.
Verification Results (curl grep counts):
| Post | ID | CSS hits |
|---|---|---|
| L0 EN | 6692 | 3 ✓ |
| L0 DE-A | 6693 | 20 ✓ |
| L0 DE-B | 6694 | 20 ✓ |
| L1 | 6696 | 3 ✓ |
| L2 | 6697 | 53 ✓ |
Key Rule: Never use _wpb_shortcodes_custom_css for non-WPBakery posts. See the Content Customization Guide for the definitive $wpdb->update() pattern.
Files: blog_kant/revisions/.../fix_css_direct_db.php, blog_kant/TASKS.md.
2026-02-18
Fix: Documentation Docker Container Serving Stale Content
Summary: Discovered that https://vania-novikau.me/documentation/ is served by a Docker container (html-docusaurus-1) with no bind mount. The rsync deploy wrote to the host filesystem, but the container served its own baked-in files from /usr/share/nginx/html/. All previous deploys were not reaching the live URL.
Root Cause: docker-compose.yml defines no volumes: for the docusaurus service — files are embedded at image build time.
Hotfix Applied: Used docker cp to push incremental file updates directly into the running container:
docker cp /var/www/html/documentation/docs/. \
html-docusaurus-1:/usr/share/nginx/html/documentation/docs/
docker cp /var/www/html/documentation/assets/. \
html-docusaurus-1:/usr/share/nginx/html/documentation/assets/
Permanent Fix (Pending): Add a bind mount to docker-compose.yml or update the Docser analyz workflow to rebuild and restart the container after each deploy.
Fix: Kant Parallel Texts — CSS Style Block Not Rendering (L0 Posts)
Summary: Diagnosed and fixed a critical rendering failure where raw CSS was visible as plain text on the Kant parallel texts page (/kant-critique-of-pure-reason-parallel-texts/), affecting L0 posts 6693 (German A) and 6694 (German B).
Root Cause: WordPress KSES security filter silently strips <style> tags from post content saved via wp_update_post(). A previous script had injected the CSS without the wrapper; the wrapper was stripped on save, leaving the raw CSS block exposed.
Technical Details:
- Script:
fix_kant_css_tags.phpresolved the issue by removing KSES filters before callingwp_update_post(), then locating the raw CSS block and wrapping it in<style>...</style>usingsubstr_replace(). - KSES Bypass Pattern:
remove_filter('content_save_pre', 'wp_filter_post_kses');
remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
wp_update_post($post);
Posts Fixed: Post 6693 (German A, AA IV), Post 6694 (German B, AA III).
Files Modified:
fix_kant_css_tags.php
2026-02-16
Fix: Critique of Pure Reason — German Text Restyling
Summary: Corrected content structure, metadata styling, and font implementation for the German parallel texts (Posts 6693 and 6694).
Technical Details:
- Missing Headers: Used PHP regex to insert missing
<h3 class="fraktur-header">headers (e.g., "Erläuterung", "Schlüsse aus diesen Begriffen") by anchoring to surrounding known text. - Fraktur Font: Implemented
UnifrakturMaguntiaGoogle Font for historical aesthetic. Resolvedwptexturizesmart-quote breakage by using the "no-quote" CSS strategy (removing all quotes fromurl()andfont-familyvalues). - Font Size Reduction: Reduced
.fraktur-textfrom1.5em→1.2emand.k-text-colfrom1.1em→0.9emfor readability.
Key CSS Classes: .fraktur-text, .fraktur-header, .k-row, .k-num-col, .k-text-col, .page-marker-wrapper.
Files Modified:
finalize_styles.phpfinalize_styles_smaller.phpfix_german_headers_final.php
2026-02-13
Feature: Docser Agent — Unified Documentation Workflow
Summary: Merged the legacy Secretary and Saver agents into a single Docser agent that handles session history capture, knowledge-base analysis, and remote deployment in one workflow.
Technical Details:
- New Agent File:
.github/agents/Docser.agent.md - Deprecates:
Secretary.agent.md,Saver.agent.md - Triggers:
svch(save history),analyz(update & deploy KB) - Build Protocol Hardened: Docser now always runs
npm run clear→npm run index→npm run buildin sequence to prevent stale sidebar/cache artifacts.
Files Modified:
.github/agents/Docser.agent.md(created)documentation/docs/ops/agents.mddocumentation/docs/ops/workflow.md
Feature: Writer Agent Added
Summary: Added a new Writer agent for managing WordPress content via PHP CLI scripts.
Technical Details:
- File:
.github/agents/Writer.agent.md - Role: Creates and updates post content using PHP scripts directly on the server (ACF fields, post hierarchy).
- Docs Updated: Added Writer to the Agent Overview table and definition section in
agents.md.
Fix: Deployment Uses rsync --delete
Summary: Discovered that standard rsync without --delete left removed local folders (e.g., tutorial-basics, tutorial-extras) lingering on the remote server. Fixed by switching to rsync --delete in the deployment workflow.
Fix: Mobile Chat Box Reuse Color Identity
Summary: On mobile, reusing an empty chat pane for a different color failed to update the pane's visual identity (ID, tab color, borders), causing a mismatched UI.
Technical Details:
- File:
wp-content/plugins/posts-ai-chatboxes/public/js/rp-ai-chat.js - Fix: Reuse logic now forces the pane ID, tab data attributes, background color, and close button metadata to match the newly requested color before injecting content.
- Rebuilt: JS bundle regenerated via
esbuildand deployed.
Fix: RAG Reindex MCP Tool
Summary: Added a reindex_documentation MCP tool to the vania-rag service so agents can trigger live documentation reindexing on demand.
Technical Details:
- PHP Endpoint:
documentation/reindex_docs.php(secret-key protected) — runsnpm run indexserver-side. - MCP Tool: Added
reindex_documentationtorag-service/main.py. - Permissions: Fixed
documentation/static/ownership so the web user can write index files.
Fix: Sidebar Restructured (Manual sidebars.ts)
Summary: Replaced the auto-generated sidebar config with a manual grouping for better information hierarchy.
Groups: Architecture, Setup & Environment, Deployment & Ops, Development Plans, Reference.
Files Modified:
documentation/sidebars.ts
2026-02-07 (RAG Infrastructure)
Feature: RAG & MCP Knowledge Base
Summary: Deployed retrieval-augmented generation (RAG) system to power AI-assisted queries of the technical documentation.
Technical Details:
- Services: Added
rag-postgres(Vector DB) andrag-service(FastMCP Python Server) todocker-compose.yml. - Remote Config: Configured services to run on remote host (Port
8082for API) using Docker Compose V2. - Tools: Created
indexer.pyfor OpenAI embeddings anddatabase.pyfor vector search.
Files Modified:
docker-compose.ymlrag-service/*documentation/docs/ops/deployment.md
2026-02-07
Fix: L2 Content Rendering and Gallery Scroll Sync
Summary: Resolved issues with the "Current Post" (L2) tab being empty and the sidebar gallery not syncing on scroll.
Technical Details:
- ACF Repeater: Updated
posts-ai-chatboxes.phpto render thecontent_with_repated_imagesfield for L2 content, ensuring text and images appear. - Scroll Sync IDs: Fixed ID mismatch in L2 content rendering. Changed
pix-l2-block-X->pix-block-Xto match the expectation ofpac-ai-chat.js. This restores the functionality where sidebar images update as the user scrolls.
Files Modified:
wp-content/plugins/posts-ai-chatboxes/posts-ai-chatboxes.php
Feature: Secretary & Saver Agent Workflow
Summary: Formalized the workflow for AI agents to maintain documentation and history.
Technical Details:
- Scripts: Added
secretary:synctopackage.jsonfor one-command build & deploy. - Snippets: Added
.vscode/project.code-snippetsentries forsvch(@Saver) andanalyz(Secretary Agent prompt). - Docs: Added
docs/ops/workflow.md.
Feature: RAG & MCP Server Implementation
Summary: Deplemented a Retrieval-Augmented Generation (RAG) system running on Docker to expose technical documentation to AI agents via MCP.
Technical Details:
- Components:
rag-postgres: Postgres 16 + pgvector.rag-service: Python (FastMCP + AsyncPG).
- Functionality: Indexer chunks markdown docs to vectors; MCP server exposes
query_knowledge_base. - Docs: Added
docs/architecture/rag-mcp.md.