Skip to content

Conversation

@JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Dec 4, 2025

Renders the readme.md file at to the top each folder if present.

image

Renders the readme.md file at to the top each folder if present.
@JammingBen JammingBen marked this pull request as ready for review December 4, 2025 11:21
Copilot AI review requested due to automatic review settings December 4, 2025 11:21
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 adds functionality to display README.md files at the top of folders. When a README.md file is present in a folder, it is rendered as a collapsible markdown preview above the file list.

Key changes:

  • Added a new ListHeader component to render README.md content with collapsible functionality
  • Integrated README.md detection and rendering into the GenericSpace view
  • Fixed TextEditor styling to remove top margin from markdown previews

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/web-app-files/src/components/FilesList/ListHeader.vue New component that loads and displays README.md content with expand/collapse functionality
packages/web-app-files/src/views/spaces/GenericSpace.vue Integrates ListHeader component and detects README.md files in the current folder
packages/web-pkg/src/components/TextEditor/TextEditor.vue Wraps preview in article tag and removes top margin from first child in markdown preview

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

unref(markdownContainerRef).classList.remove('collapsed')
const markdownContainerHeight = unref(markdownContainerRef).offsetHeight
if (markdownContainerHeight < 300) {
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The magic number 300 appears twice (lines 12 and 63) for the collapse threshold. Extract this into a named constant to improve maintainability and ensure consistency.

Copilot uses AI. Check for mistakes.
@JammingBen JammingBen requested a review from kulmann December 4, 2025 11:25
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Can I has unit tests? 😆

@JammingBen JammingBen requested a review from kulmann December 5, 2025 13:24
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Awesomeness levels are rising over 9000 🚀

@kulmann kulmann merged commit ce4fe40 into main Dec 5, 2025
28 checks passed
@kulmann kulmann deleted the feat/render-readme-for-folders branch December 5, 2025 14:40
openclouders pushed a commit that referenced this pull request Dec 5, 2025
…ders

feat: render readme.md file at the top of folder
@openclouders openclouders mentioned this pull request Dec 5, 2025
1 task
@openclouders openclouders mentioned this pull request Dec 15, 2025
1 task
@pass-33
Copy link

pass-33 commented Dec 16, 2025

Nice feature!

As extension: also parse a hidden .readme.md ?

@JammingBen
Copy link
Contributor Author

Nice feature!

As extension: also parse a hidden .readme.md ?

Thanks for the suggestion, I like the idea! Solved via #1769

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants