Skip to content

Add reusable content snippets - #21

Merged
ruibaby merged 8 commits into
mainfrom
feat/content-snippets
Oct 27, 2026
Merged

ruibaby merged 8 commits into
mainfrom
feat/content-snippets

Conversation

@ruibaby

@ruibaby ruibaby commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a ContentSnippet custom model and generated API client for reusable rich-text snippets.
  • Add management pages for creating, editing, searching, and deleting snippets.
  • Integrate snippets with Halo's default editor through slash commands, the toolbox, and a selection bubble action for saving selected content.
  • Preserve HTML formatting when saving and inserting snippets, and provide responsive desktop and mobile layouts.
  • Configure the local development server on port 8091.

Behavior

  • Snippets are inserted as HTML snapshots; later snippet edits do not change content already inserted into posts.
  • Saving a selection does not alter the current post.
  • Custom model APIs use Halo's default authorization; no additional role templates are introduced.

Validation

  • pnpm --dir ui type-check
  • ./gradlew clean build --offline
  • git diff --check
  • Manually verified on Halo 2.26.0 with desktop and 390x844 mobile viewports:
    • snippet CRUD and search;
    • slash-command and toolbox insertion;
    • selection snapshots with multiple paragraphs, bold text, and links;
    • original post preservation and snippet reinsertion;
    • empty and whitespace validation, cancel, failure/retry, and double-click handling;
    • save modal accessibility with zero axe violations.

Known validation limitation

Targeted ESLint was attempted but remains blocked by missing UnoCSS rule definitions in the existing repository configuration: @unocss/enforce-class-compile, @unocss/order, and @unocss/order-attributify.

@ruibaby
ruibaby merged commit 1b6a0d9 into main Oct 27, 2026
1 check 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