Skip to content
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

MM-63660: Added client-side filtering capability for upgrade notes and changelog #7848

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

agnivade
Copy link
Member

@agnivade agnivade commented Apr 7, 2025

We add JS and CSS code to dynamically filter the rendered
HTML files in the upgrade notes and changelog pages.

I tried several approaches here before setting down on this one.

My initial approach was to convert the .rst file to a JSON file
during the build process and then dynamically load the JSON file.
But that had issues because the .rst contents had links and code
which needed to be formatted correctly.

The second approach was to see if it's possible to template
this on the server side. This would have been the right solution
here because the current solution requires parsing through HTML
which is brittle. But unfortunately, this would require changing
the architecture of the app from a static HTML app to being served
with Python. While that is possible, it is out of scope.

Therefore, we settle down on this approach where we include JS
to filter through the rendered HTML files and apply a bit of CSS
to polish the UI.

The result works fine. But it's likely a bit brittle because of
the lack of ability to control the rendered HTML.

Most of it assisted by Claude

https://mattermost.atlassian.net/browse/MM-63660

…d changelog

We add JS and CSS code to dynamically filter the rendered
HTML files in the upgrade notes and changelog pages.

I tried several approaches here before setting down on this one.

My initial approach was to convert the .rst file to a JSON file
during the build process and then dynamically load the JSON file.
But that had issues because the .rst contents had links and code
which needed to be formatted correctly.

The second approach was to see if it's possible to template
this on the server side. This would have been the right solution
here because the current solution requires parsing through HTML
which is brittle. But unfortunately, this would require changing
the architecture of the app from a static HTML app to being served
with Python. While that is possible, it is out of scope.

Therefore, we settle down on this approach where we include JS
to filter through the rendered HTML files and apply a bit of CSS
to polish the UI.

The result works fine. But it's likely a bit brittle because of
the lack of ability to control the rendered HTML.

Most of it assisted by Claude

https://mattermost.atlassian.net/browse/MM-63660
@agnivade agnivade added 1: Dev Review Requires review by a core commiter 2: Editor Review Requires review by an editor labels Apr 7, 2025
Copy link

github-actions bot commented Apr 7, 2025

Newest code from mattermost has been published to preview environment for Git SHA 426d7a8

Copy link

github-actions bot commented Apr 7, 2025

Newest code from mattermost has been published to preview environment for Git SHA 5d0c154

@cwarnermm
Copy link
Member

@agnivade - How would I implement the drop-downs on a docs page to see this all in action? I'd like to do a quick and dirty POC.

Copy link

github-actions bot commented Apr 7, 2025

Newest code from mattermost has been published to preview environment for Git SHA 32affb8

@agnivade
Copy link
Member Author

agnivade commented Apr 7, 2025

Perhaps I didn't get you. Everything is already done in this PR.

http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/7848/upgrade/important-upgrade-notes.html
http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/7848/about/mattermost-v10-changelog.html

Were you looking for something else?

@cwarnermm
Copy link
Member

@agnivade - WOW! I didn't realize that both the changelog and the important upgrade notes had the drop-downs incorporated! That's incredible!

If we changed how the content on these pages was formatted (like the table format on the important upgrade notes page), would these drop-downs continue to work? Or are the drop-downs tied to the page formatting in some key way?

Copy link

github-actions bot commented Apr 7, 2025

Newest code from mattermost has been published to preview environment for Git SHA 4094485

@agnivade
Copy link
Member Author

agnivade commented Apr 8, 2025

Yes, that is the tradeoff here. If you make major changes, like change the table to something else, then yes it's liable to break. There is no other good solution here (as outlined in my PR message). The only proper solution is to change the app architecture to render server side and return the contents which would be a major change.

I'd say if you like this solution, we can go ahead with this. And if this kind of dynamic logic gains more popularity, we can look towards changing the app architecture.

@agnivade
Copy link
Member Author

@cwarnermm - Anything else I should be doing on this one?

@cwarnermm
Copy link
Member

One piece of feedback from our Success Team: "Maybe have a line to separate supported vs. EOL versions in the target?"

I'll share the preview in the PDE Meeting channel to invite more feedback. Let's aim to merge this next week.

Copy link

Newest code from mattermost has been published to preview environment for Git SHA 9e464c8

Copy link

Newest code from mattermost has been published to preview environment for Git SHA eae57a6

@agnivade
Copy link
Member Author

One piece of feedback from our Success Team: "Maybe have a line to separate supported vs. EOL versions in the target?"

This will need extra tracking within the rst page to differentiate what is supported and what is EOL. I'd say this is out of scope for what we are trying to do. And we probably don't even need JS for this. We should just add a static tag mentioning that release X is EOL.

@agnivade
Copy link
Member Author

@cwarnermm - PTAL

Copy link

Newest code from mattermost has been published to preview environment for Git SHA 7cf4f20

Copy link

Newest code from mattermost has been published to preview environment for Git SHA bff9d80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1: Dev Review Requires review by a core commiter 2: Editor Review Requires review by an editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants