Skip to content

Add a Help page that shows MDX documentation #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025

Conversation

philipsens
Copy link
Member

I've added a simple Help page with a sidebar for topics. The topics can be entered in the help-topic-tree-items.ts

The documentation itself composes of multiple MDX files, for easy documenting.

I've added a simple Help page with a sidebar for topics. The topics can be entered in the `help-topic-tree-items.ts`

The documentation itself composes of multiple MDX files, for easy documenting.
@philipsens philipsens requested review from Matthbo and Copilot May 15, 2025 07:44
@philipsens philipsens self-assigned this May 15, 2025
@philipsens philipsens moved this from In Progress to Review in Frank!Framework May 15, 2025
@github-project-automation github-project-automation bot moved this to In Progress in Frank!Framework May 15, 2025
Copy link
Contributor

@Copilot 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 Help page that displays MDX documentation, along with a sidebar for selecting help topics. Key changes include:

  • Integrating MDX support via new rollup and React dependencies.
  • Adding several MDX documentation files and configuring routes for the Help page.
  • Implementing a new Help page with a sidebar and tree view for navigating topics.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/react/vite.config.ts Added MDX plugin to support MDX documentation.
src/main/react/package.json Updated project name and added MDX-related dependencies.
src/main/react/docs/*.mdx Added new MDX documentation files for help content.
src/main/react/app/routes/help/help.tsx Implemented the Help page with sidebar and dynamic content load.
src/main/react/app/routes/help/help-topics.tsx Introduced a tree view for help topics using a tree package.
src/main/react/app/routes/help/help-topic-tree-items.ts Defined the help topic items and linked to MDX files.
src/main/react/app/routes/editor/* Minor adjustments related to renaming and file removal.
src/main/react/app/components/navbar/* Updated navbar/menu styling and active route detection.

Copy link
Member

@Matthbo Matthbo left a comment

Choose a reason for hiding this comment

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

You really needed to a lot of markdown default css I see haha
Found a couple of small improvements that could be made, other than that it looks good

Comment on lines +112 to +119
{React.createElement(
helpTopic?.data.content ??
(() => (
<div>
The topic with id: <code>{topic}</code> does not seem to exist, it might have been moved or
deleted. Please select a different topic from the left sidebar.
</div>
)),
Copy link
Member

Choose a reason for hiding this comment

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

What's the point of doing createElement() here?
And if it's really needed, wouldn't it be nicer if it was a variable instead of having it inline like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will declare it in another variable. But I must admit that I started refactoring, so it is not possible to change anymore 😅

Comment on lines +39 to +53
renderItemArrow={({ item, context }) => {
if (!item.isFolder) {
return null
}
const Icon = context.isExpanded ? AltArrowDownIcon : AltArrowRightIcon
return (
<Icon
onClick={context.toggleExpandedState}
className="rct-tree-item-arrow-isFolder rct-tree-item-arrow fill-gray-950"
/>
)
}}
renderItemTitle={({ title }) => {
return <span className="font-inter ml-1 overflow-hidden text-nowrap text-ellipsis">{title}</span>
}}
Copy link
Member

Choose a reason for hiding this comment

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

This arrow function is pretty big, wouldn't it be nicer if the function was saved in a variable and then used here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I'll also do this in the next PR if you don't mind. Stupid of me to do such a big refactor with a PR open...

Comment on lines +1 to +6
// Used to fix import error in TypeScript
declare module '*.mdx' {
import { ComponentType } from 'react'
const component: ComponentType
export default component
}
Copy link
Member

Choose a reason for hiding this comment

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

Interesting, didn't know this could be done like that 😮

@philipsens
Copy link
Member Author

@Matthbo I'll go ahead and merge this. The feedback is resolved in the #60.

@philipsens philipsens merged commit a0f0e2f into master May 15, 2025
1 check passed
@philipsens philipsens deleted the feature/help-route branch May 15, 2025 22:21
@github-project-automation github-project-automation bot moved this from Review to Done in Frank!Framework May 15, 2025
@philipsens philipsens linked an issue May 19, 2025 that may be closed by this pull request
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add pages and a basic layout to the frontend
2 participants