-
Notifications
You must be signed in to change notification settings - Fork 599
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
base: master
Are you sure you want to change the base?
Conversation
…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
Newest code from mattermost has been published to preview environment for Git SHA 426d7a8 |
Newest code from mattermost has been published to preview environment for Git SHA 5d0c154 |
@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. |
Newest code from mattermost has been published to preview environment for Git SHA 32affb8 |
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 Were you looking for something else? |
@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? |
Newest code from mattermost has been published to preview environment for Git SHA 4094485 |
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. |
@cwarnermm - Anything else I should be doing on this one? |
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. |
Newest code from mattermost has been published to preview environment for Git SHA 9e464c8 |
Newest code from mattermost has been published to preview environment for Git SHA eae57a6 |
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. |
@cwarnermm - PTAL |
Newest code from mattermost has been published to preview environment for Git SHA 7cf4f20 |
Newest code from mattermost has been published to preview environment for Git SHA bff9d80 |
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