Skip to content
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

dev-tv/fix-offscreen-entity: Fixes #7 caused by UpdateDimensions() wrong height #17

Merged
merged 10 commits into from
Jun 18, 2024

Conversation

villagrat
Copy link
Collaborator

@villagrat villagrat commented Jun 11, 2024

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 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

  1. Pull the changes from the branch dev-tv/fix-outcome-entity-displayed-offscreen.
  2. Run the application.
  3. Create a new entity or model.
  4. 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.

@villagrat villagrat requested a review from Sakelun June 11, 2024 18:09
@villagrat villagrat changed the title dev-tv/fix-offscreen-entity: Fixes #7 caused by UpdateDimensions() wrong height DRAFT: dev-tv/fix-offscreen-entity: Fixes #7 caused by UpdateDimensions() wrong height Jun 11, 2024
@villagrat villagrat linked an issue Jun 11, 2024 that may be closed by this pull request
@villagrat villagrat force-pushed the dev-tv/fix-offscreen-entity branch from 754fb3c to d66e014 Compare June 11, 2024 21:01
Base automatically changed from dev-vertex/nodejs-18-upgrade to dev June 12, 2024 18:47
villagrat-ncb and others added 7 commits June 14, 2024 14:46
note: eslint is used for "live linting" only in the editor
- remove 'no-unescaped-entities' rule because it's an unnecessary guard for experienced dev
- change ecmaVersion from 2018 to 2020 to support optional chaining changes to MEMEstyles
- remove "prettier/react" eslint plugin rule extension to remove warning; prettier/react is now part of prettier eslint plugin.
@Sakelun Sakelun changed the base branch from dev to dev-vertex June 18, 2024 17:32
@Sakelun Sakelun merged commit 94083aa into dev-vertex Jun 18, 2024
@Sakelun Sakelun changed the title DRAFT: dev-tv/fix-offscreen-entity: Fixes #7 caused by UpdateDimensions() wrong height dev-tv/fix-offscreen-entity: Fixes #7 caused by UpdateDimensions() wrong height Jun 18, 2024
@Sakelun Sakelun deleted the dev-tv/fix-offscreen-entity branch June 18, 2024 17:46
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.

New outcome/entity is displayed offscreen
4 participants