This PR fixes #7 where entities and models were being displayed offscreen when created. The issue was identified in the ViewMain.jsx file and has been addressed by modifying the calculation of viewHeight. Also we applied the styled util to a container <div /> element on ViewMainto avoid new entities/outcomes be covered by the sidebar
User-visible changes:
Entities and models are now correctly displayed within the screen boundaries when created.
Developer-relevant changes:
The calculation of viewHeight in ViewMain.jsx has been modified.
Testing Steps
Pull the changes from the branch dev-tv/fix-outcome-entity-displayed-offscreen.
Run the application.
Create a new entity or model.
Verify that the new entity or model is displayed within the screen boundaries.
Technical Notes
Changes to viewHeight calculation:
The line viewHeight: Math.min(viewHeight, innerHeight) was using Math.min to calculate the viewHeight. This was causing the container height to be set to 0, putting newly created entities offscreen when either viewHeight or innerHeight was 0. The calculation has been changed to use Math.max instead, ensuring that viewHeight is the larger of the two values.
Summary
This PR fixes #7 where entities and models were being displayed offscreen when created. The issue was identified in the
ViewMain.jsx
file and has been addressed by modifying the calculation ofviewHeight
. Also we applied thestyled
util to a container<div />
element onViewMain
to avoid new entities/outcomes be covered by the sidebarUser-visible changes:
Entities and models are now correctly displayed within the screen boundaries when created.
Developer-relevant changes:
The calculation of
viewHeight
inViewMain.jsx
has been modified.Testing Steps
Technical Notes
Changes to
viewHeight
calculation:The line
viewHeight: Math.min(viewHeight, innerHeight)
was usingMath.min
to calculate theviewHeight
. This was causing the container height to be set to 0, putting newly created entities offscreen when eitherviewHeight
orinnerHeight
was 0. The calculation has been changed to use Math.max instead, ensuring thatviewHeight
is the larger of the two values.