classifai icon indicating copy to clipboard operation
classifai copied to clipboard

Preview Language Processing Screen doesn't respect Post Types Settings.

Open ankitguptaindia opened this issue 2 years ago • 3 comments

Describe the bug

Language Processing under IBM Watson has 'Preview Language Processing' screen to show preview of language processing.

This preview screen always shows the content from WP Post although both Post Types (Post and Pages) are disabled from setting.

image

Current Behaviour

  • When Post Type is selected, it shows All WP Post
  • When Page Type is selected, it shows all WP Pages
  • But when nothing is selected, it shows all WP Posts by default.

Expected Behaviour

When no post type is selected, it should show a message like "Please select at least one Post Type to see preview"

Steps to Reproduce

Please watch the attached video

Screenshots, screen recording, code snippet

https://github.com/10up/classifai/assets/6384299/f36a11e4-1be1-46ec-b923-a448329a100e

Environment information

No response

WordPress information

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ankitguptaindia avatar Dec 13 '23 08:12 ankitguptaindia

In my opinion, previewing serves the purpose of "showcasing" the assigned terms for a particular post, irrespective of the settings. Therefore, I believe it's acceptable to display WordPress posts by default.

faisal-alvi avatar Dec 13 '23 08:12 faisal-alvi

I do think one thing that might be a nice enhancement for the previewer would be to allow it to change between enabled post types for classification to see how Watson/Embeddings works for those?

jeffpaul avatar Dec 13 '23 13:12 jeffpaul

After discussing this with @faisal-alvi we agreed that the best approach for a scenario where someone disables all Post Types there is to display a message there like:

In order to utilize the post classification feature, please enable at least one post type.

We could, if desired, also hide the settings section below if someone has no post type enabled but that's less important as showing a warning message like above.

jeffpaul avatar Jan 11 '24 17:01 jeffpaul