Describe the bug
pnpm --filter @openuidev/docs fetch:tweets can write truncated Note Tweet text into the static home-page snapshot.
The current snapshot shows the problem for tweet 2034668122691735612. Its text ends with Just in home-tweets-static.ts.
The generator reads Twitter's undocumented syndication response. That response marks this record with note_tweet, but only returns an opaque Note Tweet ID. Its text field contains a shortened preview followed by the media URL. The generator removes that URL and saves the incomplete preview.
To reproduce
- Check out current
main at c3c0d1b7cf1d58e01846e86b7e9706f54afb2511.
- Inspect tweet
2034668122691735612 in docs/app/(home)/data/home-tweets-static.ts.
- Fetch the same record through the syndication request used by
docs/scripts/fetch-static-tweets.mjs.
- Observe that
note_tweet contains only an ID and text contains a shortened preview.
- Run the generator. The trailing media URL is removed, leaving text that ends mid-sentence.
Expected behavior
The refresh should write complete Note Tweet text. If no complete source is available, it should stop before replacing the committed snapshot with truncated content.
Proposed direction
Keep the home page free from runtime X requests. Change only the manual snapshot generator:
- Detect Note Tweets in the syndication response.
- When
XQUIK_API_KEY is available, call Xquik's documented GET /api/v1/x/tweets/{id} endpoint. Its public contract returns complete Note Tweet text, author data, metrics, and media URLs.
- Keep the current no-key syndication path for ordinary tweets.
- Without a lookup key, fail with an actionable message for Note Tweets. Do not write an incomplete snapshot.
- Normalize both response shapes through pure functions.
- Add fixture tests for ordinary tweets, Note Tweets, media, missing fields, and remote failures.
- Keep the key in the request header only. Never write or log it.
The Xquik route is metered, so this path should remain optional and limited to manual refreshes. If maintainers prefer the official X API or another documented lookup source, the same fail-safe and normalization design can use that provider instead.
If this direction is approved, I can submit the focused implementation and tests.
Environment
- Repository:
thesysdev/openui
- Commit:
c3c0d1b7cf1d58e01846e86b7e9706f54afb2511
- Affected command:
pnpm --filter @openuidev/docs fetch:tweets
Describe the bug
pnpm --filter @openuidev/docs fetch:tweetscan write truncated Note Tweet text into the static home-page snapshot.The current snapshot shows the problem for tweet
2034668122691735612. Its text ends withJustinhome-tweets-static.ts.The generator reads Twitter's undocumented syndication response. That response marks this record with
note_tweet, but only returns an opaque Note Tweet ID. Itstextfield contains a shortened preview followed by the media URL. The generator removes that URL and saves the incomplete preview.To reproduce
mainatc3c0d1b7cf1d58e01846e86b7e9706f54afb2511.2034668122691735612indocs/app/(home)/data/home-tweets-static.ts.docs/scripts/fetch-static-tweets.mjs.note_tweetcontains only an ID andtextcontains a shortened preview.Expected behavior
The refresh should write complete Note Tweet text. If no complete source is available, it should stop before replacing the committed snapshot with truncated content.
Proposed direction
Keep the home page free from runtime X requests. Change only the manual snapshot generator:
XQUIK_API_KEYis available, call Xquik's documentedGET /api/v1/x/tweets/{id}endpoint. Its public contract returns complete Note Tweet text, author data, metrics, and media URLs.The Xquik route is metered, so this path should remain optional and limited to manual refreshes. If maintainers prefer the official X API or another documented lookup source, the same fail-safe and normalization design can use that provider instead.
If this direction is approved, I can submit the focused implementation and tests.
Environment
thesysdev/openuic3c0d1b7cf1d58e01846e86b7e9706f54afb2511pnpm --filter @openuidev/docs fetch:tweets