Skip to content

Add tutorials for Modern Admin theme#1613

Merged
mambax7 merged 7 commits intoXOOPS:masterfrom
mambax7:master
Feb 17, 2026
Merged

Add tutorials for Modern Admin theme#1613
mambax7 merged 7 commits intoXOOPS:masterfrom
mambax7:master

Conversation

@mambax7
Copy link
Collaborator

@mambax7 mambax7 commented Feb 17, 2026

Summary

  • Add comprehensive User Guide (~450 lines) explaining all theme features for site administrators
  • Add comprehensive Developer & Designer Guide (~1100 lines) with architecture, recipes, and 19 Mermaid diagrams
  • All ASCII diagrams replaced with Mermaid for GitHub-native rendering

Documentation includes

User Guide (docs/USER_GUIDE.md):

  • Getting started, dashboard sections, dark mode, sidebar, customizer
  • Color presets, content tracking, layout options, module widgets
  • System info, keyboard tips, FAQ, reset instructions

Developer Guide (docs/DEVELOPER_GUIDE.md):

  • Architecture overview, file structure, request lifecycle
  • Template system, CSS design tokens, JavaScript architecture
  • Widget system (interface, discovery, deployment)
  • Data flow diagrams, 7 customization recipes
  • i18n, performance considerations, testing, compatibility

19 Mermaid diagrams covering:

  • End-to-end component interaction sequence
  • Template include hierarchy
  • CSS cascade strategy, dark mode toggle flow
  • Sidebar state machine, page layout structure
  • Script load order, widget discovery flowchart
  • Data flow (PHP → Smarty → JS), customizer interactions
  • Recipe workflows (color preset, new chart, widget deployment)
  • Language constant flow, query distribution

Test plan

  • Verify Mermaid diagrams render on GitHub PR preview
  • Verify internal links in table of contents work
  • Review accuracy of architecture descriptions against source code

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive Developer Guide for the Modern Admin Theme covering architecture, file organization, request lifecycle, templating, CSS architecture and design tokens (including dark mode and responsive behavior), JavaScript load order, widget system, data flow, customization recipes, performance, testing, compatibility, and development workflows with diagrams and examples.
    • Added a User Guide detailing theme activation, dashboard components, customizer, color presets, dark mode, sidebar behavior, widget management, module admin UX, troubleshooting, and reset procedures.

mambax7 and others added 4 commits February 17, 2026 07:06
- USER_GUIDE.md: Installation, dashboard features, dark mode, sidebar,
  customizer panel, color presets, content tracking, layout options,
  module widgets setup, system info, FAQ
- DEVELOPER_GUIDE.md: Architecture overview, request lifecycle, template
  system, CSS design tokens, JS architecture, widget system internals,
  data flow diagrams, customization recipes (new colors, charts, sidebar
  sections, SVG icons, header elements), i18n, performance notes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert all 7 ASCII art diagrams to Mermaid for better GitHub rendering:
- Architecture overview → block-beta
- Request lifecycle → flowchart
- Widget discovery process → flowchart
- Widget template rendering → graph
- PHP→Smarty→JS data flow → sequence diagram
- Customizer→Charts interaction → sequence diagram
- Customizer→CSS interaction → sequence diagram

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add CodeRabbit's end-to-end sequence diagram showing inter-component
communication during dashboard loading: Admin → Browser → Theme →
WidgetLoader → Module → Database → Chart.js. Placed in the Request
Lifecycle section as a complementary view to the existing flowchart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enrich the guide with visual diagrams throughout all major sections:

- Template hierarchy: graph showing theme.tpl → all partials tree
- CSS three-file strategy: flowchart of cascade layers
- Dark mode toggle flow: sequence from click → cookie → CSS vars → charts
- Sidebar state machine: desktop expanded/collapsed vs mobile hidden/overlay
- Page layout structure: block diagram of header/sidebar/main/footer
- Script load order: flowchart with dependency arrows
- Adding a color preset: 3-step workflow across files
- Adding a new chart: 4-step pipeline from PHP → template → JS
- Widget deployment: copy → cache clear → auto-discover flow
- Language constant flow: sequence from define() → Smarty → HTML
- Database query distribution: flowchart showing query counts per method

Total: 19 Mermaid diagrams (up from 9).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 17, 2026 12:34
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

Warning

Rate limit exceeded

