feat: render readme.md file at the top of folder#1708
Conversation
Renders the readme.md file at to the top each folder if present.
There was a problem hiding this comment.
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
ListHeadercomponent to render README.md content with collapsible functionality - Integrated README.md detection and rendering into the
GenericSpaceview - 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) { |
There was a problem hiding this comment.
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.
kulmann
left a comment
There was a problem hiding this comment.
Awesomeness levels are rising over 9000 🚀
…ders feat: render readme.md file at the top of folder
|
Nice feature! As extension: also parse a hidden .readme.md ? |
Thanks for the suggestion, I like the idea! Solved via #1769 |
Renders the readme.md file at to the top each folder if present.