Add comprehensive bilingual documentation system with live views#8
Open
Add comprehensive bilingual documentation system with live views#8
Conversation
8-stage plan covering documentation infrastructure, bilingual i18n (Japanese/English), automated screenshot capture, workflow diagrams, and cross-reference system for the entire Oroshi wholesale management site. https://claude.ai/code/session_01BRR9VwvNKS1p7sPJKUt1Rb
…pport Complete documentation system served as Rails views with: Infrastructure: - DocumentationController with section/page routing - DocumentationHelper with cross-reference, diagram, step, callout helpers - Dedicated documentation layout with sidebar navigation and search - Stimulus controllers for search and Mermaid.js diagram rendering - 441 bilingual i18n keys (JA/EN) with verified symmetry Content (7 sections, 36 view templates): - Getting Started: first login, navigation, onboarding wizard - Orders: 1-2 click creation, templates, lifecycle, bundling, search, dashboard tabs - Supply Chain: intake, suppliers, supply types, check sheets - Production: zones, requests, factory floor schedules - Shipping: methods, receptacles, shipping dashboard - Financials: revenue tracking, profit calculation, payments, invoices, materials - Admin: company setup, buyer/product/user management Quality: - Controller test covering all pages in both locales - i18n symmetry test verifying JA/EN key parity - Japanese quality review (terminology consistency, kanji accuracy) - English review (grammar, terminology, formula accuracy) - Cross-references between related documentation pages - Mermaid workflow diagrams for key processes https://claude.ai/code/session_01BRR9VwvNKS1p7sPJKUt1Rb
…and bug fixes - Add documentation help link (?) to main navbar for global docs access - Add contextual documentation_help_link to key views: orders dashboard, order search, supply calendar, payment receipts, materials, invoices, dashboard home, and dashboard navigation - Enhance documentation search with keyboard navigation (arrow keys, Enter, Escape), section badge indicators, and click-outside dismiss - Create docs:verify rake task for comprehensive documentation validation (view files, locale keys, key symmetry, cross-references, YAML validity) - Fix supply_chain/index view referencing nonexistent diagram_*/data_flow_item_* locale keys (now correctly uses flow_* keys) https://claude.ai/code/session_01BRR9VwvNKS1p7sPJKUt1Rb
Pass translated no_results string from layout to Stimulus controller via data value attribute. Adds chrome.no_results key to both JA/EN locale files (442 keys each now). https://claude.ai/code/session_01BRR9VwvNKS1p7sPJKUt1Rb
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.
Summary
This PR introduces a complete end-user documentation system for Oroshi, transforming the codebase from having only developer-facing docs to providing rich, bilingual (Japanese/English) user guides. Documentation is served as live Rails views rather than static files, enabling automatic screenshot capture, cross-references, and maintainability.
Key Changes
Documentation Controller & Routes: Added
Oroshi::DocumentationControllerwith routes for index, section, and page views. Supports locale switching via URL parameters.Bilingual Content: Created comprehensive i18n locale files (
documentation.ja.yml,documentation.en.yml) covering 7 sections with 30+ pages of user-facing documentation.Documentation Views: Built 30+ ERB templates organized by section (Getting Started, Orders, Supply Chain, Production, Shipping, Financials, Admin) with consistent layout and navigation.
Documentation Layout: New dedicated
documentation.html.erblayout with:Helper Methods: Added
DocumentationHelperwith utilities for:doc_link_to()— bilingual documentation linksdoc_see_also()— cross-reference listsdocumentation_help_link()— contextual help icons from main appStimulus Controllers:
documentation_search_controller.js— Real-time search across documentation pagesdocumentation_diagram_controller.js— Client-side Mermaid.js diagram renderingTesting Infrastructure:
DocumentationControllerTest— Verifies all pages render in both localesDocumentationI18nTest— Validates translation completenessdocs.rake— Verification tasks for view files, locale keys, and cross-referencesNavigation Integration: Added documentation link to main navbar and help icons to key pages (Orders, Supplies, Materials, Payments, Invoices).
Implementation Details
app/assets/images/docs/Files Added
app/controllers/oroshi/documentation_controller.rbapp/helpers/oroshi/documentation_helper.rbapp/views/layouts/documentation.html.erbapp/views/oroshi/documentation/— 30+ view templatesapp/javascript/controllers/documentation_*.js— 2 Stimulus controllersconfig/locales/documentation.{ja,en}.yml— Bilingual contentlib/tasks/docs.rake— Verification and maintenance taskstest/controllers/oroshi/documentation_controller_test.rbtest/i18n/documentation_i18n_test.rbFiles Modified
config/routes.rb— Added documentation routesapp/views/layouts/shared/_navbar.html.erb— Added documentation linkapp/views/oroshi/orders/index.html.erb— Added help linkapp/views/oroshi/orders/search.html.erb— Added help linkapp/views/oroshi/supplies/index.html.erb— Added help linkapp/views/oroshi/payment_receipts/index.html.erb— Added help linkapp/views/oroshi/materials/index.html.erb— Added help linkapp/views/oroshi/dashboard/index.html.erb— Minor layout adjustmentapp/views/oroshi/dashboard/_home.html.erb— Minor layout adjustmenthttps://claude.ai/code/session_01BRR9VwvNKS1p7sPJKUt1Rb