Skip to content

Add comprehensive bilingual documentation system with live views#8

Open
cmbaldwin wants to merge 4 commits intomasterfrom
claude/comprehensive-site-documentation-p9YON
Open

Add comprehensive bilingual documentation system with live views#8
cmbaldwin wants to merge 4 commits intomasterfrom
claude/comprehensive-site-documentation-p9YON

Conversation

@cmbaldwin
Copy link
Copy Markdown
Owner

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::DocumentationController with 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.erb layout with:

    • Collapsible sidebar navigation
    • Breadcrumb trails
    • Language toggle (日本語/English)
    • Client-side full-text search via Stimulus controller
    • Responsive design for desktop and tablet
  • Helper Methods: Added DocumentationHelper with utilities for:

    • doc_link_to() — bilingual documentation links
    • doc_see_also() — cross-reference lists
    • documentation_help_link() — contextual help icons from main app
  • Stimulus Controllers:

    • documentation_search_controller.js — Real-time search across documentation pages
    • documentation_diagram_controller.js — Client-side Mermaid.js diagram rendering
  • Testing Infrastructure:

    • DocumentationControllerTest — Verifies all pages render in both locales
    • DocumentationI18nTest — Validates translation completeness
    • docs.rake — Verification tasks for view files, locale keys, and cross-references
  • Navigation Integration: Added documentation link to main navbar and help icons to key pages (Orders, Supplies, Materials, Payments, Invoices).

Implementation Details

  • Documentation is served from authenticated routes (accessible to all logged-in users)
  • All content is i18n-driven, enabling seamless language switching
  • Views use consistent helper methods for cross-references and navigation
  • Locale files are fully structured with keys for all sections, pages, and UI chrome
  • Verification rake task ensures documentation integrity (view files exist, all locale keys present, cross-references valid)
  • Screenshots can be captured via system tests and stored in app/assets/images/docs/

Files Added

  • app/controllers/oroshi/documentation_controller.rb
  • app/helpers/oroshi/documentation_helper.rb
  • app/views/layouts/documentation.html.erb
  • app/views/oroshi/documentation/ — 30+ view templates
  • app/javascript/controllers/documentation_*.js — 2 Stimulus controllers
  • config/locales/documentation.{ja,en}.yml — Bilingual content
  • lib/tasks/docs.rake — Verification and maintenance tasks
  • test/controllers/oroshi/documentation_controller_test.rb
  • test/i18n/documentation_i18n_test.rb

Files Modified

  • config/routes.rb — Added documentation routes
  • app/views/layouts/shared/_navbar.html.erb — Added documentation link
  • app/views/oroshi/orders/index.html.erb — Added help link
  • app/views/oroshi/orders/search.html.erb — Added help link
  • app/views/oroshi/supplies/index.html.erb — Added help link
  • app/views/oroshi/payment_receipts/index.html.erb — Added help link
  • app/views/oroshi/materials/index.html.erb — Added help link
  • app/views/oroshi/dashboard/index.html.erb — Minor layout adjustment
  • app/views/oroshi/dashboard/_home.html.erb — Minor layout adjustment
  • `app/views/oroshi/invoices/index.html

https://claude.ai/code/session_01BRR9VwvNKS1p7sPJKUt1Rb

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants