Skip to content

feat(markdown): render frontmatter in file previews - #160

Merged
tarik02 merged 6 commits into
mainfrom
backport/render-markdown-frontmatter
Aug 27, 2026
Merged

feat(markdown): render frontmatter in file previews#160
tarik02 merged 6 commits into
mainfrom
backport/render-markdown-frontmatter

Conversation

@tarik02

@tarik02 tarik02 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What Changed

Backports pingdotgg/t3code#8202.

  • Render valid leading YAML frontmatter as a metadata table in web, desktop, and mobile file previews.
  • Show scalar arrays as pills and nested values as YAML.
  • Preserve invalid, unclosed, and non-mapping frontmatter as raw Markdown.
  • Keep task-list edits mapped to the original file offsets.

Why

Markdown previews currently show frontmatter as raw delimiters and YAML. This matches GitHub's metadata-table presentation while keeping parsing shared and client rendering local.

UI Changes

Before:

Raw frontmatter in a Markdown preview

After:

Frontmatter rendered as a metadata table

Verification

  • vp i, including the lockfile supply-chain check
  • Formatting check for all 8 changed files
  • Targeted lint for all changed TypeScript and TSX files
  • Client runtime, web, and mobile typechecks
  • Backport patch-id matches upstream PR #8202

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI changes
  • A video is not applicable because this does not change animation or interaction

Made with GPT-5.6 Sol using the Codex harness in T3 Code.

@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37acf335e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import * as Option from "effect/Option";
import * as Schema from "effect/Schema";

const FrontmatterDocument = fromYaml(Schema.Record(Schema.String, Schema.Json));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve large integer values in YAML frontmatter

When a mapping contains an integer outside JavaScript's safe range, the YAML transformation converts it to a number and Schema.Json accepts the already-rounded result. For example, id: 9007199254740993 is displayed as 9007199254740992 on every preview surface, silently changing identifier-like metadata. Preserve the scalar lexeme or otherwise parse integers without losing precision before building the display value.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 12.1 KiB 12.1 KiB −5 B (−0.0%) 15.1 KiB
Codex Thread snapshot wire 5.8 KiB 5.8 KiB −6 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB +1 B (+0.0%) 7.8 KiB
Codex Live turn WebSocket decoded 55.5 KiB 55.5 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 9 9 0 (0.0%) 21
Claude Total thread wire 12.2 KiB 12.2 KiB −36 B (−0.3%) 15.1 KiB
Claude Thread snapshot wire 5.8 KiB 5.8 KiB −1 B (−0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB −35 B (−0.5%) 7.8 KiB
Claude Live turn WebSocket decoded 56.4 KiB 56.4 KiB −44 B (−0.1%) 66.4 KiB
Claude Live turn messages 10 9 −1 (−10.0%) 21

Baseline: 04932a5 · PR result: 37acf33 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 84.1 KiB
  • Claude decoded thread snapshot: 84.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@tarik02
tarik02 merged commit d0b6e07 into main Aug 27, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant