Commit graph

3 commits

Author SHA1 Message Date
TheFlow
ac2db33732 fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00
TheFlow
60f239c0bf refactor: deep cleanup - remove all website code from framework repo
REMOVED: 77 website-specific files from src/ and public/

Website Models (9):
- Blog, CaseSubmission, Document, Donation, MediaInquiry,
  ModerationQueue, NewsletterSubscription, Resource, User

Website Services (6):
- BlogCuration, MediaTriage, Koha, ClaudeAPI, ClaudeMdAnalyzer,
  AdaptiveCommunicationOrchestrator

Website Controllers (9):
- blog, cases, documents, koha, media, newsletter, auth, admin, variables

Website Routes (10):
- blog, cases, documents, koha, media, newsletter, auth, admin, test, demo

Website Middleware (4):
- auth, csrf-protection, file-security, response-sanitization

Website Utils (3):
- document-section-parser, jwt, markdown

Website JS (36):
- Website components, docs viewers, page features, i18n, Koha

RETAINED Framework Code:
- 6 core services (Boundary, ContextPressure, CrossReference,
  InstructionPersistence, Metacognitive, PluralisticDeliberation)
- 4 support services (AnthropicMemoryClient, MemoryProxy,
  RuleOptimizer, VariableSubstitution)
- 9 framework models (governance, audit, deliberation, project state)
- 3 framework controllers (rules, projects, audit)
- 7 framework routes (rules, governance, projects, audit, hooks, sync)
- 6 framework middleware (error, validation, security, governance)
- Minimal admin UI (rule manager, dashboard, hooks dashboard)
- Framework demos and documentation

PURPOSE: Tractatus-framework repo is now PURELY framework code.
All website/project code remains in internal repo only.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 21:22:40 +13:00
TheFlow
0ef138f6ab feat(phase3): add code snippet copy buttons and collapsible TOC
SUMMARY:
Implemented Phase 3 Tasks 3.6.1 and 3.6.2: Enhanced documentation
with interactive code copy buttons and collapsible table of contents.

CHANGES:

1. Created code-copy-button.js (new):
   - Auto-detects all <pre> code blocks
   - Adds "Copy" button to top-right of each block
   - Clipboard API with fallback for older browsers
   - Visual feedback: "✓ Copied!" on success
   - Styled to work on dark code backgrounds
   - Listens for 'documentLoaded' event for dynamic content
   - Accessible with aria-label

2. Created toc.js (new):
   - Automatically builds TOC from h1, h2, h3 headings
   - Sticky sidebar on desktop (lg:block)
   - Collapsible on mobile with toggle button
   - Scroll spy with Intersection Observer
   - Highlights current section
   - Smooth scroll to sections
   - Updates URL hash on navigation
   - Auto-collapses on mobile after clicking link

3. Updated docs-viewer.html:
   - Added TOC sidebar (sticky, desktop-only)
   - Improved layout with flex containers
   - Added both components to script imports
   - Maintained existing document viewer functionality

FEATURES:

Code Copy Buttons:
- Button text: "Copy" → "✓ Copied!" → "Copy"
- 2-second success/error feedback
- Works on all <pre><code> blocks
- Respects code indentation

Table of Contents:
- Auto-generated from headings with IDs
- 3-level hierarchy (h1, h2, h3)
- Visual active indicator (blue border + bold)
- Mobile toggle with chevron icon
- Sticky positioning on desktop
- Smooth scroll behavior

ACCESSIBILITY:
✓ Zero CSP violations maintained
✓ Keyboard navigation supported
✓ ARIA labels on interactive elements
✓ Semantic HTML (nav, aside)
✓ Focus indicators

PERFORMANCE:
- Intersection Observer for scroll spy (better than scroll listeners)
- Minimal DOM manipulation
- CSS transitions for smooth UX
- Lazy initialization

UI_TRANSFORMATION_PROJECT_PLAN.md:
✓ Phase 3 Task 3.6.1: Code snippet copy buttons
✓ Phase 3 Task 3.6.2: Collapsible table of contents

NEXT STEPS:
- Deploy to production for testing
- Phase 3 Task 3.2: Interactive architecture diagram (complex, deferred)

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:27:33 +13:00