Skip to content

2.0 (The React Version)#200

Open
methnen wants to merge 46 commits intomainfrom
react-refactor
Open

2.0 (The React Version)#200
methnen wants to merge 46 commits intomainfrom
react-refactor

Conversation

@methnen
Copy link
Copy Markdown
Owner

@methnen methnen commented Mar 6, 2026

  • Refactored the Admin UI to use React for all of the interface which results in some UI performance and functionality improvements
    • Added a Copy button to the Shortcode input field
    • Height and Force vertical axis minimum fields now resize to fit their contents
  • Refactored PHP data parsing code to improve reliability and flexibility with differently formatted data
    • Number values are now parsed to extract prefix and suffix strings allowing data to always be displayed with formatting and localization while still preserving prefixes and suffixes
  • Refactored helper code as a Chart.js plugin instead of jQuery
    • Helper code now formats and parses labels as well as tooltips
  • Refactored Chart.js template to no longer be reliant on jQuery
  • Refactored the Block interface to make some performance and UI improvements
    • Reduced the number of queries required for the interface to function
    • Charts are now lazy loaded into the UI and subsequent charts are loaded as user scrolls
    • Search now accepts any reasonable values you could expect in a post title
    • Show attribute can now be controlled from the block UI
    • Better handling of charts when Chart is missing an image or M Chart performance settings have disabled images
  • Lots of additional code modernization and style improvements that didn't effect functionality but should make code easier to maintain going forward
  • Fixed an issue where a duplicate localization call could cause localization in the Block ui to not always load

methnen added 27 commits March 6, 2026 10:08
- Breaking out values into an object so we can localize the values for display while still preserving any prefix postfix values
- Assorted code modernization
- Replaced some if/elseifs with switches
- Etc...
…asily test against data from an earlier version of the plugin.
- Parts of a react code review
- Removed some old unused code
- CSS tweak
Copy link
Copy Markdown

@SevereClimate SevereClimate left a comment

Choose a reason for hiding this comment

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

Looks good! Just a couple of notes on potential library usage really, but all seems like a nice logical refactor.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is fine, but there is a jSpreadsheet React package that gives you the spreadsheet/worksheets as react components more or less ready to use.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Yeah, I thought about that. I should look and see if it makes sense to use it instead.

Copy link
Copy Markdown
Owner Author

@methnen methnen Mar 25, 2026

Choose a reason for hiding this comment

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

OK, I remember why I did it this way. It just seemed easier to control the versioning if I'm expressly wrapping the version I've included. I know build scripts can include all of that obviously, but in keeping with my previous practice of managing things like that and the chart.js stuff seperately I decided to keep it outside of the existing React package.

Also, what if I want to maybe do the table rendering later on using Jspreadsheet? Since that could be a useful method and in that case I can't rely on a React package being available to the front end.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it might be worth using the lodash library debounce function for the debouncing here, just to save on wheel reinvention, this is fine though

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

True, I had a reason I stayed with this, but I can't remember what it was...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

OK, I remember this too. My thinking was that I needed to not just debounce for changes, but also cancel requests that were potentially in process. So I mixed the two together so to speak. Maybe that doesn't make sense. But that was the thinking. Maybe I should comment that.

methnen added 2 commits March 25, 2026 16:48
- Fixed a long standing issue where a user who's editing a spreadsheet cell and submits the publish form could loose data or get an incorrectly rendered image
- Fixed an issue where empty data values could cause a fatal error in the parsing class.
methnen added 17 commits March 27, 2026 15:57
- Fixed a parsing bug that didn't handle simple data sets outside of the pie chart context
- Fixed an issue with scatter and bubble chart data
- Lots of changes/improvements to the new docs
- Fixed a bug in the bubble radius handling that caused refreshed to not get handled
- Improvements to tooltip handling
- A small tweak to Parsing to bring back single series data sets for types other than pie, etc...
- The React UI wasn't rendering the empty chart which borked things
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants