15 Commits

Author SHA1 Message Date
ManukMinasyan
bbba63c57b Fix styling 2026-03-31 21:31:05 +00:00
ilyapashayan
541d11ab90 fix: preserve mention data attributes through HTML sanitization
Filament's sanitizer strips data-id, data-label and data-char from
mention spans, breaking both display (unstyled @mention) and editing
(@-only shown in RichEditor). Register a package-scoped sanitizer that
explicitly allows these attributes on span elements.

Also fix double-replacement bug in renderBodyWithMentions() where both
the rich-editor regex and str_replace fallback could run on the same
mention, producing nested styled spans.
2026-04-01 01:10:05 +04:00
ilyapashayan
48fbd3c9d7 fix: use CSS variables for mention styling so dark mode and custom colors work 2026-03-30 19:20:50 +04:00
ilyapashayan
e7daa25fc2 fix: match mention styling exactly to RichEditor for custom primary color support 2026-03-30 19:17:40 +04:00
ilyapashayan
bff68f87a3 fix: render mentions by replacing spans directly instead of RichContentRenderer 2026-03-30 19:15:38 +04:00
ilyapashayan
583b49125f fix: add InteractsWithActions so RichEditor link toolbar works 2026-03-30 19:03:43 +04:00
ilyapashayan
5e44a4051a fix: eager load 2nd level replies so all nesting levels render correctly 2026-03-30 19:00:52 +04:00
ilyapashayan
812556cba2 fix: include replies in comment count and cascade delete to replies 2026-03-30 18:59:07 +04:00
ilyapashayan
20dba18e8e fix: show reply instantly after adding without page refresh 2026-03-30 18:48:11 +04:00
manukminasyan
a5bf29d6c2 fix: use gray badge color for comment count 2026-03-27 21:44:18 +04:00
manukminasyan
b44b4e309e fix: avoid lazy loading parent relationship in depth calculation
Use a query-based approach instead of traversing the parent relationship
to prevent LazyLoadingViolationException when strict mode is enabled.
2026-03-27 21:20:20 +04:00
manukminasyan
e173d9b4dd refactor: replace custom textarea with Filament RichEditor and built-in mentions
Replace the custom Alpine.js textarea + mention system with Filament v5's
built-in RichEditor component and MentionProvider. This fixes Alpine scope
errors (showMentions/mentionResults not defined) that occurred during
Livewire DOM morphing inside Filament slide-over modals.

- Add InteractsWithForms + HasForms to Comments and CommentItem components
- Define commentForm(), editForm(), replyForm() with RichEditor + mentions
- Add CommentsConfig::makeMentionProvider() shared helper
- Update MentionParser to extract mention IDs from RichEditor HTML format
- Update Comment::renderBodyWithMentions() to use RichContentRenderer
- Remove all custom Alpine.js mention code from blade templates
- Backward compatible with existing plain text comments
2026-03-27 18:43:07 +04:00
manukminasyan
f119095ae5 fix: use schema() instead of modalContent() for Filament 5 compatibility
Replace deprecated modalContent() with schema([CommentsEntry::make('comments')])
in both CommentsAction and CommentsTableAction to fix comment creation in
Filament 5 modals.
2026-03-27 17:48:32 +04:00
manukminasyan
fd5bc5271b refactor: rename for Laravel conventions and better DX
- Rename IsCommenter trait to CanComment, Commenter interface to Commentator
- Move models to Models/ namespace (Comment, Reaction, Attachment, Subscription)
- Rename user_type/user_id polymorphic columns to commenter_type/commenter_id
- Rename Config class to CommentsConfig, update config key tables->table_names
- Rename getCommentName() to getCommentDisplayName() on commentator models
- Add column_names config section for commenter morph customization
- Add table_names config with all 5 tables individually configurable
- Expand translation file with structured i18n groups
- Update all Blade views, Livewire components, events, listeners, and tests
2026-03-27 14:53:12 +04:00
manukminasyan
29fcbd8aec feat: initial release of relaticle/comments
Filament comments package with:
- Polymorphic commenting on any Eloquent model
- Threaded replies with configurable depth
- @mentions with autocomplete and user search
- Emoji reactions with toggle and who-reacted tooltips
- File attachments via Livewire uploads
- Reply and mention notifications via Filament notification system
- Thread subscriptions for notification control
- Real-time broadcasting (opt-in Echo) with polling fallback
- Dark mode support
- CommentsAction, CommentsTableAction, CommentsEntry for Filament integration
- 204 tests, 421 assertions
2026-03-26 23:02:56 +04:00