IDEMSInternational / R-Instat

A statistics software package powered by R
http://r-instat.org/
GNU General Public License v3.0
38 stars 102 forks source link

Redefining Output Elements in Relation to Script Associations #8948

Open Patowhiz opened 2 months ago

Patowhiz commented 2 months ago

@volloholic @ChrisMarsh82 @rdstern

After a recent request by @rdstern about supporting commands that return multiple html outputs, I realised there is a broader question that needs to be discussed before attempting this task.

We need to clarify how we define the data structure for each output element displayed in the output window. Previously, an output was categorized simply as a script, text, image, or HTML. However, I now see the need to associate each script directly with its corresponding outputs, with script potentially having outputs or none.

Here are the options to consider for the data structure behind each output:

  1. Separate Output Elements for Script and Outputs: Each executed command results in multiple elements— one for the script and additional ones for each output (text, image, HTML). This approach aligns with our current system and facilitates rapid implementation of the multiple outputs per script ( as attempted by @N-thony PR #8929).
  2. Unified Output Element for Script and Associated Outputs: Each command produces a single element that includes both the script and its outputs. This approach would streamline our data structures, allowing the script and output windows to utilize the same underlying output logger, enhancing integration and potentially supporting better UX changes and additions (like eliminating the need to toggle commands on and off in the output window)

The decision affects not only the display controls in the output window but also the design of outputs selection and the integration of data structures between the script and output windows.

I recommend the second option as it offers several advantages, including a more integrated user interface and the potential to redesign the output window for better usability. This option, though potentially more complex initially, aligns with our long-term goals for system coherence.

Please share your thoughts on which approach would best suit our objectives, especially considering the integration and usability enhancements we aim to achieve.