Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(annotations): add optional emoji to annotations (#61671)

Paul D'Ambraf441196d6ba9
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
index 144fa9fc3ca3..41485f72a9b2 100644
--- a/frontend/src/lib/api.ts
+++ b/frontend/src/lib/api.ts
@@ -4043,7 +4043,10 @@ const api = {
},
async update(
annotationId: RawAnnotationType['id'],
- data: Pick<RawAnnotationType, 'date_marker' | 'scope' | 'content' | 'dashboard_item' | 'dashboard_id'>
+ data: Pick<
+ RawAnnotationType,
+ 'date_marker' | 'scope' | 'content' | 'dashboard_item' | 'dashboard_id' | 'emoji'
+ >
): Promise<RawAnnotationType> {
return await new ApiRequest().annotation(annotationId).update({ data })
},
@@ -4057,7 +4060,10 @@ const api = {
.get()
},
async create(
- data: Pick<RawAnnotationType, 'date_marker' | 'scope' | 'content' | 'dashboard_item' | 'dashboard_id'>
+ data: Pick<
+ RawAnnotationType,
+ 'date_marker' | 'scope' | 'content' | 'dashboard_item' | 'dashboard_id' | 'emoji'
+ >
): Promise<RawAnnotationType> {
return await new ApiRequest().annotations().create({ data })
},
diff --git a/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx b/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx
index 740bc9624234..a059a6904a36 100644
--- a/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx
+++ b/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx
@@ -286,6 +286,14 @@ const AnnotationsBadge = React.memo(function AnnotationsBadgeRaw({
const active = activeDate?.valueOf() === date.valueOf() && isPopoverShown
const shown = active || hovered || annotations.length > 0
+ // Surface an emoji in place of the count badge when the annotations in this bucket
+ // share exactly one emoji — regardless of which annotation carries it or how many do.
+ // More than one distinct emoji (multiple options) falls back to the count badge.
+ const distinctEmojis = Array.from(
+ new Set(annotations.map((annotation) => annotation.emoji).filter((emoji): emoji is string => !!emoji))
+ )
+ const singleEmoji = distinctEmojis.length === 1 ? distinctEmojis[0] : null
+
return (
<button
ref={buttonRef}
@@ -313,12 +321,16 @@ const AnnotationsBadge = React.memo(function AnnotationsBadgeRaw({
onClick={!isDateLocked ? lockDate : active ? unlockDate : () => activateDate(date)}
>
{annotations.length ? (
- <LemonBadge.Number
- count={annotations.length}
- status="data"
- size="small"
- active={active && isDateLocked}
- />
+ singleEmoji ? (
+ <LemonBadge content={singleEmoji} status="data" size="small" active={active && isDateLocked} />
+ ) : (
+ <LemonBadge.Number
+ count={annotations.length}
+ status="data"
+ size="small"
+ active={active && isDateLocked}
+ />
+ )
) : (
<LemonBadge content={<IconPlusSmall />} status="data" size="small" active={active && isDateLocked} />
)}
@@ -426,6 +438,7 @@ function AnnotationCard({ annotation }: { annotation: AnnotationType }): JSX.Ele
}`}
>
<div className="flex items-center gap-2">
+ {annotation.emoji && <span className="text-lg leading-none shrink-0">{annotation.emoji}</span>}
<h5 className="grow m-0 text-secondary">
{annotation.date_marker?.format('MMM DD, YYYY h:mm A')} ({shortTimeZone(timezone)}) –{' '}
{annotationScopeToName[annotation.scope]}
diff --git a/frontend/src/scenes/annotations/AnnotationModal.tsx b/frontend/src/scenes/annotations/AnnotationModal.tsx
index 20b601942222..225707e1111e 100644
--- a/frontend/src/scenes/annotations/AnnotationModal.tsx
+++ b/frontend/src/scenes/annotations/AnnotationModal.tsx
@@ -1,6 +1,7 @@
import { useActions, useValues } from 'kea'
import { Form } from 'kea-forms'
+import { IconX } from '@posthog/icons'
import {
LemonButton,
LemonCalendarSelectInput,
@@ -11,6 +12,7 @@ import {
Link,
} from '@posthog/lemon-ui'
+import { EmojiPickerPopover } from 'lib/components/EmojiPicker/EmojiPickerPopover'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonTextAreaMarkdown } from 'lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown'
import { shortTimeZone } from 'lib/utils'
@@ -178,6 +180,35 @@ export function AnnotationModal({
maxLength={400}
/>
</LemonField>
+ <LemonField
+ name="emoji"
+ label="Emoji"
+ showOptional
+ info="Shown in place of the default badge when this annotation appears on a chart."
+ >
+ {({ value, onChange }) => (
+ <div className="flex items-center gap-2">
+ <EmojiPickerPopover
+ onSelect={(emoji) => onChange(emoji)}
+ data-attr="annotation-emoji-picker"
+ />
+ {value ? (
+ <div className="flex items-center gap-1">
+ <span className="text-2xl leading-none">{value}</span>
+ <LemonButton
+ size="small"
+ icon={<IconX />}
+ tooltip="Remove emoji"
+ onClick={() => onChange(null)}
+ data-attr="annotation-emoji-clear"
+ />
+ </div>
+ ) : (
+ <span className="text-secondary text-sm">No emoji selected</span>
+ )}
+ </div>
+ )}
+ </LemonField>
</Form>
</LemonModal>
)
diff --git a/frontend/src/scenes/annotations/Annotations.stories.tsx b/frontend/src/scenes/annotations/Annotations.stories.tsx
index d9a1e37994bc..0c5b6e5a887b 100644
--- a/frontend/src/scenes/annotations/Annotations.stories.tsx
+++ b/frontend/src/scenes/annotations/Annotations.stories.tsx
@@ -31,4 +31,6 @@ const meta: Meta = {
export default meta
type Story = StoryObj<{}>
+// The table renders the emoji next to the content for annotations that have one (see the fixture),
+// giving visual-regression coverage of the emoji display.
export const Annotations: Story = {}
diff --git a/frontend/src/scenes/annotations/Annotations.tsx b/frontend/src/scenes/annotations/Annotations.tsx
index 5283eec2a7e6..a29b33b64b3b 100644
--- a/frontend/src/scenes/annotations/Annotations.tsx
+++ b/frontend/src/scenes/annotations/Annotations.tsx
@@ -65,10 +65,16 @@ export function Annotations(): JSX.Element {
/>
}
>
- <div className="font-semibold line-clamp-2">
- <Link subtle to={urls.annotation(annotation.id)}>
- {annotation.content ?? ''}
- </Link>
+ <div className="flex items-center gap-1.5">
+ {annotation.emoji && (
+ <span className="text-base leading-none shrink-0">{annotation.emoji}</span>
+ )}
+ {/* line-clamp-2 must stay on its own element — combining it with flex breaks the clamp */}
+ <div className="font-semibold line-clamp-2 min-w-0">
+ <Link subtle to={urls.annotation(annotation.id)}>
+ {annotation.content ?? ''}
+ </Link>
+ </div>
</div>
</Tooltip>
)
diff --git a/frontend/src/scenes/annotations/__mocks__/annotations.json b/frontend/src/scenes/annotations/__mocks__/annotations.json
index 0ec61dc2970d..777714b00809 100644
--- a/frontend/src/scenes/annotations/__mocks__/annotations.json
+++ b/frontend/src/scenes/annotations/__mocks__/annotations.json
@@ -19,7 +19,8 @@
"created_at": "2022-08-23T19:59:32.953086Z",
"updated_at": "2022-08-23T19:59:32.953338Z",
"deleted": false,
- "scope": "organization"
+ "scope": "organization",
+ "emoji": "🚀"
},
{
"id": 114042,
@@ -37,7 +38,8 @@
"created_at": "2022-08-22T14:04:44.095170Z",
"updated_at": "2022-08-22T14:04:44.095461Z",
"deleted": false,
- "scope": "organization"
+ "scope": "organization",
+ "emoji": "🎉"
},
{
"id": 113760,
diff --git a/frontend/src/scenes/annotations/annotationModalLogic.ts b/frontend/src/scenes/annotations/annotationModalLogic.ts
index 0181eaa0877d..32de9cb29ea1 100644
--- a/frontend/src/scenes/annotations/annotationModalLogic.ts
+++ b/frontend/src/scenes/annotations/annotationModalLogic.ts
@@ -36,6 +36,7 @@ export interface AnnotationModalForm {
dateMarker: Dayjs
scope: AnnotationType['scope']
content: AnnotationType['content']
+ emoji: AnnotationType['emoji']
dashboardItemId: AnnotationType['dashboard_item'] | null
dashboardId: AnnotationType['dashboard_id'] | null
}
@@ -97,11 +98,12 @@ export const annotationModalLogic = kea<annotationModalLogicType>([
],
})),
listeners(({ cache, actions, values }) => ({
- openModalToEditAnnotation: ({ annotation: { date_marker, scope, content }, insightId, dashboardId }) => {
+ openModalToEditAnnotation: ({ annotation: { date_marker, scope, content, emoji }, insightId, dashboardId }) => {
actions.setAnnotationModalValues({
dateMarker: dayjs(date_marker).tz(values.timezone),
scope,
content,
+ emoji,
})
if (insightId) {
actions.setAnnotationModalValue('dashboardItemId', insightId)
@@ -146,6 +148,7 @@ export const annotationModalLogic = kea<annotationModalLogicType>([
defaults: {
dateMarker: dayjs().tz(values.timezone),
content: '',
+ emoji: null,
scope: AnnotationScope.Project,
dashboardItemId: null,
dashboardId: null,
@@ -154,13 +157,14 @@ export const annotationModalLogic = kea<annotationModalLogicType>([
content: !content?.trim() ? 'An annotation must have text content.' : null,
}),
submit: async (data) => {
- const { dateMarker, content, scope, dashboardItemId, dashboardId } = data
+ const { dateMarker, content, emoji, scope, dashboardItemId, dashboardId } = data
if (values.existingModalAnnotation) {
// annotationsModel's updateAnnotation inlined so that isAnnotationModalSubmitting works
const updatedAnnotation = await api.annotations.update(values.existingModalAnnotation.id, {
date_marker: dateMarker.toISOString(),
content,
+ emoji: emoji || null,
scope,
// update to new insight we're saving from
dashboard_item: dashboardItemId,
@@ -173,6 +177,7 @@ export const annotationModalLogic = kea<annotationModalLogicType>([
const createdAnnotation = await api.annotations.create({
date_marker: dateMarker.toISOString(),
content,
+ emoji: emoji || null,
scope,
dashboard_item: dashboardItemId,
dashboard_id: dashboardId,
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index b6a760fdc80b..ee260ece02f5 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -2800,6 +2800,8 @@ export interface RawAnnotationType {
dashboard_name?: DashboardBasicType['name'] | null
deleted?: boolean
creation_type?: 'USR' | 'GIT'
+ /** Optional emoji shown in place of the default badge when surfacing the annotation. */
+ emoji?: string | null
}
export interface AnnotationType extends Omit<RawAnnotationType, 'created_at' | 'date_marker'> {
diff --git a/products/annotations/backend/api/annotation.py b/products/annotations/backend/api/annotation.py
index 02a13a5644de..13cab46cea87 100644
--- a/products/annotations/backend/api/annotation.py
+++ b/products/annotations/backend/api/annotation.py
@@ -55,6 +55,7 @@ class AnnotationSerializer(serializers.ModelSerializer):
"updated_at",
"deleted",
"scope",
+ "emoji",
]
read_only_fields = [
"id",
@@ -91,8 +92,18 @@ class AnnotationSerializer(serializers.ModelSerializer):
"`recording` is deprecated and rejected."
),
},
+ "emoji": {
+ "help_text": "Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.",
+ "required": False,
+ "allow_null": True,
+ "allow_blank": True,
+ },
}
+ def validate_emoji(self, value: str | None) -> str | None:
+ # Normalise blank strings to None so the DB has a single canonical "no emoji" state.
+ return value or None
+
def update(self, instance: Annotation, validated_data: dict[str, Any]) -> Annotation:
instance.team_id = self.context["team_id"]
return super().update(instance, validated_data)
diff --git a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
index 6a448fceaec9..cdcb816fe5af 100644
--- a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
+++ b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
@@ -408,6 +408,7 @@
"posthog_annotation"."organization_id",
"posthog_annotation"."created_by_id",
"posthog_annotation"."scope",
+ "posthog_annotation"."emoji",
"posthog_annotation"."creation_type",
"posthog_annotation"."date_marker",
"posthog_annotation"."deleted",
@@ -1040,6 +1041,7 @@
"posthog_annotation"."organization_id",
"posthog_annotation"."created_by_id",
"posthog_annotation"."scope",
+ "posthog_annotation"."emoji",
"posthog_annotation"."creation_type",
"posthog_annotation"."date_marker",
"posthog_annotation"."deleted",
diff --git a/products/annotations/backend/api/test/test_annotation.py b/products/annotations/backend/api/test/test_annotation.py
index 1ffcdd2a412e..12cfeff79bff 100644
--- a/products/annotations/backend/api/test/test_annotation.py
+++ b/products/annotations/backend/api/test/test_annotation.py
@@ -202,6 +202,67 @@ class TestAnnotation(APIBaseTest, QueryMatchingTest):
assert test_annotation.scope == "organization"
assert test_annotation.date_marker is None
+ @parameterized.expand(
+ [
+ ("simple_emoji", "🚀", "🚀"),
+ ("zwj_sequence", "👨‍👩‍👦", "👨‍👩‍👦"),
+ ("max_length_boundary", "🚀" * 16, "🚀" * 16),
+ ("blank_normalised_to_null", "", None),
+ ]
+ )
+ def test_creating_annotation_emoji(self, _name: str, emoji: str, expected: Optional[str]) -> None:
+ response = self.client.post(
+ f"/api/projects/{self.team.id}/annotations/",
+ {
+ "content": "Release shipped",
+ "scope": "project",
+ "date_marker": "2020-01-01T00:00:00.000000Z",
+ "emoji": emoji,
+ },
+ )
+ assert response.status_code == status.HTTP_201_CREATED
+ assert response.json()["emoji"] == expected
+ instance = Annotation.objects.get(pk=response.json()["id"])
+ assert instance.emoji == expected
+
+ def test_creating_annotation_with_too_long_emoji_is_rejected(self) -> None:
+ response = self.client.post(
+ f"/api/projects/{self.team.id}/annotations/",
+ {
+ "content": "Release shipped",
+ "scope": "project",
+ "date_marker": "2020-01-01T00:00:00.000000Z",
+ "emoji": "🚀" * 17, # 17 code points exceeds the 16-char limit
+ },
+ )
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert response.json()["attr"] == "emoji"
+ assert response.json()["code"] == "max_length"
+
+ def test_updating_and_clearing_annotation_emoji(self) -> None:
+ test_annotation = Annotation.objects.create(
+ organization=self.organization,
+ team=self.team,
+ created_by=self.user,
+ content="hello world!",
+ )
+
+ set_response = self.client.patch(
+ f"/api/projects/{self.team.id}/annotations/{test_annotation.pk}/",
+ {"emoji": "🎉"},
+ )
+ assert set_response.status_code == status.HTTP_200_OK
+ test_annotation.refresh_from_db()
+ assert test_annotation.emoji == "🎉"
+
+ clear_response = self.client.patch(
+ f"/api/projects/{self.team.id}/annotations/{test_annotation.pk}/",
+ {"emoji": None},
+ )
+ assert clear_response.status_code == status.HTTP_200_OK
+ test_annotation.refresh_from_db()
+ assert test_annotation.emoji is None
+
def test_deleting_annotation(self) -> None:
new_user = User.objects.create_and_join(self.organization, "[email protected]", None)
diff --git a/products/annotations/backend/migrations/0002_annotation_emoji.py b/products/annotations/backend/migrations/0002_annotation_emoji.py
new file mode 100644
index 000000000000..7f719cc00fd9
--- /dev/null
+++ b/products/annotations/backend/migrations/0002_annotation_emoji.py
@@ -0,0 +1,15 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("annotations", "0001_migrate_annotations_models"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="annotation",
+ name="emoji",
+ field=models.CharField(blank=True, max_length=16, null=True),
+ ),
+ ]
diff --git a/products/annotations/backend/migrations/max_migration.txt b/products/annotations/backend/migrations/max_migration.txt
index b832d4bc9f4b..425bf6a87f86 100644
--- a/products/annotations/backend/migrations/max_migration.txt
+++ b/products/annotations/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0001_migrate_annotations_models
+0002_annotation_emoji
diff --git a/products/annotations/backend/models/annotation.py b/products/annotations/backend/models/annotation.py
index 37a3c7ee2863..fd4a8364d9c7 100644
--- a/products/annotations/backend/models/annotation.py
+++ b/products/annotations/backend/models/annotation.py
@@ -29,6 +29,9 @@ class Annotation(ModelActivityMixin, models.Model):
organization = models.ForeignKey("posthog.Organization", on_delete=models.CASCADE, null=True)
created_by = models.ForeignKey("posthog.User", on_delete=models.SET_NULL, null=True, blank=True)
scope = models.CharField(max_length=24, choices=Scope, default=Scope.INSIGHT)
+ # Optional emoji shown in place of the default badge when surfacing the annotation.
+ # Long enough to hold a single multi-codepoint grapheme (ZWJ sequences, skin-tone modifiers).
+ emoji = models.CharField(max_length=16, null=True, blank=True)
creation_type = models.CharField(max_length=3, choices=CreationType, default=CreationType.USER)
date_marker = models.DateTimeField(null=True, blank=True)
deleted = models.BooleanField(default=False)
diff --git a/products/annotations/frontend/generated/api.schemas.ts b/products/annotations/frontend/generated/api.schemas.ts
index 9b41096600b7..f0e840e0cf7b 100644
--- a/products/annotations/frontend/generated/api.schemas.ts
+++ b/products/annotations/frontend/generated/api.schemas.ts
@@ -134,6 +134,12 @@ export interface AnnotationApi {
* `organization` - organization
* `recording` - recording */
scope?: AnnotationScopeEnumApi
+ /**
+ * Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.
+ * @maxLength 16
+ * @nullable
+ */
+ emoji?: string | null
}
export interface PaginatedAnnotationListApi {
@@ -189,6 +195,12 @@ export interface PatchedAnnotationApi {
* `organization` - organization
* `recording` - recording */
scope?: AnnotationScopeEnumApi
+ /**
+ * Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.
+ * @maxLength 16
+ * @nullable
+ */
+ emoji?: string | null
}
export type AnnotationsListParams = {
diff --git a/products/annotations/frontend/generated/api.zod.ts b/products/annotations/frontend/generated/api.zod.ts
index 85414977f530..35fdec412596 100644
--- a/products/annotations/frontend/generated/api.zod.ts
+++ b/products/annotations/frontend/generated/api.zod.ts
@@ -14,6 +14,8 @@ import * as zod from 'zod'
*/
export const annotationsCreateBodyContentMax = 8192
+export const annotationsCreateBodyEmojiMax = 16
+
export const AnnotationsCreateBody = /* @__PURE__ */ zod.object({
content: zod
.string()
@@ -46,6 +48,11 @@ export const AnnotationsCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
),
+ emoji: zod
+ .string()
+ .max(annotationsCreateBodyEmojiMax)
+ .nullish()
+ .describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
})
/**
@@ -53,6 +60,8 @@ export const AnnotationsCreateBody = /* @__PURE__ */ zod.object({
*/
export const annotationsUpdateBodyContentMax = 8192
+export const annotationsUpdateBodyEmojiMax = 16
+
export const AnnotationsUpdateBody = /* @__PURE__ */ zod.object({
content: zod
.string()
@@ -85,6 +94,11 @@ export const AnnotationsUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
),
+ emoji: zod
+ .string()
+ .max(annotationsUpdateBodyEmojiMax)
+ .nullish()
+ .describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
})
/**
@@ -92,6 +106,8 @@ export const AnnotationsUpdateBody = /* @__PURE__ */ zod.object({
*/
export const annotationsPartialUpdateBodyContentMax = 8192
+export const annotationsPartialUpdateBodyEmojiMax = 16
+
export const AnnotationsPartialUpdateBody = /* @__PURE__ */ zod.object({
content: zod
.string()
@@ -124,4 +140,9 @@ export const AnnotationsPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
),
+ emoji: zod
+ .string()
+ .max(annotationsPartialUpdateBodyEmojiMax)
+ .nullish()
+ .describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
})
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 6c2a6b2caf7b..b684c1bcdb5e 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -7729,6 +7729,12 @@ export namespace Schemas {
* `organization` - organization
* `recording` - recording */
scope?: AnnotationScopeEnum;
+ /**
+ * Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.
+ * @maxLength 16
+ * @nullable
+ */
+ emoji?: string | null;
}
export interface AppMetricSeries {
@@ -27424,6 +27430,12 @@ export namespace Schemas {
* `organization` - organization
* `recording` - recording */
scope?: AnnotationScopeEnum;
+ /**
+ * Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.
+ * @maxLength 16
+ * @nullable
+ */
+ emoji?: string | null;
}
export interface PatchedApprovalPolicy {
diff --git a/services/mcp/src/generated/annotations/api.ts b/services/mcp/src/generated/annotations/api.ts
index d084fe801b59..dfe615476fb5 100644
--- a/services/mcp/src/generated/annotations/api.ts
+++ b/services/mcp/src/generated/annotations/api.ts
@@ -38,6 +38,8 @@ export const AnnotationsCreateParams = /* @__PURE__ */ zod.object({
export const annotationsCreateBodyContentMax = 8192
+export const annotationsCreateBodyEmojiMax = 16
+
export const AnnotationsCreateBody = /* @__PURE__ */ zod.object({
content: zod
.string()
@@ -70,6 +72,11 @@ export const AnnotationsCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n* `dashboard_item` - insight\n* `dashboard` - dashboard\n* `project` - project\n* `organization` - organization\n* `recording` - recording'
),
+ emoji: zod
+ .string()
+ .max(annotationsCreateBodyEmojiMax)
+ .nullish()
+ .describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
})
/**
@@ -98,6 +105,8 @@ export const AnnotationsPartialUpdateParams = /* @__PURE__ */ zod.object({
export const annotationsPartialUpdateBodyContentMax = 8192
+export const annotationsPartialUpdateBodyEmojiMax = 16
+
export const AnnotationsPartialUpdateBody = /* @__PURE__ */ zod.object({
content: zod
.string()
@@ -130,6 +139,11 @@ export const AnnotationsPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n* `dashboard_item` - insight\n* `dashboard` - dashboard\n* `project` - project\n* `organization` - organization\n* `recording` - recording'
),
+ emoji: zod
+ .string()
+ .max(annotationsPartialUpdateBodyEmojiMax)
+ .nullish()
+ .describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
})
/**
diff --git a/services/mcp/src/tools/generated/annotations.ts b/services/mcp/src/tools/generated/annotations.ts
index 0d1a40d43f4c..c2b48b6a5832 100644
--- a/services/mcp/src/tools/generated/annotations.ts
+++ b/services/mcp/src/tools/generated/annotations.ts
@@ -19,6 +19,7 @@ const AnnotationCreateSchema = AnnotationsCreateBody.omit({
dashboard_item: true,
dashboard_id: true,
deleted: true,
+ emoji: true,
})
const annotationCreate = (): ToolBase<typeof AnnotationCreateSchema, Schemas.Annotation> => ({
@@ -102,8 +103,13 @@ const annotationsList = (): ToolBase<
})
const AnnotationsPartialUpdateSchema = AnnotationsPartialUpdateParams.omit({ project_id: true }).extend(
- AnnotationsPartialUpdateBody.omit({ creation_type: true, dashboard_item: true, dashboard_id: true, deleted: true })
- .shape
+ AnnotationsPartialUpdateBody.omit({
+ creation_type: true,
+ dashboard_item: true,
+ dashboard_id: true,
+ deleted: true,
+ emoji: true,
+ }).shape
)
const annotationsPartialUpdate = (): ToolBase<typeof AnnotationsPartialUpdateSchema, Schemas.Annotation> => ({