feat(blog): add table and mermaid components#9
Merged
CagesThrottleUs merged 3 commits intomainfrom Nov 30, 2025
Merged
Conversation
Add two new blog components to enhance content presentation: Table Component: - Supports JSX elements in cells (unlike markdown tables) - Enables use of Highlight, Redacted, and other components within table cells - Maintains classified document styling theme - Fully tested with 4 test cases Mermaid Diagram Component: - Renders diagrams with Cold War classified color palette - Uses safe ref-based rendering via mermaid.run() instead of dangerouslySetInnerHTML - Configuration centralized in constants.ts for maintainability - Red borders, green connectors, blue accents match theme - Includes error handling with CallOut error display - Optional caption support for figure documentation - Fully tested with 4 test cases Additional Changes: - Update CallOut info type to use blue (steel-500) instead of green for better semantic distinction from success callouts - Add mermaid dependency to package.json - Extend CSS with mermaid-specific styling that enforces classified theme colors on generated SVG elements These components provide blog authors with powerful tools for creating technical documentation, architecture diagrams, and data tables while maintaining security best practices and the site's distinctive Cold War aesthetic. Signed-off-by: CagesThrottleUs <manstein.felix@gmail.com>
Updated the box-shadow property in BlogPostLayout.css to enhance the visual presentation of blog posts, ensuring a more polished look while maintaining the existing Cold War theme. Signed-off-by: CagesThrottleUs <manstein.felix@gmail.com>
Implement lazy loading and code splitting to optimize bundle size and improve initial page load performance. Mermaid Component Lazy Loading: - Use dynamic import() to load mermaid library only when needed - Add cancellation token to prevent state updates after unmount - Replace dangerouslySetInnerHTML with safe ref-based rendering - Add loading state with visual feedback during library load - Reduce main bundle by ~2.3 MB (mermaid loads on-demand) Build Optimization: - Configure manual chunks for mermaid, vendor, and UI libraries - Separate React core (~456 kB) for better caching - Isolate mermaid (~2,301 kB) into lazy-loaded chunk - Increase chunk size warning to 1000 kB (acceptable for lazy load) - Main bundle reduced from 1,568 kB to 622 kB (60% reduction) Code Quality Improvements: - Fix non-null assertion in main.tsx with proper error handling - Replace dynamic delete with object destructuring pattern - Add explanatory comments for necessary eslint disables - Document MDX component type requirements - Improve type safety in cache functions Test Environment Enhancements: - Mock window.scrollTo for jsdom compatibility - Suppress expected React error boundary warnings in tests - Suppress false-positive act() warnings (using waitFor properly) - Clean up DOM manipulation error handling for mermaid Performance Impact: - Homepage: 0 kB mermaid (not loaded) - Blog posts without diagrams: 0 kB mermaid - Blog posts with diagrams: 644 kB gzipped (only when used) - 60% smaller main bundle improves initial load time All 191 tests passing with zero linter errors and clean console output. Mermaid diagrams render with Cold War classified theme using safe, production-ready code. Signed-off-by: CagesThrottleUs <manstein.felix@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add two new blog components to enhance content presentation:
Table Component:
Mermaid Diagram Component:
Additional Changes:
These components provide blog authors with powerful tools for creating technical documentation, architecture diagrams, and data tables while maintaining security best practices and the site's distinctive Cold War aesthetic.