From d331c667259739c5760ea15d730681fd0cdfe344 Mon Sep 17 00:00:00 2001 From: Rias Date: Thu, 17 Sep 2026 13:23:26 +0200 Subject: [PATCH 01/32] Extend activity history for grouped events Amp-Thread-ID: https://ampcode.com/threads/T-01a0a94a-11cb-77ad-ba1e-c88828744b3c --- .../components/ActivityCommentCard.vue | 85 ++++++++++++++++++ .../components/ActivityTimelineComment.vue | 88 ++++--------------- .../markdown-field/commentToolbarButtons.ts | 11 +++ src/Activity/Activities.php | 4 +- src/Activity/ActivityEventRecorder.php | 2 +- src/Activity/ActivityTimelinePresenter.php | 9 +- src/Activity/Models/ActivityEvent.php | 10 +-- .../Elements/ActivityCommentsController.php | 6 +- src/Support/Facades/Activities.php | 2 +- tests/Feature/Activity/ActivitiesTest.php | 3 +- .../ActivityTimelineControllerTest.php | 18 ++-- 11 files changed, 140 insertions(+), 98 deletions(-) create mode 100644 resources/js/modules/activity/components/ActivityCommentCard.vue create mode 100644 resources/js/modules/markdown-field/commentToolbarButtons.ts diff --git a/resources/js/modules/activity/components/ActivityCommentCard.vue b/resources/js/modules/activity/components/ActivityCommentCard.vue new file mode 100644 index 00000000000..fe6be1c7ad0 --- /dev/null +++ b/resources/js/modules/activity/components/ActivityCommentCard.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/resources/js/modules/activity/components/ActivityTimelineComment.vue b/resources/js/modules/activity/components/ActivityTimelineComment.vue index 247f4c99f2a..6b542f990c2 100644 --- a/resources/js/modules/activity/components/ActivityTimelineComment.vue +++ b/resources/js/modules/activity/components/ActivityTimelineComment.vue @@ -10,7 +10,8 @@ import ActionMenu from '@/common/components/ActionMenu.vue'; import type {ActionItem} from '@/common/types'; import type {ActivityEvent} from '@/modules/activity/composables/useActivityTimeline'; - import ActivityTimelineActor from './ActivityTimelineActor.vue'; + import {commentToolbarButtons} from '@/modules/markdown-field/commentToolbarButtons'; + import ActivityCommentCard from './ActivityCommentCard.vue'; import ActivityTimelineEvent from './ActivityTimelineEvent.vue'; import '../../markdown-field/markdown-field'; @@ -54,18 +55,6 @@ : []), ]); const editorId = `activity-comment-${useId()}`; - const toolbarButtons = [ - 'bold', - 'italic', - 'code', - 'h3', - 'quote', - 'unordered-list', - 'ordered-list', - 'check-list', - 'link', - ]; - function requestData() { return { elementType: props.elementType, @@ -86,12 +75,6 @@ }, ]); - function sentenceFragment(text: string | null): string { - return text === null - ? '' - : text.charAt(0).toLocaleLowerCase() + text.slice(1); - } - function startEditing(): void { editing.value = true; draft.value = comment.value!.markdown ?? ''; @@ -189,7 +172,7 @@ :placeholder="creating ? t('Add a comment…') : undefined" sanitize-html show-toolbar - .toolbarButtons="toolbarButtons" + .toolbarButtons="commentToolbarButtons" .value="draft" @input="draft = ($event.target as HTMLTextAreaElement).value" /> @@ -223,49 +206,27 @@ - -
- - - - {{ sentenceFragment(event?.description.text ?? null) }} - -
- - - -
+ - - - + diff --git a/resources/js/modules/forms/ComboboxControl.vue b/resources/js/modules/forms/ComboboxControl.vue index be5a681ae69..cd47f2df8fd 100644 --- a/resources/js/modules/forms/ComboboxControl.vue +++ b/resources/js/modules/forms/ComboboxControl.vue @@ -50,7 +50,6 @@