Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 9, 2025

Implement highlighted and comment props for File and Folder components

Summary

Implemented custom MDX component overrides for <Files>, <Folder>, and <File> components to support two new optional props:

  • highlighted (boolean): Visually emphasizes files/folders with a yellow background
  • comment (string): Displays explanatory text to the right of items with "# " prefix

⚠️ CRITICAL ISSUE: The highlighting and comments are NOT rendering visually in either local preview or deployed preview. The components are implemented with inline styles, but the styling is not appearing. The PR is incomplete and requires debugging before merge.

Changes include:

  • Custom React components in fern/components/ (File.tsx, Folder.tsx, Files.tsx)
  • Grid layout (grid-cols-[24px_24px_1fr_auto]) to fix icon alignment
  • Inline styles for highlighting (backgroundColor: 'rgba(255, 235, 59, 0.15)') and comments (color: '#6b7280')
  • Documentation updates with new section and property definitions
  • Custom CSS classes (currently unused due to inline style approach)

Review & Testing Checklist for Human

  • CRITICAL: Debug why highlighting and comments aren't rendering - The inline styles are in the code but not appearing in the rendered output. Inspect the DOM in the preview to see if: (a) custom components are being used, (b) props are being passed correctly, (c) inline styles are present in the DOM, (d) styles are being overridden by other CSS
  • Verify custom components are actually overriding built-in components - Check that experimental.mdx-components: - ./components is working correctly and the custom components are being used instead of built-in Fern components
  • Test alternative styling approaches - If inline styles don't work, try: (a) using the CSS classes already added to styles.css, (b) CSS-in-JS libraries, (c) different CSS variable syntax
  • Check icon alignment - Verify that file icons align vertically with folder icons (not with the chevron) using the grid layout
  • Test folder toggle functionality - Ensure folders can be expanded/collapsed by clicking

Test Plan

  1. Open preview: https://fern-preview-eda0ac98-27a0-4b19-8c63-d02ba0a94ee2.docs.buildwithfern.com/learn/docs/writing-content/components/files
  2. Scroll to "Highlighted files and folders with comments" section
  3. Expected (NOT WORKING): "components" folder, "button.mdx" file, "styles.css" file, and "README.md" file should have yellow background with comments on the right
  4. Actual: No highlighting or comments visible
  5. Inspect DOM to debug why styles aren't applying

Notes

  • Status: PR is incomplete - core functionality (highlighting and comments) is not working
  • Requested by Colton Berry (@coltondotio) via Slack
  • Link to Devin run: https://app.devin.ai/sessions/f32f9e0085974d17af5201045de6a0cb
  • The experimental.mdx-components configuration is correctly set up in docs.yml
  • Icon alignment fix is working correctly (file icons align with folder icons)
  • Folder toggle functionality is working correctly
  • Comments are automatically prefixed with "# " unless already present

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

- Add custom File, Folder, and Files components with grid layout for proper icon alignment
- Add highlighted prop to visually emphasize files/folders
- Add comment prop to display explanatory text on the right
- Add custom CSS for highlighting and comment styling
- Fix icon alignment so file icons align with folder icons

Co-Authored-By: Colton Berry <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

- Replace CSS classes with inline styles to ensure visibility
- Add backgroundColor inline style for highlighted prop
- Add color and opacity inline styles for comment text
- This ensures the styling works regardless of CSS class support

Co-Authored-By: Colton Berry <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

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