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

SDK: Add isEditMode() and isPreviewMode() Functions #31090

Open
7 tasks
Tracked by #30943
rjvelazco opened this issue Jan 8, 2025 · 0 comments
Open
7 tasks
Tracked by #30943

SDK: Add isEditMode() and isPreviewMode() Functions #31090

rjvelazco opened this issue Jan 8, 2025 · 0 comments

Comments

@rjvelazco
Copy link
Contributor

rjvelazco commented Jan 8, 2025

Parent Issue

#30943

Overview

To improve the usability and clarity of our SDK, we need to introduce two new functions: isEditMode() and isPreviewMode(). These functions will help developers determine the current mode of the UVE (User View Environment). Each function should return a boolean value indicating whether the UVE is in edit mode or preview mode, respectively.

Background

While developing the Future Time Machine (FTM), we encountered challenges in hiding custom Edit elements within examples. Initially, the UVE was designed to only support Edit Mode. However, with the introduction of Preview Mode, the isInsideEditor function became insufficient for distinguishing between edit and preview states. Therefore, we need these two new functions to provide developers with a clear way to identify when their custom Edit tools should be displayed or hidden in the UVE.

Task

  1. Implement isEditMode() to return true if the UVE is in edit mode, otherwise false.
  2. Implement isPreviewMode() to return true if the UVE is in preview mode, otherwise false.
  3. Ensure both functions are included in the public API.
  4. Document both functions, including usage examples.
  5. Update the description of isInsideEditor to mention that it will return true if either isEditMode() or isPreviewMode() returns true.
  6. Update the examples to reflect the usage of isEditMode() and isPreviewMode().

Proposed Objective

Core Features

Proposed Priority

Priority 3 - Average

Acceptance Criteria

Acceptance Criteria

  • isEditMode() returns true when the UVE is in edit mode and false otherwise.
  • isPreviewMode() returns true when the UVE is in preview mode and false otherwise.
  • Both functions are added to the public API.
  • Documentation for both functions is complete and includes usage examples.
  • The isInsideEditor description is updated to mention isEditMode() and isPreviewMode().
  • Examples are updated to demonstrate the use of isEditMode() and isPreviewMode().
  • All changes are thoroughly tested to ensure correct functionality.

Documentation

  • Provide clear documentation for isEditMode() and isPreviewMode(), explaining their purpose and usage.
  • Include code examples demonstrating how to use each function.
  • Update the isInsideEditor documentation to reference isEditMode() and isPreviewMode().
@rjvelazco rjvelazco changed the title SDK: Add isEditMode() and isPreviewMode() Functions SDK: Add isEditMode() and isPreviewMode() Functions Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

1 participant