Skip to content

Don't serialize the GitHub chip's "Loading..." placeholder title#3533

Open
luke-belton wants to merge 1 commit into
mainfrom
posthog-code/github-chip-placeholder-title
Open

Don't serialize the GitHub chip's "Loading..." placeholder title#3533
luke-belton wants to merge 1 commit into
mainfrom
posthog-code/github-chip-placeholder-title

Conversation

@luke-belton

Copy link
Copy Markdown

Problem

Pasting a GitHub PR/issue URL into the message editor inserts a chip labeled #<n> - Loading... while the real title is fetched. If the message is sent before the fetch resolves (or the fetch silently fails at the wrong moment), the placeholder is serialized into the message as title="Loading..." and rendered that way forever - e.g. <github_pr number="71827" title="Loading..." url="..." /> showing up in an agent conversation.

Changes

  • Hoisted the placeholder into GITHUB_REF_PLACEHOLDER_TITLE in content.ts (single source of truth, used by buildGithubRefPlaceholderChip).
  • contentToXml now serializes a still-unresolved chip with title="", the same shape as the existing failed-fetch fallback (#<n> labels), which the parser already round-trips as a title-less chip.
  • The chip still shows "Loading..." in the editor while fetching - only the serialized message changes.

How did you test this?

  • Added a regression test in content.test.ts that serializes a chip built by buildGithubRefPlaceholderChip and asserts the placeholder does not leak (this also pins the builder and serializer to the same constant).
  • pnpm --filter @posthog/core test - 213 files / 2415 tests pass.
  • pnpm --filter @posthog/core typecheck and biome lint packages/core - clean.
  • I (the agent) did not run the desktop app; the change is confined to pure serialization logic.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

A pasted GitHub PR/issue URL inserts a chip titled "Loading..." until
the real title is fetched. If the message is sent before the fetch
resolves, the placeholder was serialized into the message as
title="Loading..." and displayed forever. Serialize an unresolved chip
with an empty title instead, matching the failed-fetch fallback.

Generated-By: PostHog Code
Task-Id: de8bff5b-1b4d-4033-b56b-62c895c8ab71
@trunk-io

trunk-io Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@luke-belton luke-belton self-assigned this Jul 17, 2026
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit c9aaef9.

@luke-belton
luke-belton marked this pull request as ready for review July 17, 2026 10:19
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Don't serialize the GitHub chip's "Loadi..." | Re-trigger Greptile

Comment thread packages/core/src/message-editor/content.ts
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