@mambax7 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Adds two new documentation files for the Modern Admin Theme: a Developer Guide detailing architecture, templates, CSS/JS, widgets, data flow, customization, testing, and performance; and a User Guide covering activation, dashboard features, Customizer, dark mode, and admin workflows. No code changes.

Changes

Cohort / File(s) Summary
Modern Theme Documentation
htdocs/modules/system/themes/modern/docs/DEVELOPER_GUIDE.md, htdocs/modules/system/themes/modern/docs/USER_GUIDE.md
Introduces two comprehensive guides: Developer Guide (architecture, file structure, request lifecycle, Smarty/templates, CSS design tokens, JS load order, widget system, data flow, customization recipes, i18n, performance, testing, modification map) and User Guide (activation, dashboard components, Customizer, dark mode, sidebar, workflows). Documentation only; no functional/API changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add tutorials for Modern Admin theme' accurately and concisely describes the main changeset: comprehensive documentation (USER_GUIDE.md and DEVELOPER_GUIDE.md) for the Modern Admin theme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@htdocs/modules/system/themes/modern/docs/DEVELOPER_GUIDE.md`:
- Around line 555-562: The fenced code block listing functions (initCharts(),
initUserRegistrationChart(), initUserGroupChart(), initContentChart(),
rebuildContentChart(sel), updateChartsForTheme()) is missing a language
identifier; update the triple-backtick fence to include a language token (e.g.,
```text) so Markdownlint MD040 is satisfied and the snippet is correctly
recognized as plain text.
- Around line 570-573: The fenced code block listing applyColorScheme(theme) and
setCookie(name, val, days) lacks a language specifier which triggers
markdownlint MD040; update the block delimiter from ``` to specify a language
(for example ```text) so the snippet containing applyColorScheme and setCookie
is annotated (leave the contents unchanged), ensuring the MD block in
DEVELOPER_GUIDE.md is updated accordingly.
- Around line 284-295: Update the ordered list in DEVELOPER_GUIDE.md to use the
markdownlint MD029-compliant "1." prefix for every item: change the three list
item prefixes for "Create `xotpl/xo_mypartial.tpl`", "Include it in
`theme.tpl`", and "Assign any needed variables in `modern.php`" so they all
start with "1." rather than increasing numbers; keep the existing content and
code blocks unchanged.
- Around line 543-551: The fenced code block listing functions (initDarkMode,
initSidebarToggle, initHelpToggle, initMessages, setCookie, getCookie) lacks a
language identifier; update the block by adding a language tag such as "text" or
"txt" after the opening backticks (e.g., ```text) so Markdownlint MD040 is
satisfied, leaving the content and function names unchanged.
- Around line 1079-1088: The numbered list in DEVELOPER_GUIDE.md violates
markdownlint MD029 because items aren't sequential; update the four list
prefixes so they are sequential (1, 2, 3, 4) for the lines starting with "Create
`xotpl/xo_mypartial.tpl`", "Include it in `theme.tpl`...", "Assign any required
variables in `modern.php`", and "Clear Smarty cache after adding" so the list
numbers increment correctly and satisfy MD029.
- Around line 83-137: The fenced code block in DEVELOPER_GUIDE.md is missing a
language identifier (MD040); update the opening fence from ``` to something like
```text (or ```bash/```md as appropriate) so Markdownlint recognizes the block
language and stops flagging it; ensure any other fenced blocks in the same file
also include language identifiers.

In `@htdocs/modules/system/themes/modern/docs/USER_GUIDE.md`:
- Around line 269-272: The fenced code block in USER_GUIDE.md is missing a
language identifier (Markdownlint MD040); update the opening triple backticks to
include a language (e.g., ```text or ```bash) for the snippet that shows the
copy from/to paths referencing
modules/system/themes/modern/widgets/publisher/class/ModernThemeWidget.php and
modules/publisher/class/ModernThemeWidget.php so the block is properly linted.
- Around line 329-334: The sentence uses “again” twice in the same bullet pair;
edit the Modern theme help bullets to remove the duplicate by deleting the
redundant “again” in either “Click **Hide Help** to collapse it again” or “it
stays visible across pages until you hide it again” so the phrasing reads
smoothly (e.g., change the first to “Click **Hide Help** to collapse it” and
keep the persistence line as-is); update the USER_GUIDE.md bullets accordingly.
- Around line 392-405: The fenced code block listing config keys
(xoops_color_scheme, xoops_dark_mode, xoops_show_kpis, etc.) is missing a
language tag which triggers markdownlint MD040; update the block delimiter from
``` to ```text (or another appropriate language) so the block becomes a labeled
code fence containing the lines for xoops_color_scheme, xoops_dark_mode,
xoops_show_kpis, xoops_show_charts, xoops_show_widgets, xoops_show_system_info,
xoops_compact_sidebar, xoops_sidebar_icons, xoops_animations,
xoops_compact_view, xoops_content_modules, xoops_help_visible.

Comment on lines 1079 to 1088
1. Create `xotpl/xo_mypartial.tpl` with your Smarty markup
2. Include it in `theme.tpl` at the desired position:

```smarty
<{include file="$theme_tpl/xo_mypartial.tpl"}>
```

3. Assign any required variables in `modern.php`
4. Clear Smarty cache after adding

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix ordered list numbering to match lint rule.

Markdownlint MD029 expects sequential numbering; adjust the list prefixes.

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 1086-1086: Ordered list item prefix
Expected: 1; Actual: 3; Style: 1/2/3

(MD029, ol-prefix)


[warning] 1087-1087: Ordered list item prefix
Expected: 2; Actual: 4; Style: 1/2/3

(MD029, ol-prefix)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@htdocs/modules/system/themes/modern/docs/DEVELOPER_GUIDE.md` around lines
1079 - 1088, The numbered list in DEVELOPER_GUIDE.md violates markdownlint MD029
because items aren't sequential; update the four list prefixes so they are
sequential (1, 2, 3, 4) for the lines starting with "Create
`xotpl/xo_mypartial.tpl`", "Include it in `theme.tpl`...", "Assign any required
variables in `modern.php`", and "Clear Smarty cache after adding" so the list
numbers increment correctly and satisfy MD029.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-user and developer documentation for the Modern System admin theme, helping admins configure the theme and helping developers/designers understand and extend its architecture.

Changes:

  • Added a User Guide covering activation, dashboard features, customizer options, widgets, and troubleshooting.
  • Added a Developer & Designer Guide documenting theme architecture, file structure, widget system, and customization recipes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
htdocs/modules/system/themes/modern/docs/USER_GUIDE.md New administrator-focused usage and troubleshooting guide for the Modern admin theme.
htdocs/modules/system/themes/modern/docs/DEVELOPER_GUIDE.md New technical reference for theme internals, extension points, and customization workflows.

CodeRabbit (9 markdownlint fixes):
- Add language tags to 6 fenced code blocks (MD040): file structure,
  theme.js functions, charts.js functions, customizer.js functions,
  widget copy paths, cookie list
- Fix ordered list numbering to use 1. prefix (MD029) in both
  "Adding a Template Partial" sections

Copilot (2 content fixes):
- Correct "vanilla ES5" to "ES2015+" since scripts use const/let/arrows
- Rewrite contradictory IE11 sentence in Browser Support section
- Remove duplicate "again" in Help Sections bullets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@htdocs/modules/system/themes/modern/docs/USER_GUIDE.md`:
- Around line 409-441: Add a new FAQ entry under the "## Frequently Asked
Questions" section (near the existing troubleshooting items) titled "### Browser
requirements" that states this theme requires modern browsers, lists supported
browser families/versions generically, and explicitly notes that IE11 is not
supported (as referenced in the Developer Guide); keep the wording concise and
consistent with existing FAQ style and place it alongside other short Q&A items
like "Dark mode doesn't persist" and "Charts aren't showing".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

mambax7 and others added 2 commits February 17, 2026 07:55
Address CodeRabbit suggestion: add a FAQ item about browser
requirements mentioning modern browser support and no IE11.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix script load order: Chart.js is injected first, then jQuery
  (matches actual order in modern.php lines 57-69)
- Update PHP version: "tested through 8.5" (CI matrix includes 8.5)
- Fix Chart.js path in both guides: XOOPS_PATH/Frameworks/chartjs/
  served via browse.php, not xoops_lib/Frameworks/
- Update Mermaid diagram to reflect correct load order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@mambax7 mambax7 merged commit 2f8a808 into XOOPS:master Feb 17, 2026
7 of 10 checks passed
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.

1 participant