Skip to content

Conversation

@FadhlanR
Copy link
Contributor

In this PR, I also included the results of the renaming script.

Copy link

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

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: 90bc6f4644

ℹ️ 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".

Comment on lines 96 to 99
@field cardTitle = contains(StringField);
@field excerpt = contains(StringField);
@field content = contains(StringField);

Choose a reason for hiding this comment

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

P2 Badge Populate MarkdownDef cardTitle

MarkdownDef now defines @field cardTitle, but extractAttributes later in this file still returns a title property (and the preview component reads model.title), so importing a markdown file no longer populates the card’s title from the document heading. In practice the preview will fall back to the filename and cardTitle remains unset for markdown cards. Updating the extracted attribute and preview to use cardTitle would keep the previous behavior.

Useful? React with 👍 / 👎.

@github-actions
Copy link

Preview deployments

[/@model\.title\b/g, '@model.cardTitle'],
[/@model\.description\b/g, '@model.cardDescription'],
[/@model\.thumbnailURL\b/g, '@model.cardThumbnailURL'],
];
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this update this template?

Image

I think you may need to make a codemod-like-tool vs using string replacement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see, I'll use the codemod tool

@backspace
Copy link
Contributor

This card was missed by the original script, any ideas why?

image

@github-actions
Copy link

github-actions bot commented Jan 21, 2026

Host Test Results

    1 files      1 suites   1h 40m 59s ⏱️
1 897 tests 1 880 ✅ 17 💤 0 ❌
1 912 runs  1 895 ✅ 17 💤 0 ❌

Results for commit 66a62f3.

♻️ This comment has been updated with latest results.

@FadhlanR
Copy link
Contributor Author

FadhlanR commented Jan 21, 2026

This card was missed by the original script, any ideas why?

image

Isn't it correct? We rename cardInfo.description to cardInfo.summary

@backspace
Copy link
Contributor

Isn't it correct? We rename cardInfo.description to cardInfo.summary

wow yes you’re right, sorry about that 😵

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a script to automatically rename CardDef and CardInfo fields in .gts files from the old naming convention (title, description, thumbnailURL) to the new naming convention (cardTitle, cardDescription, cardThumbnailURL for CardDef fields, and name, summary, cardThumbnailURL for CardInfo fields). The PR includes both the script implementation and the results of running it on the codebase.

Changes:

  • Added scripts/rename-card-fields-gts.js to automate field renaming in .gts files
  • Updated documentation in docs/card-field-rename.md with instructions for using the new script
  • Applied automated field renaming across multiple .gts files in the codebase

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/rename-card-fields-gts.js New script implementing pattern-based field renaming for .gts files with regex replacements
docs/card-field-rename.md Added documentation section explaining how to use the .gts renaming script
packages/host/tests/helpers/interact-submode-setup.gts Renamed @field title to @field cardTitle in FileLinkCard class
packages/host/tests/acceptance/code-submode/file-def-navigation-test.gts Renamed @field title to @field cardTitle in FileLinkCard test class
packages/host/tests/acceptance/code-submode/card-playground-test.gts Updated cardInfo object keys from title to name in test fixture
packages/experiments-realm/file-links-example.gts Renamed field definitions and template references from title/description to cardTitle/cardDescription
packages/catalog-realm/system-card/model-updater.gts Updated cardInfo object keys from title/description/thumbnailURL to name/summary/cardThumbnailURL
packages/base/markdown-file-def.gts Renamed @field title to @field cardTitle

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FadhlanR FadhlanR force-pushed the cs-10084-rename-field-name-in-gts-files branch from 90bc6f4 to 66a62f3 Compare January 22, 2026 08:21
@FadhlanR
Copy link
Contributor Author

I updated this to use codemod-tool instead of string replacement. I’ve also run the script in staging against my realms, and it works. Please check it again.

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.

4 participants