Skip to content

Add enable* functions for all togglable UI features#448

Merged
gjcope merged 3 commits intoSmithsonian:masterfrom
ndejardin425:feature/enable-ui-features
Mar 26, 2026
Merged

Add enable* functions for all togglable UI features#448
gjcope merged 3 commits intoSmithsonian:masterfrom
ndejardin425:feature/enable-ui-features

Conversation

@ndejardin425
Copy link
Copy Markdown

Description:

This PR adds explicit enable*(boolean) counterparts to the existing toggle* API for all togglable UI features.

Motivation:

The existing toggle* functions don't allow setting a feature to a specific state — they only flip the current state. This makes it difficult to use the API programmatically when you need to ensure a feature is visible before performing an action (e.g. ensuring annotations are visible before activating
one).

Changes:

Adds the following functions to ExplorerApplication and MainView:

  • enableAnnotations(visible: boolean) — disables tools if enabling
  • enableReader(enabled: boolean)
  • enableTours(enabled: boolean) — disables reader if enabling, shows tour menu
  • enableTools(visible: boolean) — disables annotations if enabling
  • enableMeasurement(visible: boolean)

Each function applies the same mutual-exclusion logic as its toggle* counterpart.

Nicolas Dejardin added 2 commits March 13, 2026 11:22
Adds enableAnnotations, enableReader, enableTours, enableTools and
enableMeasurement to ExplorerApplication and MainView, mirroring the
existing toggle* API with explicit boolean control and the same
mutual-exclusion logic (annotations↔tools, tours↔reader).
@gjcope
Copy link
Copy Markdown
Collaborator

gjcope commented Mar 16, 2026

Other than the naming question discussed in #385 my only other thought is that the toggle functions should be updated to use these functions internally for clarity. But I can do that after merging.

@ndejardin425
Copy link
Copy Markdown
Author

Other than the naming question discussed in #385 my only other thought is that the toggle functions should be updated to use these functions internally for clarity. But I can do that after merging.

I've done that at first, but reverted it because I didn't know if it was a good idea. So I will redo it.

- Rename enableAnnotations/Reader/Tours/Tools/Measurement to
  setAnnotationsEnabled/setReaderEnabled/setToursEnabled/setToolsEnabled/setMeasurementEnabled
- Simplify all toggle* functions to read current state and delegate
  to their corresponding set*Enabled counterpart
- Update API docs and toggles example accordingly
@gjcope
Copy link
Copy Markdown
Collaborator

gjcope commented Mar 18, 2026

Looks great, thanks! Merged to rc-60

@gjcope gjcope merged commit 933eccb into Smithsonian:master Mar 26, 2026
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.

2 participants