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

Inline viewer improvements #6504

Merged
merged 15 commits into from
Jun 6, 2024
Merged

Inline viewer improvements #6504

merged 15 commits into from
Jun 6, 2024

Conversation

jprochazk
Copy link
Member

@jprochazk jprochazk commented Jun 5, 2024

What

  • Convert the web-viewer package to TypeScript (from JS + JSDoc)
  • Add events to WebViewer:
    • fullscreen
    • ready
  • Improve fullscreen transition
  • Hide panel toggle buttons if they are inactive due to overrides

Animations across updates to position don't really work that properly. I had to hack around it in this PR by using setTimeout/requestAnimationFrame to give the browser a chance to update the position CSS property before updating any other styles.

Preview:

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jprochazk jprochazk added 🕸️ web regarding running the viewer in a browser exclude from changelog PRs with this won't show up in CHANGELOG.md labels Jun 5, 2024
@jprochazk jprochazk marked this pull request as ready for review June 6, 2024 11:30
@jprochazk jprochazk marked this pull request as draft June 6, 2024 11:31
@jprochazk jprochazk marked this pull request as ready for review June 6, 2024 11:50
jprochazk and others added 2 commits June 6, 2024 14:29
@@ -73,12 +73,18 @@ impl WebHandle {
}

#[wasm_bindgen]
pub fn toggle_panel_overrides(&self) {
pub fn toggle_panel_overrides(&self, value: Option<bool>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the existence of this API as a toggle (as opposed to just something like set_panel_overrides_active) to be a bit unexpected.

I'm glad to see us turning it into a hybrid set/toggle, though the name as toggle still seems like it might hurt discoverability / expectation somewhat.

UICommand::ToggleSelectionPanel.format_shortcut_tooltip_suffix(ui.ctx())
))
.clicked()
if !app_blueprint.selection_panel_overridden()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR since the logic probably adds too much complexity, but I think we may want to reconsider this at some point and have this be something like: !app_blueprint.selection_panel_hidden()

It would be nice if the state was determine by:

  • If hidden, never show it -- no UI controls.
  • If user has interacted with the controls, use that value.
  • If overridden from JS, apply that value.
  • If the blueprint has a value, apply that value.

@jprochazk jprochazk merged commit 9b9ccab into main Jun 6, 2024
31 of 32 checks passed
@jprochazk jprochazk deleted the jan/inline-viewer-fixes branch June 6, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🕸️ web regarding running the viewer in a browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants