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

Added a new optional callback when the panel has completed transitioning and is fully opened #1368

Conversation

Alex-NRCan
Copy link
Member

@Alex-NRCan Alex-NRCan commented Oct 6, 2023

Description

For the purpose of using HTML canvas drawing (notably for the GeoChart), I needed to know when the panel has completed expanding, to force a redraw of the canvas. Of course, this PR focuses on implementing the callback logic without knowledge of the specific reason for the callback. It can serve other purposes too.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested as part of the GeoChart plugin.

Checklist:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@Alex-NRCan Alex-NRCan force-pushed the feat-panel-opened-callback branch 2 times, most recently from 78bfcff to fb505d5 Compare October 11, 2023 16:14
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r1, 4 of 5 files at r2, all commit messages.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan)


packages/geoview-core/src/ui/panel/panel.tsx line 104 at r2 (raw file):

 * The transition period it takes for the panel to slide in
 */
const TRANSITION_PERIOD = 300;

If we put this constant in a new file in ui style and export it from there. We can reuse in theme and in this file. This way, we are sure theme is not modified and panel does not follow?

… transition

Reworked panel opened handle
Now using 'useTheme()' instead to set the transition value of the panel (originally was hardcoded to 300 in panel.tsx) AND to the callback timer using the value from the theme.
@Alex-NRCan Alex-NRCan force-pushed the feat-panel-opened-callback branch from 9ebffd0 to f2c6454 Compare October 12, 2023 21:10
@Alex-NRCan Alex-NRCan self-assigned this Oct 12, 2023
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan)

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Alex-NRCan)

@jolevesq jolevesq merged commit 54d5ed8 into Canadian-Geospatial-Platform:develop Oct 13, 2023
5 checks passed
@Alex-NRCan Alex-NRCan deleted the feat-panel-opened-callback branch October 18, 2023 15:57
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