stream_weaver 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.beads/.gitignore +77 -0
- data/.beads/README.md +81 -0
- data/.beads/config.yaml +54 -0
- data/.beads/metadata.json +7 -0
- data/.rspec +3 -0
- data/AGENTS.md +91 -0
- data/CHANGELOG.md +294 -0
- data/CLAUDE.md +67 -0
- data/LICENSE.txt +21 -0
- data/README.md +565 -0
- data/Rakefile +13 -0
- data/assets/streamweaver-hero.jpg +0 -0
- data/bench/baselines/ledger.rb +58 -0
- data/bench/baselines/warroom.rb +51 -0
- data/bench/fixtures/ledger.rb +76 -0
- data/bench/fixtures/warroom.rb +60 -0
- data/bench/results/6daf8b8.md +102 -0
- data/bench/results/c8d749b.md +102 -0
- data/bench/results/eb06ab9.md +102 -0
- data/bench/run.rb +151 -0
- data/bench/support.rb +84 -0
- data/copy_this/dto_run_sample_run_7631.html +220 -0
- data/docs/SERVICE_MODE.md +302 -0
- data/docs/architecture/how_streamweaver_works.md +772 -0
- data/docs/blog/2026-01-16-streamweaver-introduction.md +515 -0
- data/docs/bug-2026-08-31-canvas-bridge-socket-collision.md +83 -0
- data/docs/canvas-ipc-session-summary.md +127 -0
- data/docs/canvas-panel-workflow.md +172 -0
- data/docs/canvas-read.md +147 -0
- data/docs/canvas-roadmap.md +275 -0
- data/docs/case-studies/2026-09-03-didx-canvas-read-shelf.md +147 -0
- data/docs/claude-code-companion-skill-spec.md +567 -0
- data/docs/components_reference.md +1223 -0
- data/docs/crud-patterns.md +265 -0
- data/docs/endpoints.md +122 -0
- data/docs/for_llms.md +1 -0
- data/docs/form-patterns.md +165 -0
- data/docs/frontend-only.md +169 -0
- data/docs/html-artifact-audit.md +238 -0
- data/docs/ideas/2025-01-01-as-a-service.md +203 -0
- data/docs/ideas/2026-01-16-charm-tui-exploration.md +542 -0
- data/docs/ideas/2026-08-27-static-doc-shelf-export.md +153 -0
- data/docs/ideas/dhh-review-future-refactors.md +142 -0
- data/docs/opal-jamstack.md +47 -0
- data/docs/opal-npm-direction.md +184 -0
- data/docs/opal-spike-findings.md +194 -0
- data/docs/plans/2025-12-16-form-blocks-design.md +124 -0
- data/docs/plans/2025-12-30-examples-browser-design.md +152 -0
- data/docs/plans/2026-01-02-charts-design.md +288 -0
- data/docs/plans/2026-01-10-canvas-ipc-design.md +247 -0
- data/docs/plans/2026-01-19-cabinet-control-components.md +176 -0
- data/docs/plans/2026-01-26-gem-release-and-panel.md +140 -0
- data/docs/plans/canvas-claude-project-design.md +238 -0
- data/docs/plans/canvas-doc-location-and-discovery.md +32 -0
- data/docs/plans/org-doc-preview-surfaces.md +293 -0
- data/docs/plans/shadcn-polish-plan.md +417 -0
- data/docs/porting-artifacts.md +252 -0
- data/docs/reference/agent-skills-comparison.md +369 -0
- data/docs/reference/travel-state-prd.artifact.html +780 -0
- data/docs/research/2026-08-17-hotwire-alike-landscape.md +268 -0
- data/docs/research/2026-08-17-hotwire-concept-map.md +404 -0
- data/docs/research/2026-08-22-lazy-fragments-trigger-decision.md +246 -0
- data/docs/research/2026-08-22-learnhotwire-syllabus-coverage.md +239 -0
- data/docs/research/frontend-only-matrix.md +278 -0
- data/docs/research/streamweaver-way-spike-findings.md +529 -0
- data/docs/resource-dsl.md +342 -0
- data/docs/routing.md +302 -0
- data/docs/ruby-ui-comparison.md +319 -0
- data/docs/shared-dsl-fragments.md +356 -0
- data/docs/streamweaver-for-ai-agents.md +401 -0
- data/docs/streamweaver-frontend-vision.md +123 -0
- data/docs/streamweaver_canvas/glimmer_initial_final_layer.rb +77 -0
- data/docs/streamweaver_canvas/save_example.rb +9 -0
- data/docs/templates.md +213 -0
- data/docs/testing.md +155 -0
- data/docs/theming-hooks.md +281 -0
- data/docs/tutorials/the-streamweaver-way.md +882 -0
- data/docs/university/capability-inventory.md +137 -0
- data/docs/university/dependency-survey.md +114 -0
- data/docs/university/design-spec.md +217 -0
- data/docs/university/mockups/code-block-doc-theme-dark.png +0 -0
- data/docs/university/mockups/code-block-doc-theme-light.png +0 -0
- data/docs/university/mockups/course-list-dark.png +0 -0
- data/docs/university/mockups/course-list-light.png +0 -0
- data/docs/university/mockups/course_canvas_mockup.rb +741 -0
- data/docs/university/mockups/step-screen-dark.png +0 -0
- data/docs/university/mockups/step-screen-light.png +0 -0
- data/docs/university/roadmap.md +72 -0
- data/docs/university/send-to-coworker.md +77 -0
- data/docs/university/worker-session-mining.md +109 -0
- data/docs/visual/browser-rendering-spike.md +173 -0
- data/docs/visual/builder-visual-plan-analysis.md +378 -0
- data/docs/visual/sw-plan-format-exploration.md +511 -0
- data/docs/visual/sw-plan-rendering-deep-dive.md +453 -0
- data/docs/visual-skills/PROGRESS.md +60 -0
- data/docs/visual-skills/SESSION-CONTEXT.md +207 -0
- data/docs/visual-skills/analysis/components.md +317 -0
- data/docs/visual-skills/analysis/overlap.md +360 -0
- data/docs/visual-skills/analysis/pi-design-deck.md +1102 -0
- data/docs/visual-skills/analysis/streamweaver-inventory.md +93 -0
- data/docs/visual-skills/analysis/unified-specs.feature +1003 -0
- data/docs/visual-skills/analysis/visual-explainer.md +964 -0
- data/docs/visual-skills/blog/blog-series-outline.md +39 -0
- data/docs/visual-skills/blog/token-efficiency.md +73 -0
- data/docs/visual-skills/design/architecture.md +1725 -0
- data/docs/visual-skills/design/codex-review.md +340 -0
- data/docs/visual-skills/design/dhh-review.md +209 -0
- data/docs/visual-skills/design/evolution.md +100 -0
- data/docs/visual-skills/design/gemini-review.md +55 -0
- data/docs/visual-skills/design/review-synthesis.md +149 -0
- data/docs/visual-skills/implementation/STATE.md +22 -0
- data/docs/visual-skills/implementation/plan.md +347 -0
- data/docs/visual-skills/implementation/spike-findings.md +237 -0
- data/docs/visual-skills/implementation/tasks.md +702 -0
- data/docs/visual-skills/lessons-learned/process.md +145 -0
- data/examples/README.md +96 -0
- data/examples/advanced/all_components.rb +177 -0
- data/examples/advanced/examples_browser.rb +394 -0
- data/examples/advanced/teachables_browser.rb +261 -0
- data/examples/advanced/theme_tweaker.rb +366 -0
- data/examples/advanced/tutorial.rb +1528 -0
- data/examples/agentic/agentic_form.rb +30 -0
- data/examples/agentic/agentic_form_autoclose.rb +30 -0
- data/examples/agentic/cultivation_tracker.rb +69 -0
- data/examples/basic/hello_world.rb +22 -0
- data/examples/basic/opal_tabs_table.rb +44 -0
- data/examples/basic/todo_list.rb +39 -0
- data/examples/button_loading_test.rb +36 -0
- data/examples/canvas/mermaid_canvas_demo.sh +151 -0
- data/examples/charts/bar_chart_demo.rb +57 -0
- data/examples/charts/line_chart_demo.rb +73 -0
- data/examples/charts/pie_area_demo.rb +87 -0
- data/examples/charts/stacked_bar_chart_demo.rb +69 -0
- data/examples/claude_code/README.md +85 -0
- data/examples/claude_code/codebreaker/.claude/commands/infiltrate.md +632 -0
- data/examples/claude_code/codebreaker/.claude/settings.json +11 -0
- data/examples/claude_code/codebreaker/.claude/settings.local.json +17 -0
- data/examples/claude_code/codebreaker/.claude/skills/infiltrate.md +0 -0
- data/examples/claude_code/codebreaker/README.md +213 -0
- data/examples/claude_code/tutorial/.claude/commands/learn.md +453 -0
- data/examples/claude_code/tutorial/README.md +102 -0
- data/examples/claude_code/verification_flow/.claude/commands/verify.md +171 -0
- data/examples/claude_code/verification_flow/README.md +126 -0
- data/examples/components/annotated_code_demo.rb +54 -0
- data/examples/components/callout_demo.rb +33 -0
- data/examples/components/checkbox_group_demo.rb +46 -0
- data/examples/components/design_review.css +468 -0
- data/examples/components/design_review_demo.rb +44 -0
- data/examples/components/design_review_dsl.rb +300 -0
- data/examples/components/diff_block_demo.rb +112 -0
- data/examples/components/events_demo.rb +184 -0
- data/examples/components/form_demo.rb +62 -0
- data/examples/components/lesson_demo.rb +53 -0
- data/examples/components/markdown_demo.rb +110 -0
- data/examples/components/mermaid_demo.rb +166 -0
- data/examples/components/pareto_set.rb +64 -0
- data/examples/components/prd_demo.rb +21 -0
- data/examples/components/prd_dsl.rb +385 -0
- data/examples/components/quiz_demo.rb +47 -0
- data/examples/components/run_viewer_demo.rb +100 -0
- data/examples/components/score_and_collapsible_demo.rb +82 -0
- data/examples/components/select_stale_value_smoke_test.rb +39 -0
- data/examples/components/table_demo.rb +247 -0
- data/examples/components/timer_with_state_demo.rb +58 -0
- data/examples/components/todo_due_dates.rb +63 -0
- data/examples/components/uat_gaps_demo.rb +112 -0
- data/examples/dashboard/feed_simulator.rb +60 -0
- data/examples/dashboard/live_dashboard.rb +80 -0
- data/examples/dashboard_components.rb +108 -0
- data/examples/deferred_fragments_demo.rb +62 -0
- data/examples/generate_more_spike/README.md +63 -0
- data/examples/generate_more_spike/app.rb +441 -0
- data/examples/git_health.sh +401 -0
- data/examples/layout/layout_components_demo.rb +174 -0
- data/examples/layout/modal_demo.rb +215 -0
- data/examples/layout/navigation_demo.rb +227 -0
- data/examples/layout/route_tabs_demo.rb +52 -0
- data/examples/layout/routing_demo.rb +52 -0
- data/examples/layout/scroll_box_demo.rb +154 -0
- data/examples/lazy_fragments_demo.rb +151 -0
- data/examples/my_todos/README.md +29 -0
- data/examples/my_todos/my_todos.rb +312 -0
- data/examples/my_todos/store.rb +86 -0
- data/examples/opal/reactive_demo.rb +62 -0
- data/examples/opal/scenarios/s1_counter.rb +15 -0
- data/examples/opal/scenarios/s2_search_filter.rb +17 -0
- data/examples/opal/scenarios/s3_sibling_tabs.rb +25 -0
- data/examples/opal/scenarios/s4_shopping_cart.rb +34 -0
- data/examples/opal/scenarios/s5_watch.rb +39 -0
- data/examples/opal/scenarios/s6_on_start.rb +20 -0
- data/examples/opal/scenarios/s7_wizard.rb +33 -0
- data/examples/opal/scenarios/s8_loan_calculator.rb +21 -0
- data/examples/opal/scenarios/s9_dashboard.rb +27 -0
- data/examples/operations_dashboard_demo.rb +167 -0
- data/examples/panel_demo.sh +447 -0
- data/examples/parity/assets/tyrion_slice.css +86 -0
- data/examples/parity/rivet_people_slice.rb +182 -0
- data/examples/parity/tyrion_components.css +777 -0
- data/examples/parity/tyrion_warroom_components.rb +414 -0
- data/examples/parity/tyrion_warroom_slice.rb +549 -0
- data/examples/puma_dev/README.md +124 -0
- data/examples/puma_dev/config.ru +34 -0
- data/examples/puma_dev/standalone_app.rb +34 -0
- data/examples/scaffolding/blog.rb +49 -0
- data/examples/scaffolding/utf_lite.rb +105 -0
- data/examples/styling/feedback_demo.rb +229 -0
- data/examples/styling/style_showcase.rb +172 -0
- data/examples/styling/theme_demo.rb +508 -0
- data/examples/timer_health_checker.rb +111 -0
- data/examples/timer_showcase.rb +131 -0
- data/examples/tutorials/render_markdown.rb +112 -0
- data/examples/tutorials/streamweaver_way_tutorial.rb +44 -0
- data/examples/tutorials/tutorial_content.rb +1082 -0
- data/examples/visual_skills/design_deck_demo.rb +314 -0
- data/examples/visual_skills/explainer_demo.rb +499 -0
- data/exe/streamweaver +9 -0
- data/gsd/ROADMAP-1.0.md +167 -0
- data/gsd/STATE.md +13 -0
- data/gsd/research/market-positioning-research.md +139 -0
- data/gsd/research/production-patterns-research.md +270 -0
- data/gsd/research/repo-audit-1.0.md +274 -0
- data/lib/stream_weaver/action_token.rb +58 -0
- data/lib/stream_weaver/adapter/alpinejs.rb +8249 -0
- data/lib/stream_weaver/adapter/base.rb +591 -0
- data/lib/stream_weaver/adapter/opal.rb +334 -0
- data/lib/stream_weaver/adapter/static.rb +1118 -0
- data/lib/stream_weaver/admin.rb +176 -0
- data/lib/stream_weaver/app.rb +1821 -0
- data/lib/stream_weaver/assets/js/sw-copy.js +50 -0
- data/lib/stream_weaver/assets/js/sw-heredoc-rewrite.js +68 -0
- data/lib/stream_weaver/assets/js/sw-keyboard.js +165 -0
- data/lib/stream_weaver/assets/js/sw-mermaid-zoom.js +621 -0
- data/lib/stream_weaver/assets/js/sw-route-tabs.js +53 -0
- data/lib/stream_weaver/assets/js/sw-sidebar-toc.js +116 -0
- data/lib/stream_weaver/assets/js/sw-slide-nav.js +103 -0
- data/lib/stream_weaver/canvas/bridge.rb +239 -0
- data/lib/stream_weaver/canvas/bridge_server.rb +646 -0
- data/lib/stream_weaver/canvas/client.rb +298 -0
- data/lib/stream_weaver/canvas/doc_roots.rb +233 -0
- data/lib/stream_weaver/canvas/doc_store.rb +252 -0
- data/lib/stream_weaver/canvas/gist_publisher.rb +264 -0
- data/lib/stream_weaver/canvas/gist_save_handler.rb +89 -0
- data/lib/stream_weaver/canvas/gist_store.rb +135 -0
- data/lib/stream_weaver/canvas/helpers.rb +109 -0
- data/lib/stream_weaver/canvas/history.rb +90 -0
- data/lib/stream_weaver/canvas/protocol.rb +86 -0
- data/lib/stream_weaver/canvas/reader.rb +853 -0
- data/lib/stream_weaver/canvas/save_doc_widget.rb +457 -0
- data/lib/stream_weaver/canvas/scroll_top_hint.rb +21 -0
- data/lib/stream_weaver/canvas/session.rb +132 -0
- data/lib/stream_weaver/cli.rb +3235 -0
- data/lib/stream_weaver/component_assets.rb +70 -0
- data/lib/stream_weaver/component_registry.rb +67 -0
- data/lib/stream_weaver/component_renderer.rb +48 -0
- data/lib/stream_weaver/components/annotated_code.rb +53 -0
- data/lib/stream_weaver/components/api_endpoint.rb +42 -0
- data/lib/stream_weaver/components/callout.rb +59 -0
- data/lib/stream_weaver/components/chart.rb +84 -0
- data/lib/stream_weaver/components/code_block.rb +77 -0
- data/lib/stream_weaver/components/comparison.rb +39 -0
- data/lib/stream_weaver/components/decision.rb +38 -0
- data/lib/stream_weaver/components/deck/close_overlay.rb +84 -0
- data/lib/stream_weaver/components/deck/confirmation_bar.rb +60 -0
- data/lib/stream_weaver/components/deck/deck_option.rb +61 -0
- data/lib/stream_weaver/components/deck/deck_slide.rb +77 -0
- data/lib/stream_weaver/components/deck/deck_state.rb +469 -0
- data/lib/stream_weaver/components/deck/deck_summary.rb +73 -0
- data/lib/stream_weaver/components/deck/design_deck.rb +60 -0
- data/lib/stream_weaver/components/deck/generate_more_controls.rb +84 -0
- data/lib/stream_weaver/components/deck/model_selector.rb +84 -0
- data/lib/stream_weaver/components/deck/skeleton_placeholder.rb +36 -0
- data/lib/stream_weaver/components/diff_block.rb +125 -0
- data/lib/stream_weaver/components/doc_header.rb +57 -0
- data/lib/stream_weaver/components/image_block.rb +70 -0
- data/lib/stream_weaver/components/implementation_map.rb +33 -0
- data/lib/stream_weaver/components/keyboard_shortcuts.rb +94 -0
- data/lib/stream_weaver/components/kpi_dashboard.rb +78 -0
- data/lib/stream_weaver/components/mermaid.rb +79 -0
- data/lib/stream_weaver/components/pipeline.rb +63 -0
- data/lib/stream_weaver/components/sidebar_toc.rb +46 -0
- data/lib/stream_weaver/components/slide_container.rb +141 -0
- data/lib/stream_weaver/components/timeline_event.rb +58 -0
- data/lib/stream_weaver/components/wireframe.rb +29 -0
- data/lib/stream_weaver/components/wireframe_block.rb +34 -0
- data/lib/stream_weaver/components.rb +2711 -0
- data/lib/stream_weaver/css.rb +230 -0
- data/lib/stream_weaver/dev_fallback_overlay.rb +61 -0
- data/lib/stream_weaver/display_dsl.rb +1004 -0
- data/lib/stream_weaver/export/html_exporter.rb +478 -0
- data/lib/stream_weaver/feed.rb +34 -0
- data/lib/stream_weaver/feed_builder.rb +31 -0
- data/lib/stream_weaver/fonts.rb +33 -0
- data/lib/stream_weaver/interaction_runner.rb +487 -0
- data/lib/stream_weaver/iterm.rb +460 -0
- data/lib/stream_weaver/layout_registry.rb +92 -0
- data/lib/stream_weaver/opal/bridge.rb +52 -0
- data/lib/stream_weaver/opal/builder.rb +193 -0
- data/lib/stream_weaver/opal/env.rb +29 -0
- data/lib/stream_weaver/opal/reactive_state.rb +75 -0
- data/lib/stream_weaver/opal/regexp_anchor_patch.rb +62 -0
- data/lib/stream_weaver/opal/renderer.rb +77 -0
- data/lib/stream_weaver/opal/runtime.rb +250 -0
- data/lib/stream_weaver/opal/shell.rb +145 -0
- data/lib/stream_weaver/opal/string_bridge.rb +50 -0
- data/lib/stream_weaver/opal/stubs/diff.min.js +1 -0
- data/lib/stream_weaver/opal/stubs/digest.rb +15 -0
- data/lib/stream_weaver/opal/stubs/marked.umd.js +79 -0
- data/lib/stream_weaver/opal/stubs/md5.rb +3 -0
- data/lib/stream_weaver/opal/stubs/morphdom.min.js +775 -0
- data/lib/stream_weaver/opal/stubs/prism-tomorrow.min.css +1 -0
- data/lib/stream_weaver/opal/stubs/prism.min.js +1967 -0
- data/lib/stream_weaver/opal_entry.rb +136 -0
- data/lib/stream_weaver/org/inline.rb +95 -0
- data/lib/stream_weaver/org/reader.rb +561 -0
- data/lib/stream_weaver/org/recording_context.rb +86 -0
- data/lib/stream_weaver/org/source_splitter.rb +63 -0
- data/lib/stream_weaver/org/writer.rb +300 -0
- data/lib/stream_weaver/page_shell.rb +530 -0
- data/lib/stream_weaver/portfile.rb +79 -0
- data/lib/stream_weaver/pushable.rb +42 -0
- data/lib/stream_weaver/resource/default_views.rb +111 -0
- data/lib/stream_weaver/resource/field_input.rb +25 -0
- data/lib/stream_weaver/resource/state_keys.rb +16 -0
- data/lib/stream_weaver/resource/store.rb +18 -0
- data/lib/stream_weaver/resource.rb +104 -0
- data/lib/stream_weaver/server.rb +1471 -0
- data/lib/stream_weaver/service.rb +1240 -0
- data/lib/stream_weaver/service_client.rb +104 -0
- data/lib/stream_weaver/session_store.rb +186 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/SKILL.md +66 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/examples/canvas-safe-showcase.rb +98 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/references/actions-and-buttons.md +47 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/references/charts-and-diagrams.md +38 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/references/deck.md +32 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/references/inputs-and-forms.md +65 -0
- data/lib/stream_weaver/skills/streamweaver-canvas-safe/references/tabs-and-navigation.md +53 -0
- data/lib/stream_weaver/skills/streamweaver-doc-builder/SKILL.md +298 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/SKILL.md +130 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/examples/design-review-example.css +468 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/examples/design-review-example.rb +39 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/examples/design-review-example_dsl.rb +300 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/examples/doc-parity-example.rb +24 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/examples/doc-parity-example_dsl.rb +385 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/references/checkpoints-and-forms.md +28 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/references/cleanup-and-panel.md +44 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/references/example-gallery.md +8 -0
- data/lib/stream_weaver/skills/streamweaver-visual-companion/references/persistence.md +58 -0
- data/lib/stream_weaver/skills/streamweaver-way/SKILL.md +396 -0
- data/lib/stream_weaver/skills/visual-plan/SKILL.md +201 -0
- data/lib/stream_weaver/skills/visual-recap/SKILL.md +244 -0
- data/lib/stream_weaver/streamer.rb +63 -0
- data/lib/stream_weaver/templates/choices.rb +149 -0
- data/lib/stream_weaver/templates/code.rb +157 -0
- data/lib/stream_weaver/templates/confirm.rb +110 -0
- data/lib/stream_weaver/templates/diff.rb +195 -0
- data/lib/stream_weaver/templates/info.rb +142 -0
- data/lib/stream_weaver/templates/table.rb +169 -0
- data/lib/stream_weaver/templates/wizard.rb +271 -0
- data/lib/stream_weaver/theme/auto_mode.rb +116 -0
- data/lib/stream_weaver/theme/presets.rb +555 -0
- data/lib/stream_weaver/theme.rb +639 -0
- data/lib/stream_weaver/university/canvas.rb +924 -0
- data/lib/stream_weaver/university/course.rb +699 -0
- data/lib/stream_weaver/university/demos/counter.rb +33 -0
- data/lib/stream_weaver/university/demos/dashboard.rb +147 -0
- data/lib/stream_weaver/university/demos/decision_form.rb +143 -0
- data/lib/stream_weaver/university/demos.rb +50 -0
- data/lib/stream_weaver/university/listener.rb +467 -0
- data/lib/stream_weaver/university/progress.rb +201 -0
- data/lib/stream_weaver/university/runner.rb +138 -0
- data/lib/stream_weaver/university/scripts/growing_doc.rb +609 -0
- data/lib/stream_weaver/university/scripts/growing_doc_state.rb +91 -0
- data/lib/stream_weaver/utils.rb +31 -0
- data/lib/stream_weaver/version.rb +5 -0
- data/lib/stream_weaver/views/canvas/reader_layout.erb +800 -0
- data/lib/stream_weaver/views.rb +3940 -0
- data/lib/stream_weaver.rb +122 -0
- data/llms.txt +1269 -0
- data/sig/stream_weaver.rbs +4 -0
- metadata +598 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Session Context -- Visual Skills Development
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
This file captures everything needed to resume work after context compaction.
|
|
5
|
+
Read this first when continuing this work.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Current Status: Phase 5 COMPLETE, Demo Testing & Fixes DONE, Phase 6 PENDING
|
|
10
|
+
|
|
11
|
+
### All 15 implementation tasks done -- 1427 tests, 0 failures
|
|
12
|
+
### Demo apps tested and fixed -- both rendering correctly
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Critical Bug Found & Fixed: CSS/JS Injection Memoization
|
|
17
|
+
|
|
18
|
+
### The Bug
|
|
19
|
+
All visual skills components used `@_var ||=` or `@var = true` memoization on the **adapter instance** to inject CSS/JS once per page. But the adapter is a singleton (`set :adapter, Adapter::AlpineJS.new` in server.rb), so after the first render, all subsequent HTMX morph re-renders skipped CSS/JS injection. This caused:
|
|
20
|
+
- No slide navigation (swSlideNav undefined)
|
|
21
|
+
- No component styling (no grids, no borders, no colors)
|
|
22
|
+
- No Prism.js syntax highlighting
|
|
23
|
+
- No Mermaid.js diagram rendering
|
|
24
|
+
- No Chart.js charts
|
|
25
|
+
|
|
26
|
+
### The Fix
|
|
27
|
+
Changed **19 injection methods** in `lib/stream_weaver/adapter/alpinejs.rb` from adapter-level memoization to per-view dedup:
|
|
28
|
+
|
|
29
|
+
**Before** (broken -- adapter instance persists):
|
|
30
|
+
```ruby
|
|
31
|
+
def inject_slide_nav_js(view)
|
|
32
|
+
@_slide_nav_js_injected ||= begin
|
|
33
|
+
view.script { view.raw(view.safe(File.read(js_path))) }
|
|
34
|
+
true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**After** (fixed -- view is fresh per render):
|
|
40
|
+
```ruby
|
|
41
|
+
def inject_slide_nav_js(view)
|
|
42
|
+
return if view.instance_variable_get(:@_slide_nav_js_injected)
|
|
43
|
+
view.instance_variable_set(:@_slide_nav_js_injected, true)
|
|
44
|
+
view.script { view.raw(view.safe(File.read(js_path))) } if File.exist?(js_path)
|
|
45
|
+
end
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### All 19 methods fixed:
|
|
49
|
+
1. `inject_keyboard_js` (line ~2661)
|
|
50
|
+
2. `inject_deck_css` (line ~3705)
|
|
51
|
+
3. `inject_deck_selection_js` (line ~3712)
|
|
52
|
+
4. `inject_deck_summary_js` (line ~3795)
|
|
53
|
+
5. `inject_generate_more_css` (line ~3827)
|
|
54
|
+
6. `inject_generate_more_js` (line ~3834)
|
|
55
|
+
7. `inject_deck_polish_css` (line ~4059)
|
|
56
|
+
8. `inject_slide_nav_js` (line ~4666)
|
|
57
|
+
9. `inject_slide_container_css` (line ~4674)
|
|
58
|
+
10. Animation CSS in `render_theme_preset` (line ~2035)
|
|
59
|
+
11. Mermaid assets in `render_mermaid` (line ~2111)
|
|
60
|
+
12. Pipeline CSS in `render_pipeline` (line ~2274)
|
|
61
|
+
13. KPI CSS in `render_kpi_dashboard` (line ~2386)
|
|
62
|
+
14. Chart assets in `render_chartjs` (line ~2482)
|
|
63
|
+
15. `inject_sidebar_toc_assets` (line ~2859)
|
|
64
|
+
16. `inject_callout_css` (line ~2870)
|
|
65
|
+
17. `inject_comparison_css` (line ~2877)
|
|
66
|
+
18. `inject_prism_cdn` (line ~5509)
|
|
67
|
+
19. `inject_helpers_css` (line ~5696)
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Other Fixes Applied
|
|
72
|
+
|
|
73
|
+
### Score Table Key Mismatch
|
|
74
|
+
- `render_score_table` expected `score[:value]` but demo used `score[:score]`
|
|
75
|
+
- Fix: `value = score[:value] || score[:score] || 0`
|
|
76
|
+
- File: `lib/stream_weaver/adapter/alpinejs.rb:1204`
|
|
77
|
+
|
|
78
|
+
### Duplicate Deck Title
|
|
79
|
+
- Page H1 from views.rb AND deck's own H1 both showed the same title
|
|
80
|
+
- Fix: Removed `view.h1(class: "sw-deck__title")` from `render_design_deck`
|
|
81
|
+
- Updated test in `spec/components/deck/design_deck_spec.rb:286`
|
|
82
|
+
|
|
83
|
+
### Scroll-to-Top on Slide Change
|
|
84
|
+
- Swap mode navigation didn't scroll back to top, leaving user staring at empty space
|
|
85
|
+
- Fix: Added `container.scrollIntoView()` for swap mode in `_onNavigate()`
|
|
86
|
+
- File: `lib/stream_weaver/assets/js/sw-slide-nav.js:93`
|
|
87
|
+
|
|
88
|
+
### Stale DeckState Cleanup
|
|
89
|
+
- Hundreds of test-generated JSON files in `tmp/deck_state/` causing pre-selected options
|
|
90
|
+
- Cleaned up; consider adding to `.gitignore`
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## What Was Built (Phase 5)
|
|
95
|
+
|
|
96
|
+
### Wave 1: Foundation
|
|
97
|
+
- **T1**: Generate-more spike -- push-to-state validated, 4-state machine discovered
|
|
98
|
+
- **T2**: Theme + CSS foundation -- `sw-` prefix convention, auto-mode, CSS custom properties
|
|
99
|
+
|
|
100
|
+
### Wave 2: Shared Components
|
|
101
|
+
- **T3**: Mermaid (zoom/pan, CDN, theme-aware, ELK layout) -- 50 tests
|
|
102
|
+
- **T4**: CodeBlock (Prism.js, file header, truncation) + ImageBlock (caption, base64) -- 61 tests
|
|
103
|
+
- **T5**: KeyboardShortcuts + SlideContainer (swap + scroll-snap modes) -- 87 tests
|
|
104
|
+
- **T6**: Card depth tiers + Table enhancements (backward compat) -- 45 tests
|
|
105
|
+
|
|
106
|
+
### Wave 3: Deck Core
|
|
107
|
+
- **T7**: DesignDeck + DeckSlide + DeckOption (DSL nesting, option grids, ARIA) -- 78 tests
|
|
108
|
+
- **T8**: DeckState file-backed store, selection + notes persistence -- 60 tests
|
|
109
|
+
- **T9**: DeckSummary, submit gating, run_once! integration -- 35 tests
|
|
110
|
+
|
|
111
|
+
### Wave 4: Generate-More + Explainer
|
|
112
|
+
- **T10**: Generate-more full (4-state machine, request versioning, push-to-state) -- 56 tests
|
|
113
|
+
- **T11**: SidebarToc + Callout + Comparison -- 68 tests
|
|
114
|
+
- **T12**: Pipeline + KpiDashboard + Chart (Chart.js) -- 91 tests
|
|
115
|
+
|
|
116
|
+
### Wave 5: Polish
|
|
117
|
+
- **T13**: 7 CSS-only helpers + HtmlExporter -- 80 tests
|
|
118
|
+
- **T14**: ModelSelector + ConfirmationBar + CloseOverlay -- 46 tests
|
|
119
|
+
- **T15**: 5 theme presets + 6 CSS animations -- 104 tests
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Demo Apps (TESTED & WORKING)
|
|
124
|
+
|
|
125
|
+
### Design Deck Demo
|
|
126
|
+
- **File**: `examples/visual_skills/design_deck_demo.rb`
|
|
127
|
+
- **Scenario**: "API Gateway Architecture Review" -- 4 slides with mermaid + code_block options
|
|
128
|
+
- **Run**: `bash -lc 'ruby examples/visual_skills/design_deck_demo.rb'`
|
|
129
|
+
- **Status**: Working -- slides render, mermaid diagrams in cards, navigation, option selection, generate-more controls
|
|
130
|
+
- **Remaining polish**: Notes textarea contrast on dark theme could be better
|
|
131
|
+
|
|
132
|
+
### Visual Explainer Demo
|
|
133
|
+
- **File**: `examples/visual_skills/explainer_demo.rb`
|
|
134
|
+
- **Scenario**: "Diff Review: feature/auth-migration" -- JWT migration code review
|
|
135
|
+
- **Run**: `bash -lc 'ruby examples/visual_skills/explainer_demo.rb'`
|
|
136
|
+
- **Status**: Working -- all 13 component types rendering correctly
|
|
137
|
+
- **Verified components**: hero, prose, pullquote, kpi_dashboard (grid), chart (line + bar), mermaid (full diagram), dir_tree, comparison (side-by-side), code_block (syntax highlighted), pipeline (horizontal flow), callout (all 5 variants with colored backgrounds), score_table, sidebar_toc, flow_arrow, badges
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## What Needs to Happen Next
|
|
142
|
+
|
|
143
|
+
### Git Commit
|
|
144
|
+
All work is uncommitted. When ready:
|
|
145
|
+
- Stage all new/modified files
|
|
146
|
+
- Single commit or per-wave commits per user preference
|
|
147
|
+
|
|
148
|
+
### Phase 6: Documentation & Blog
|
|
149
|
+
- Blog post drafts in `docs/visual-skills/blog/`
|
|
150
|
+
- Lessons learned update in `docs/visual-skills/lessons-learned/process.md`
|
|
151
|
+
|
|
152
|
+
### Remaining Polish (Optional)
|
|
153
|
+
- Notes textarea contrast on dark theme in deck demo
|
|
154
|
+
- Pullquote text is very low contrast on dark theme (barely visible)
|
|
155
|
+
- `tmp/deck_state/` should be added to `.gitignore`
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Key Files Reference
|
|
160
|
+
|
|
161
|
+
### Implementation State
|
|
162
|
+
| File | Purpose |
|
|
163
|
+
|------|---------|
|
|
164
|
+
| `docs/visual-skills/implementation/STATE.md` | All 15 tasks DONE |
|
|
165
|
+
| `docs/visual-skills/implementation/tasks.md` | Task specifications |
|
|
166
|
+
| `docs/visual-skills/implementation/plan.md` | Ralph-loop orchestration plan |
|
|
167
|
+
| `docs/visual-skills/implementation/spike-findings.md` | T1 generate-more spike discoveries |
|
|
168
|
+
| `docs/visual-skills/PROGRESS.md` | Phase checklist |
|
|
169
|
+
| `docs/visual-skills/SESSION-CONTEXT.md` | This file |
|
|
170
|
+
|
|
171
|
+
### Design Documents
|
|
172
|
+
| File | Purpose |
|
|
173
|
+
|------|---------|
|
|
174
|
+
| `docs/visual-skills/design/architecture.md` | Full architecture (updated with post-review changes) |
|
|
175
|
+
| `docs/visual-skills/design/review-synthesis.md` | 3-reviewer reconciliation |
|
|
176
|
+
| `docs/visual-skills/design/gemini-review.md` | Push-to-state insight |
|
|
177
|
+
| `docs/visual-skills/design/evolution.md` | 5 decision log entries |
|
|
178
|
+
|
|
179
|
+
### Source Code (New)
|
|
180
|
+
| Directory | Contents |
|
|
181
|
+
|-----------|----------|
|
|
182
|
+
| `lib/stream_weaver/components/mermaid.rb` | Mermaid component |
|
|
183
|
+
| `lib/stream_weaver/components/code_block.rb` | CodeBlock component |
|
|
184
|
+
| `lib/stream_weaver/components/image_block.rb` | ImageBlock component |
|
|
185
|
+
| `lib/stream_weaver/components/keyboard_shortcuts.rb` | KeyboardShortcuts |
|
|
186
|
+
| `lib/stream_weaver/components/slide_container.rb` | SlideContainer + Slide |
|
|
187
|
+
| `lib/stream_weaver/components/sidebar_toc.rb` | SidebarToc |
|
|
188
|
+
| `lib/stream_weaver/components/callout.rb` | Callout (5 variants) |
|
|
189
|
+
| `lib/stream_weaver/components/comparison.rb` | Comparison (before/after) |
|
|
190
|
+
| `lib/stream_weaver/components/pipeline.rb` | Pipeline step flow |
|
|
191
|
+
| `lib/stream_weaver/components/kpi_dashboard.rb` | KPI metrics grid |
|
|
192
|
+
| `lib/stream_weaver/components/chart.rb` | Chart.js wrapper |
|
|
193
|
+
| `lib/stream_weaver/components/deck/` | All deck components (7 files) |
|
|
194
|
+
| `lib/stream_weaver/theme/presets.rb` | 5 theme presets |
|
|
195
|
+
| `lib/stream_weaver/theme/auto_mode.rb` | Auto-mode JS |
|
|
196
|
+
| `lib/stream_weaver/export/html_exporter.rb` | Self-contained HTML export |
|
|
197
|
+
| `lib/stream_weaver/assets/js/` | Custom JS (mermaid zoom, keyboard, slides, sidebar TOC) |
|
|
198
|
+
|
|
199
|
+
### Test Files
|
|
200
|
+
All specs in `spec/` -- run `bash -lc 'bundle exec rspec'` for full suite (1427 tests).
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Memory References
|
|
205
|
+
- Project memory: `~/.claude/projects/-Users-fkchang-work-rstreamlit-stream-weaver/memory/project_visual_skills.md`
|
|
206
|
+
- Port detection memory: StreamWeaver uses `find_available_port` starting at 4567
|
|
207
|
+
- Feedback memory: playwright-cli testing approach (subagents failed)
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# StreamWeaver Component Inventory for Visual Skills
|
|
2
|
+
|
|
3
|
+
*Date: 2026-03-12*
|
|
4
|
+
*Purpose: Every new component needed, organized by shared/deck/explainer*
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Shared Components (Used by Both Projects)
|
|
9
|
+
|
|
10
|
+
### 1.1 `mermaid(code, **options)`
|
|
11
|
+
- **Props:** `code:` (string, required), `zoom:` (boolean, default false), `compact:` (boolean, default false), `layout:` (:default | :elk), `theme_vars:` (hash, optional per-block overrides)
|
|
12
|
+
- **Renders:** Mermaid diagram as inline SVG within a container. When `zoom: true`, wraps in zoom/pan container with +/- controls, Ctrl+scroll zoom, click-drag pan, click-to-expand. When `compact: true`, minimal container for card embedding.
|
|
13
|
+
- **Extends/Inspired by:** New component. JS asset (~200 lines) for zoom engine. Loads Mermaid.js from CDN (mermaid@11 ESM).
|
|
14
|
+
- **Notes:** Must detect dark/light theme at load time for Mermaid themeVariables. ELK layout loads separate CDN module.
|
|
15
|
+
|
|
16
|
+
### 1.2 `code_block(code, **options)`
|
|
17
|
+
- **Props:** `code:` (string, required), `lang:` (string, e.g. "ruby", "ts", "javascript"), `file:` (string, optional file path header), `truncate:` (integer, optional max lines), `scroll:` (boolean, default true for long code)
|
|
18
|
+
- **Renders:** Syntax-highlighted code block via Prism.js with autoloader. Optional file header bar above code. Scrollable container for long code. Truncation mode for thumbnails.
|
|
19
|
+
- **Extends/Inspired by:** New component. Could extend or wrap the existing `md` component's code fence rendering, but needs Prism.js for proper highlighting beyond what markdown processors offer.
|
|
20
|
+
- **Notes:** Loads Prism.js + autoloader from CDN. Uses theme's `--font-mono` custom property. Recessed depth styling when inside a card.
|
|
21
|
+
|
|
22
|
+
### 1.3 `theme_toggle(**options)`
|
|
23
|
+
- **Props:** `mode:` (:dark | :light | :auto, default :dark), `hotkey:` (string, e.g. "mod+shift+l"), `persist:` (boolean, default true)
|
|
24
|
+
- **Renders:** Optional toggle button with sun/moon SVG icons. Manages `data-theme` attribute on `<html>`. Updates `<meta name="theme-color">`.
|
|
25
|
+
- **Extends/Inspired by:** Enhances existing StreamWeaver Theme module. The module already has dark/light; this adds auto mode, keyboard toggle, localStorage persistence, and the toggle button UI.
|
|
26
|
+
|
|
27
|
+
### 1.4 `keyboard_shortcuts(&block)`
|
|
28
|
+
- **Props:** Block DSL for registering shortcuts: `shortcut("mod+s", context: :global) { |e| ... }`
|
|
29
|
+
- **Renders:** No visible UI. Registers keyboard event handlers with context awareness (suppresses when focus is in text inputs, textareas, or specified interactive containers).
|
|
30
|
+
- **Extends/Inspired by:** New component. AlpineJS adapter could handle `@keydown` directives, but a centralized registry is needed for conflict resolution and context suppression.
|
|
31
|
+
- **Notes:** "mod" maps to Cmd on Mac, Ctrl elsewhere. Must support modifier combinations. Context-aware suppression for `.mermaid-wrap`, `.table-scroll`, `.code-scroll`, `textarea`, `input[type=text]`.
|
|
32
|
+
|
|
33
|
+
### 1.5 `html_export(path:, inline_images:)`
|
|
34
|
+
- **Props:** `path:` (string, output file path), `inline_images:` (boolean, default false)
|
|
35
|
+
- **Renders:** Not a visual component. Pipeline that serializes current StreamWeaver page into a self-contained HTML file. Inlines all CSS from the theme and components. Preserves CDN links for Mermaid, Chart.js, fonts. Optionally base64-encodes images.
|
|
36
|
+
- **Extends/Inspired by:** New infrastructure. Works with the Phlex rendering pipeline to capture output as a string and wrap in HTML5 document structure.
|
|
37
|
+
|
|
38
|
+
### 1.6 `slide_container(**options, &block)`
|
|
39
|
+
- **Props:** `progress_bar:` (boolean, default true), `keyboard_nav:` (boolean, default true), `mode:` (:swap | :scroll_snap)
|
|
40
|
+
- **Renders:** Container for slides. In `:swap` mode (deck), shows one slide at a time with DOM-swap and Back/Next buttons. In `:scroll_snap` mode (explainer), uses CSS scroll-snap with 100dvh per slide. Both share: progress bar, keyboard navigation (arrows, space), focus management.
|
|
41
|
+
- **Extends/Inspired by:** New component. The two modes share a navigation state machine but differ in DOM structure and CSS.
|
|
42
|
+
|
|
43
|
+
### 1.7 `progress_bar(current:, total:)`
|
|
44
|
+
- **Props:** `current:` (integer), `total:` (integer), `animated:` (boolean, default true)
|
|
45
|
+
- **Renders:** Fixed-position progress bar at top of viewport showing completion percentage. Width transition animation.
|
|
46
|
+
- **Extends/Inspired by:** StreamWeaver already has `progress_bar(value:, max:, ...)` -- this is a presentation-specific variant that is fixed-position and auto-updates on navigation.
|
|
47
|
+
|
|
48
|
+
### 1.8 `toast(message, variant:, duration:)`
|
|
49
|
+
- **Props:** `message:` (string), `variant:` (:info | :success | :warning | :error), `duration:` (integer, milliseconds, default 3000)
|
|
50
|
+
- **Renders:** Temporary notification that slides up from bottom or down from top, then auto-dismisses. Used for save confirmations, generation timeouts, errors.
|
|
51
|
+
- **Extends/Inspired by:** New component. Could build on `alert` component but with auto-dismiss behavior and fixed positioning.
|
|
52
|
+
|
|
53
|
+
### 1.9 `image_block(src, **options)`
|
|
54
|
+
- **Props:** `src:` (string, file path or URL), `alt:` (string), `caption:` (string, optional), `base64:` (boolean, for export mode)
|
|
55
|
+
- **Renders:** Image with optional caption. Handles local file paths via asset serving endpoint. In export mode, inlines as base64 data URI.
|
|
56
|
+
- **Extends/Inspired by:** New component. StreamWeaver's Rack server can serve static assets; this wraps that with proper MIME types and export support.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 2. Design Deck Components
|
|
61
|
+
|
|
62
|
+
### 2.1 `design_deck(title, &block)`
|
|
63
|
+
- **Props:** `title:` (string), block containing `slide` calls
|
|
64
|
+
- **Renders:** Top-level deck container. Initializes slide navigation in :swap mode. Creates session for selection tracking. Adds footer with layout toggle and theme shortcut label.
|
|
65
|
+
- **Notes:** Orchestrator component. Validates no duplicate slide IDs, no "summary" ID. Ensures only one active deck.
|
|
66
|
+
|
|
67
|
+
### 2.2 `deck_slide(id, title, **options, &block)`
|
|
68
|
+
- **Props:** `id:` (string, unique), `title:` (string), `context:` (string, optional), `columns:` (1|2|3|4, optional auto-detect)
|
|
69
|
+
- **Renders:** A single decision slide with title, optional context text, and a grid of option cards. Grid columns auto-detected from option count unless overridden.
|
|
70
|
+
- **Notes:** Child block contains `option` calls.
|
|
71
|
+
|
|
72
|
+
### 2.3 `deck_option(label, **options, &block)`
|
|
73
|
+
- **Props:** `label:` (string, required), `description:` (string, optional hover text), `aside:` (string, optional text below preview), `recommended:` (boolean, default false)
|
|
74
|
+
- **Renders:** Option card with: radio indicator, label header, preview content (from block), aside text, notes textarea. Click-to-select behavior. ARIA: `role="radio"`, `aria-checked`.
|
|
75
|
+
- **Notes:** Block contains mermaid, code_block, image_block, or raw HTML calls that stack vertically as the option's preview.
|
|
76
|
+
|
|
77
|
+
### 2.4 `deck_summary`
|
|
78
|
+
- **Props:** Auto-generated (no explicit props)
|
|
79
|
+
- **Renders:** Final slide showing grid of summary cards for each slide: selected option label, preview thumbnail (first block truncated), aside text (120 char max), user notes. Final notes textarea. Submit button gated on complete selections ("Still need: X, Y"). After submit: "Submitted" state.
|
|
80
|
+
- **Notes:** Automatically appended as last slide. Reads from deck selection state.
|
|
81
|
+
|
|
82
|
+
### 2.5 `generate_more_controls(**options)`
|
|
83
|
+
- **Props:** `on_generate:` (callback), `max_count:` (integer, default 3)
|
|
84
|
+
- **Renders:** Prompt input, count dropdown (1-3), "Generate" button, "Regenerate all" button. Loading states: button spinner, disabled inputs during generation.
|
|
85
|
+
- **Notes:** Triggers callback to agent. Works with SSE push (Pushable) for receiving new options.
|
|
86
|
+
|
|
87
|
+
### 2.6 `skeleton_placeholder(count:)`
|
|
88
|
+
- **Props:** `count:` (integer, how many placeholders)
|
|
89
|
+
- **Renders:** Placeholder cards with shimmer animation (linear-gradient background-position 1.5s infinite). Same dimensions as option cards. Removed and replaced when real options arrive via SSE.
|
|
90
|
+
- **Extends/Inspired by:** New component. Could extend `card` with a shimmer variant.
|
|
91
|
+
|
|
92
|
+
### 2.7 `model_selector(models:, **options)`
|
|
93
|
+
- **Props:** `models:` (array of model descriptors), `default_model:` (string, optional), `on_select:` (callback)
|
|
94
|
+
- **Renders:** Model bar below header: provider filter pills, model list, "Default" checkbox, thinking level pills (off/low/medium/high). Hidden when fewer than 2 models.
|
|
95
|
+
- **Notes:** Deck-specific UI. Selection affects generate-more requests.
|
|
96
|
+
|
|
97
|
+
### 2.8 `confirmation_bar(message, **options)`
|
|
98
|
+
- **Props:** `message:` (string), `confirm_label:` (string), `cancel_label:` (string), `auto_hide:` (integer, seconds, default 5)
|
|
99
|
+
- **Renders:** Fixed top bar that slides down with confirm/cancel buttons. Auto-hides after timeout. Used for cancel confirmation.
|
|
100
|
+
|
|
101
|
+
### 2.9 `close_overlay(status, message)`
|
|
102
|
+
- **Props:** `status:` (:submitted | :cancelled | :stale | :aborted), `message:` (string)
|
|
103
|
+
- **Renders:** Full-screen overlay with backdrop blur. Color-coded by status (green/amber/red). Auto-closes tab after 800ms.
|
|
104
|
+
|
|
105
|
+
### 2.10 `layout_toggle`
|
|
106
|
+
- **Props:** None (reads/writes to state)
|
|
107
|
+
- **Renders:** Footer buttons (1/2/3/4) for overriding grid column count. Persisted to state. Applied via `data-layout` attribute on the slide container.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 3. Visual Explainer Components
|
|
112
|
+
|
|
113
|
+
### 3.1 `ve_card(**options, &block)`
|
|
114
|
+
- **Props:** `depth:` (:hero | :elevated | :default | :recessed | :glass), `accent:` (:a | :b | :c, for colored left border), `label:` (string, monospace uppercase with dot)
|
|
115
|
+
- **Renders:** Card container with depth-tier styling. Hero = accent-tinted background + elevated shadow. Elevated = subtle shadow. Default = flat with border. Recessed = inset shadow. Glass = transparent + backdrop blur.
|
|
116
|
+
- **Extends/Inspired by:** StreamWeaver `card` component. Adds depth tiers and accent variants.
|
|
117
|
+
|
|
118
|
+
### 3.2 `kpi_dashboard(metrics:)`
|
|
119
|
+
- **Props:** `metrics:` (array of `{ value:, label:, color:, trend: }`)
|
|
120
|
+
- **Renders:** Auto-fit grid row of KPI cards. Each card has large value text (animatable via CSS counter), label, optional trend indicator. fadeScale entry animation.
|
|
121
|
+
- **Extends/Inspired by:** StreamWeaver `stat_display` component. Wraps multiple stat_displays in a KPI grid layout with animation.
|
|
122
|
+
|
|
123
|
+
### 3.3 `data_table(headers:, rows:, **options)`
|
|
124
|
+
- **Props:** `headers:` (array of strings), `rows:` (array of arrays), `sticky_header:` (boolean, default true), `alternating:` (boolean, default true), `hover:` (boolean, default true), `scrollable:` (boolean, default true)
|
|
125
|
+
- **Renders:** Styled HTML table with sticky header, alternating row backgrounds, row hover highlighting. Wrapped in scrollable container for wide tables. Status badges rendered as styled spans.
|
|
126
|
+
- **Extends/Inspired by:** StreamWeaver `table` component already exists. Needs enhancement for sticky headers, alternating rows, hover highlighting, and scrollable container.
|
|
127
|
+
|
|
128
|
+
### 3.4 `pipeline(steps:)`
|
|
129
|
+
- **Props:** `steps:` (array of `{ label:, description:, status: }`)
|
|
130
|
+
- **Renders:** Horizontal step flow with arrow connectors between steps. Each step is a card. Responsive: arrows hidden on mobile, collapses to vertical.
|
|
131
|
+
- **Extends/Inspired by:** New component. No existing StreamWeaver equivalent.
|
|
132
|
+
|
|
133
|
+
### 3.5 `comparison(before:, after:, **options)`
|
|
134
|
+
- **Props:** `before:` (block or content), `after:` (block or content), `before_label:` (string), `after_label:` (string)
|
|
135
|
+
- **Renders:** Side-by-side diff panels with labeled headers (before=red tint, after=green tint). Responsive: stacks vertically on mobile.
|
|
136
|
+
- **Extends/Inspired by:** New component. `hstack` with 2 children could approximate but lacks the visual diff treatment.
|
|
137
|
+
|
|
138
|
+
### 3.6 `sidebar_toc(sections:)`
|
|
139
|
+
- **Props:** `sections:` (array of `{ id:, label: }`)
|
|
140
|
+
- **Renders:** Desktop: sticky 170px sidebar column with scroll spy via IntersectionObserver. Active section highlighted with accent border. Mobile (<1000px): horizontal scrollable sticky bar at top. Smooth scroll on click with URL hash update.
|
|
141
|
+
- **Extends/Inspired by:** StreamWeaver has `navbar` but not a scroll-spy sidebar. New component.
|
|
142
|
+
|
|
143
|
+
### 3.7 `chart(type:, data:, **options)`
|
|
144
|
+
- **Props:** `type:` (:bar | :line | :pie | :doughnut | :radar), `data:` (Chart.js data object), `options:` (Chart.js options), `height:` (integer)
|
|
145
|
+
- **Renders:** Chart.js chart. Dark mode aware (reads prefers-color-scheme for text/grid colors). Reads CSS custom properties for font family.
|
|
146
|
+
- **Extends/Inspired by:** New component. Loads Chart.js from CDN.
|
|
147
|
+
|
|
148
|
+
### 3.8 `callout(variant:, &block)`
|
|
149
|
+
- **Props:** `variant:` (:info | :warning | :success | :tip), `title:` (string, optional)
|
|
150
|
+
- **Renders:** Box with colored left border and optional icon. Info=blue, warning=amber, success=green, tip=purple.
|
|
151
|
+
- **Extends/Inspired by:** StreamWeaver `alert` component. Similar concept but `callout` is inline content (not dismissible banner). Could be a variant of alert or a separate component.
|
|
152
|
+
|
|
153
|
+
### 3.9 `code_file(file:, code:, lang:)`
|
|
154
|
+
- **Props:** `file:` (string, file path), `code:` (string), `lang:` (string)
|
|
155
|
+
- **Renders:** Code block with a distinct file header showing the path. Header has different background from code body. Scrollable body.
|
|
156
|
+
- **Extends/Inspired by:** Variant of shared `code_block` with `file:` option. May be just `code_block(code, file: "src/app.rb", lang: "ruby")`.
|
|
157
|
+
|
|
158
|
+
### 3.10 `dir_tree(tree:)`
|
|
159
|
+
- **Props:** `tree:` (string, pre-formatted directory tree text)
|
|
160
|
+
- **Renders:** Pre-formatted file tree in monospace font. Color-coded new/modified/deleted files.
|
|
161
|
+
- **Extends/Inspired by:** New component. Could use `code_block` with custom styling but the color-coding is file-tree-specific.
|
|
162
|
+
|
|
163
|
+
### 3.11 `flow_arrow(label:)`
|
|
164
|
+
- **Props:** `label:` (string, optional)
|
|
165
|
+
- **Renders:** Vertical arrow with SVG icon and optional label. Used between cards to show flow/sequence.
|
|
166
|
+
- **Extends/Inspired by:** New component.
|
|
167
|
+
|
|
168
|
+
### 3.12 `prose(**options, &block)`
|
|
169
|
+
- **Props:** `width:` (:narrow | :default | :wide), `dropcap:` (boolean, default false)
|
|
170
|
+
- **Renders:** Reading-optimized text container with appropriate max-width, line-height, and font sizing. Dropcap option for opening paragraph.
|
|
171
|
+
- **Extends/Inspired by:** StreamWeaver `text` and `md` components. This adds magazine-style typography treatment.
|
|
172
|
+
|
|
173
|
+
### 3.13 `pullquote(text, **options)`
|
|
174
|
+
- **Props:** `text:` (string), `attribution:` (string, optional), `centered:` (boolean, default false)
|
|
175
|
+
- **Renders:** Highlighted quote with large font, accent border or decorative quotation mark. Optional attribution line.
|
|
176
|
+
- **Extends/Inspired by:** New component.
|
|
177
|
+
|
|
178
|
+
### 3.14 `hero_section(**options, &block)`
|
|
179
|
+
- **Props:** `variant:` (:centered | :editorial), `depth:` (:hero, forced)
|
|
180
|
+
- **Renders:** Page header area with hero-depth styling. Centered variant for titles; editorial variant for asymmetric layout with large display text.
|
|
181
|
+
- **Extends/Inspired by:** StreamWeaver `app_header`. Needs enhancement for hero depth styling and editorial variant.
|
|
182
|
+
|
|
183
|
+
### 3.15 `legend(items:)`
|
|
184
|
+
- **Props:** `items:` (array of `{ color:, label: }`)
|
|
185
|
+
- **Renders:** Horizontal legend bar with color swatches and labels. For explaining color coding in diagrams or tables.
|
|
186
|
+
- **Extends/Inspired by:** New component.
|
|
187
|
+
|
|
188
|
+
### 3.16 `sparkline(data:)`
|
|
189
|
+
- **Props:** `data:` (array of numbers), `color:` (string, optional)
|
|
190
|
+
- **Renders:** Inline SVG `<polyline>` showing a mini trend line. For use within table cells or KPI cards.
|
|
191
|
+
- **Extends/Inspired by:** New component.
|
|
192
|
+
|
|
193
|
+
### 3.17 `status_indicator(status, **options)`
|
|
194
|
+
- **Props:** `status:` (:match | :gap | :partial | :info | :warn), `label:` (string, optional)
|
|
195
|
+
- **Renders:** Colored dot + optional label. Colors match semantic meaning.
|
|
196
|
+
- **Extends/Inspired by:** StreamWeaver `status_dot` and `status_badge` components. May need additional status values.
|
|
197
|
+
|
|
198
|
+
### 3.18 `inner_grid(columns:, &block)`
|
|
199
|
+
- **Props:** `columns:` (integer, default 2)
|
|
200
|
+
- **Renders:** 2-column (or N-column) grid within a section card. For sub-layouts within a card.
|
|
201
|
+
- **Extends/Inspired by:** StreamWeaver `grid` component used in a nested context. May not need a separate component if `grid` supports nesting well.
|
|
202
|
+
|
|
203
|
+
### 3.19 `theme_preset(name:)`
|
|
204
|
+
- **Props:** `name:` (symbol -- one of the curated presets)
|
|
205
|
+
- **Renders:** No visible output. Sets CSS custom properties for fonts, colors, and surface styling according to a named preset. Presets include font pairing + color palette combinations.
|
|
206
|
+
- **Extends/Inspired by:** New infrastructure component. Works with the theme system.
|
|
207
|
+
- **Presets to define (initial set):**
|
|
208
|
+
- `:editorial` -- Instrument Serif + JetBrains Mono, Terracotta + sage
|
|
209
|
+
- `:technical` -- DM Sans + Fira Code, Teal + slate
|
|
210
|
+
- `:warm` -- Fraunces + Source Code Pro, Amber + emerald
|
|
211
|
+
- `:minimal` -- Outfit + Space Mono, Deep blue + gold
|
|
212
|
+
- `:terminal` -- IBM Plex Sans + IBM Plex Mono, Rose + cranberry
|
|
213
|
+
- Plus slide-specific: Midnight Editorial, Warm Signal, Terminal Mono, Swiss Clean
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 4. Existing StreamWeaver Components That Need Enhancement
|
|
218
|
+
|
|
219
|
+
### 4.1 `card` -- Add Depth Tiers
|
|
220
|
+
- **Current:** Basic card with header/body/footer
|
|
221
|
+
- **Needs:** `depth:` option (:hero, :elevated, :default, :recessed, :glass). `accent:` option for colored left border. Integration with CSS custom properties for surface colors and shadows.
|
|
222
|
+
|
|
223
|
+
### 4.2 `table` -- Add Data Table Features
|
|
224
|
+
- **Current:** Basic table rendering from data/headers/rows
|
|
225
|
+
- **Needs:** Sticky header option. Alternating row backgrounds. Row hover highlighting. Scrollable container wrapper for wide tables. Status indicator rendering within cells (styled spans, not emoji).
|
|
226
|
+
|
|
227
|
+
### 4.3 `grid` -- Add Auto-Column Detection
|
|
228
|
+
- **Current:** `grid(columns:, gap:)` with explicit column count
|
|
229
|
+
- **Needs:** `auto_columns: true` mode that detects optimal column count from child count (1->1, 2|4->2, 3+->3). Responsive collapse breakpoints. `data-layout` override support for manual toggle.
|
|
230
|
+
|
|
231
|
+
### 4.4 `alert` -- Relate to Callout
|
|
232
|
+
- **Current:** Dismissible alert banner
|
|
233
|
+
- **Needs:** Consider whether `callout` (inline, not dismissible, colored left border) is a variant of alert or a separate component. If variant, add `inline: true` option.
|
|
234
|
+
|
|
235
|
+
### 4.5 `stat_display` -- Enhance for KPI Dashboard
|
|
236
|
+
- **Current:** Single metric card
|
|
237
|
+
- **Needs:** Integration with `kpi_dashboard` wrapper for auto-fit grid layout. CSS counter animation for numbers. fadeScale entry animation with stagger.
|
|
238
|
+
|
|
239
|
+
### 4.6 `collapsible` -- Add Styled Chevron
|
|
240
|
+
- **Current:** Basic expandable section
|
|
241
|
+
- **Needs:** Styled disclosure chevron (rotates on open/close). Integration with the visual-explainer's `.collapsible` CSS pattern.
|
|
242
|
+
|
|
243
|
+
### 4.7 `progress_bar` -- Add Presentation Variant
|
|
244
|
+
- **Current:** Inline progress bar with value/max
|
|
245
|
+
- **Needs:** Fixed-position variant for slide navigation. Auto-updates via state binding. Width transition animation.
|
|
246
|
+
|
|
247
|
+
### 4.8 `radio_group` -- Enhance for Deck Selection
|
|
248
|
+
- **Current:** Basic radio button group
|
|
249
|
+
- **Needs:** Card-based radio metaphor where entire card is clickable. Visual indicators: accent border on selection, checkmark badge with pop animation, radio dot fill. ARIA: `role="radiogroup"` on container, `role="radio"` + `aria-checked` on cards. Number key quick-select (1-9).
|
|
250
|
+
|
|
251
|
+
### 4.9 `app_header` -- Add Hero Variant
|
|
252
|
+
- **Current:** Page header with title, subtitle, variant
|
|
253
|
+
- **Needs:** Hero-depth variant with accent-tinted background and elevated shadow. Editorial variant for asymmetric layout.
|
|
254
|
+
|
|
255
|
+
### 4.10 `navbar` -- Relate to Sidebar TOC
|
|
256
|
+
- **Current:** Navigation bar with nav items
|
|
257
|
+
- **Needs:** Consider whether `sidebar_toc` (sticky sidebar, scroll spy, mobile horizontal bar) shares infrastructure with navbar or is a completely separate component. At minimum, the `nav_item(active:)` pattern is shared.
|
|
258
|
+
|
|
259
|
+
### 4.11 Theme Module -- Major Enhancement
|
|
260
|
+
- **Current:** Dark/light theme support
|
|
261
|
+
- **Needs:**
|
|
262
|
+
- Auto mode (follows OS `prefers-color-scheme`)
|
|
263
|
+
- Manual toggle with configurable keyboard shortcut
|
|
264
|
+
- localStorage persistence of override
|
|
265
|
+
- CSS custom property vocabulary: `--bg`, `--surface`, `--surface-elevated`, `--border`, `--border-bright`, `--text`, `--text-dim`, `--accent`, `--accent-dim`, semantic node colors (`--node-a/b/c`), status colors (`--green`, `--red`, `--orange`)
|
|
266
|
+
- `<meta name="theme-color">` management
|
|
267
|
+
- Preset system for curated font+color combinations
|
|
268
|
+
- Anti-slop color validation (warn on forbidden colors in development)
|
|
269
|
+
|
|
270
|
+
### 4.12 AlpineJS Adapter -- SSE Integration
|
|
271
|
+
- **Current:** Client-side reactivity via AlpineJS
|
|
272
|
+
- **Needs:** Integration with SSE push for generate-more flow. When server pushes new options via Pushable/SSE, Alpine should reactively update the DOM (add option cards, remove skeletons). This may already work via StreamWeaver's existing reactivity model, but needs validation for the deck's specific push patterns.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## 5. Implementation Priority
|
|
277
|
+
|
|
278
|
+
### Phase 1: Shared Foundation (Highest Value)
|
|
279
|
+
1. `mermaid` component (both projects need this first)
|
|
280
|
+
2. `code_block` component (both projects need this)
|
|
281
|
+
3. Theme module enhancements (CSS custom properties, auto mode, presets)
|
|
282
|
+
4. `keyboard_shortcuts` system
|
|
283
|
+
5. `html_export` pipeline
|
|
284
|
+
|
|
285
|
+
### Phase 2: Design Deck Core
|
|
286
|
+
6. `design_deck` + `deck_slide` + `deck_option` (the deck shell)
|
|
287
|
+
7. `radio_group` enhancement for card-based selection
|
|
288
|
+
8. `deck_summary` auto-generated slide
|
|
289
|
+
9. `slide_container` in :swap mode
|
|
290
|
+
10. `generate_more_controls` + `skeleton_placeholder`
|
|
291
|
+
11. `confirmation_bar` + `close_overlay`
|
|
292
|
+
|
|
293
|
+
### Phase 3: Visual Explainer Core
|
|
294
|
+
12. `ve_card` with depth tiers (or enhance existing `card`)
|
|
295
|
+
13. `data_table` enhancements to existing `table`
|
|
296
|
+
14. `sidebar_toc` with scroll spy
|
|
297
|
+
15. `kpi_dashboard` wrapping enhanced `stat_display`
|
|
298
|
+
16. `comparison` (diff panels)
|
|
299
|
+
17. `pipeline` (step flow)
|
|
300
|
+
18. `chart` (Chart.js integration)
|
|
301
|
+
|
|
302
|
+
### Phase 4: Polish
|
|
303
|
+
19. `theme_preset` system with curated presets
|
|
304
|
+
20. `slide_container` in :scroll_snap mode
|
|
305
|
+
21. `prose`, `pullquote`, `hero_section`
|
|
306
|
+
22. `toast` notifications
|
|
307
|
+
23. `model_selector`
|
|
308
|
+
24. `save/load` deck snapshot system
|
|
309
|
+
25. Animation choreography (staggered reveals, fadeScale, etc.)
|
|
310
|
+
26. `dir_tree`, `flow_arrow`, `legend`, `sparkline`
|
|
311
|
+
|
|
312
|
+
### Phase 5: Agent Integration
|
|
313
|
+
27. Slash command framework for StreamWeaver skills
|
|
314
|
+
28. Data gathering workflow templates
|
|
315
|
+
29. Verification checkpoint system
|
|
316
|
+
30. Auto-trigger detection for complex tables
|
|
317
|
+
31. Share/deploy integration
|