Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 4, 2025

This PR fixes redundant title="rstest.config.ts" attributes in code blocks that are already wrapped in <Tab label="rstest.config.ts"> components across the documentation.

Problem

Many configuration code blocks were wrapped in Tab components that already declared the filename in their label attribute, making the additional title="rstest.config.ts" attribute redundant and visually cluttered:

<Tab label="rstest.config.ts">
```ts title="rstest.config.ts"  <!-- This title is redundant -->
import { defineConfig } from '@rstest/core';
```

Solution

Removed the redundant title="rstest.config.ts" attributes from code blocks that are inside <Tab label="rstest.config.ts"> components, while preserving title attributes for standalone code blocks that are not wrapped in tabs.

Files Changed

  • 41 files total: 20 English + 21 Chinese documentation files in website/docs/{zh,en}/config/test/
  • Only code blocks inside Tab components had their redundant titles removed
  • Standalone code blocks (not in tabs) retain their title attributes for clarity

Example Change

  <Tab label="rstest.config.ts">
- ```ts title="rstest.config.ts"
+ ```ts
  import { defineConfig } from '@rstest/core';
  
  export default defineConfig({
    globals: true,
  });
```

This change eliminates visual redundancy while maintaining clear documentation structure - the Tab label already indicates the filename, so the title attribute is unnecessary.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

netlify bot commented Sep 4, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 0c1d791
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68b958e36035070008762a51
😎 Deploy Preview https://deploy-preview-546--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Copilot Copilot AI changed the title [WIP] add the missing title="rstest.config.ts to missing code blocks in website/docs. remember must modify zh and en files together. Add missing title="rstest.config.ts" to configuration code blocks in documentation Sep 4, 2025
@Copilot Copilot AI requested a review from fi3ework September 4, 2025 08:44
Copilot finished work on behalf of fi3ework September 4, 2025 08:44
@fi3ework
Copy link
Member

fi3ework commented Sep 4, 2025

@copilot re-check are the files updated in docs/en identical with docs/zh?

Copy link
Author

Copilot AI commented Sep 4, 2025

@copilot re-check are the files updated in docs/en identical with docs/zh?

No, the files updated in docs/en are not identical to docs/zh. I found at least one significant difference:

reporters.mdx (line 134):

  • EN: reporters: [['junit', { outputPath: './junit.xml' }]]
  • ZH: reporters: ['junit']

The English version shows the full configuration example with outputPath, while the Chinese version shows a simplified example. Both have the title="rstest.config.ts" attribute correctly added, but the configuration content differs.

The text content is properly translated between languages, but some code examples appear to have intentional differences in complexity/completeness.

Copilot finished work on behalf of fi3ework September 4, 2025 08:55
@fi3ework
Copy link
Member

fi3ework commented Sep 4, 2025

@copilot do not add the title when it's wrapped in a Tab that already declares the file name, like below

  <Tab label="rstest.config.ts">
```ts title="rstest.config.ts"

…nts that already declare filename

Co-authored-by: fi3ework <[email protected]>
Copy link
Author

Copilot AI commented Sep 4, 2025

@copilot do not add the title when it's wrapped in a Tab that already declares the file name, like below

...

I've removed the redundant title="rstest.config.ts" attributes from all code blocks that are inside <Tab label="rstest.config.ts"> components. The Tab label already declares the filename, making the title attribute redundant.

Changes made:

  • Processed 41 documentation files (20 English + 21 Chinese)
  • Only removed titles from code blocks inside Tab components that declare "rstest.config.ts"
  • Preserved title attributes for standalone code blocks that are not wrapped in tabs

Fixed in commit 0c1d791.

@Copilot Copilot AI changed the title Add missing title="rstest.config.ts" to configuration code blocks in documentation Remove redundant title attributes from configuration code blocks in Tab components Sep 4, 2025
Copilot finished work on behalf of fi3ework September 4, 2025 09:17
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.

3 participants