Skip to content

feat(shell): integrate localized plugin help chapters - #153

Merged
cattan0710-tech merged 4 commits into
mainfrom
feat/plugin-help-chapters-126
Nov 29, 2026
Merged

cattan0710-tech merged 4 commits into
mainfrom
feat/plugin-help-chapters-126

Conversation

@imneov

@imneov imneov commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • feature
  • documentation

What this PR does and why

Canary currently injects localized help documents and illustrations into a dedicated Console build. Remote plugin delivery needs the same help-center integration without rebuilding Console.

  • Add optional SDK helpChapters contributions with English and Chinese Markdown, stable chapter slugs, and an optional UI permission.
  • Render plugin chapters in the existing help directory and direct routes. Registering canary preserves /help/docs/canary.
  • Resolve relative illustrations beneath the installed plugin entry directory. Reject traversal paths, invalid declarations, built-in collisions, and duplicate registrations.
  • Apply the same UI permission and backend read-capability checks to navigation and direct URLs, including loading, failed, and unconfigured states.
  • Roll back failed registrations without removing other plugins' chapters. Reject help-bearing bundles explicitly when the host lacks help support.
  • Document packaging, compatibility, refresh/upgrade behavior, responsibility boundaries, and remaining acceptance for all four original requirements in the integration design.

The renderer already imports highlight.js; declare it as a direct dependency rather than relying on a transitive installation. Extract the built-in chapter list so plugin registration does not eagerly load built-in Markdown.

Which issue(s) this PR fixes

Refs #126. This implements the missing host help mechanism, not the entire Canary migration, so merging it must not close #126.

Related work: #143 and #152 provide the existing plugin runtime and host extensions; #149 / #151 track resource-action data and independent action policies; modelsphere/console-canary-plugin#11 tracks the companion remote package. #148 remains deferred.

How it was tested

  • pnpm --dir web typecheck — passed.
  • pnpm --dir web test — 93 files, 868 tests passed.
  • pnpm --dir web build — passed; bundle-size warning remains.
  • pnpm --dir web/packages/plugin-sdk typecheck — passed.
  • pnpm --dir web/packages/plugin-sdk test — 13 files, 190 tests passed.
  • git diff --check — passed.

Regression tests cover localized help, the existing chapter URL shape, relative images, permissions and stale capabilities, unsupported hosts, invalid/duplicate declarations, partial registration rollback, and replacement/restoration of bundled content. SDK tests first reproduced the absent registration and compatibility checks.

Checks

  • Web typecheck, tests, and production build pass using the scripts above.
  • Docs updated for the SDK contract and packaging behavior.
  • No internal hostnames, IPs, registries, or credentials added.

Go and chart checks are not applicable: neither Go nor chart files change.

Notes for reviewers

  • Start with docs/design/canary-plugin-integration.md, then the SDK bridge, chapter registry, permission-filtered help hook, and runtime cleanup.
  • The extension mechanism remains host-defined placements plus plugin-owned data and presentation; no Canary-specific runtime or new deployment configuration is introduced.
  • Actual Canary Markdown/images still need to be packaged and registered by the consumer. Published-package delivery, authenticated backend access, real service relationships, and independent installation/upgrade/rollback acceptance remain open in plugins: preserve Canary integration during remote-plugin migration #126.
  • Local code, React, and TypeScript reviews found no actionable issues. These reviews do not replace GitHub maintainer approval.

Release note

Plugins can contribute localized, permission-aware help chapters and illustrations to Console's help center.

Refs #126. SDK RED: the two help-registration regressions fail because createPlugin ignores helpChapters and does not reject an unsupported host. Web regression execution also exposed the existing undeclared highlight.js import; resolve that direct dependency before validating the host RED target.
Refs #126. Reuse SDK registration and the existing help renderer for bundled English/Chinese chapters, permission-aware direct URLs, release-relative illustrations and rollback. The original chapter slug can preserve existing help links. GREEN: 35 host/docs tests and 39 SDK core tests pass. Declare the renderer existing highlight.js import as a direct dependency for strict dependency resolution.
Refs #126. Document the English requirements, localized content and image contract, permission/lifecycle behavior, and cross-repository acceptance boundary. Keep the static chapter IDs separate so SDK registration does not eagerly load help content. The 35 host/docs regressions remain green.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T03:07:29.587084Z 94cd101 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

cattan0710-tech

This comment was marked as duplicate.

@cattan0710-tech
cattan0710-tech self-requested a review November 29, 2026 13:51

@cattan0710-tech cattan0710-tech left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@cattan0710-tech
cattan0710-tech merged commit c8dda9d into main Nov 29, 2026
5 checks passed
@cattan0710-tech
cattan0710-tech deleted the feat/plugin-help-chapters-126 branch November 29, 2026 13:52
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.

plugins: preserve Canary integration during remote-plugin migration

2 participants