-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: drawing tile navigator panel (PT-185987214) #2416
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2416 +/- ##
==========================================
+ Coverage 85.38% 86.29% +0.91%
==========================================
Files 742 745 +3
Lines 38379 38485 +106
Branches 9801 9823 +22
==========================================
+ Hits 32769 33212 +443
+ Misses 5304 4972 -332
+ Partials 306 301 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
collaborative-learning Run #13981
Run Properties:
|
Project |
collaborative-learning
|
Run status |
Passed #13981
|
Run duration | 14m 47s |
Commit |
e50c2a4810: chore: remove IDrawingTileProps import
|
Committer | Ethan McElroy |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
3
|
Skipped |
0
|
Passing |
115
|
78b3d4a
to
e134304
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation shows a rendundant duplicate of whatever portion of the drawing canvas is currently visible in the main tile. The spec is rather unclear, but I do not think that is what we want.
I think we want to make this work like the Diagram tile, where the navigator panel always shows all the content, even if the main tile is zoomed in so that some content is invisible. In that case, a box is drawn within the navigator to show what portion of the content is visible. Here is a screenshot of the diagram tile showing what I mean. It's not super obvious because of the low contrast grey-on-grey, but you can see the two full "variable" boxes in the navigator panel, even though they are not fully visible in the main tile.
…nder prop instead of cloneElement, comments
This uses applySnapshot to update the class users in place. This will make code using these users more efficient since they can just observer the user properties for changes.
Original the MST environment was avoided because I was planning to switch this store to just be MobX. However the group store needs to be synced with the data from the database, and it is easier to do that using MST than MobX.
This uses applySnapshot to sync the changes from the DB. This way the existing objects are updated instead of creating new ones. I also missed a change in stores when committing the last set of changes.
This will allow us to update the users later and have the group views automatically update without having to also update the group user objects. This also removes the option to skip unknown students. They are part of the group so we should show them even if we don't know who they are yet.
We use a timestamp for when the class information is retrieved from the portal. And compare this to the timestamp in the groupUser to figure out if this groupUser is older than the class info or newer than the class info.
The portal service object provides a place to store portal info like JWTs, and methods that use and update this info. This new object is used to refresh the class info if necessary after updating the group info from Firebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good!
The only thing that's important to fix is that there shouldn't be any imports that cause plugin code to be loaded from non-plugin code, see specific comments below.
|
||
cy.log("Move tile navigator to the top of the drawing tile in a quick animation"); | ||
tileNavigator.getTileNavigatorPlacementButton().click(); | ||
cy.wait(300); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need the explicit wait
here (or in line 70), since Cypress will automatically wait up to its timeout for a condition to become true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that's true generally, but found these were required to make the test pass consistently. I believe it has something to do with how the component waits for the animation to complete before updating the model which is what causes the class name to change. I'm not sure why explicitly setting a wait makes it always work. I did spend some time looking into it but wasn't able to figure out a way to make them unnecessary. For now at least I'd like to leave them so I can complete the main task.
@@ -6,10 +6,11 @@ class DrawToolTile{ | |||
return cy.get(`${workspaceClass || ".primary-workspace"} .editable-tile-title-text`); | |||
} | |||
getDrawTileComponent(){ | |||
return cy.get('.primary-workspace [data-testid=drawing-tool]'); | |||
return cy.get('.primary-workspace [data-testid=drawing-tool]') | |||
.not('[data-testid="tile-navigator"] [data-testid=drawing-tool]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why some use quotes inside the brackets and some don't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that was just me being a bit inconsistent. Since they're not needed, I've removed them. Thanks for catching that.
import { BoundingBox } from "../../plugins/drawing/model/drawing-basic-types"; | ||
import { IDrawingTileProps } from "../../plugins/drawing/components/drawing-tile"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no dependencies from core (non-plugin) code into plugins, this will cause plugins to be loaded when they are not needed.
@@ -0,0 +1,45 @@ | |||
import { types, Instance, SnapshotIn } from "mobx-state-tree"; | |||
|
|||
import { BoundingBox } from "../../plugins/drawing/model/drawing-basic-types"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this dependency on a plugin.
|
||
import { ITileProps } from "./tile-component"; | ||
import { BoundingBox, NavigatableTileModelType } from "../../models/tiles/navigatable-tile-model"; | ||
import { IDrawingTileProps } from "../../plugins/drawing/components/drawing-tile"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One plugin dependency still to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good 👍
#185987214
The tile navigator panel is a scaled-down clone of the tile content area. The panel can be added or removed using a new toolbar button.
For now the panel is only an option for the drawing tile, and it only shows the content of the tile. Panning buttons will be added to the navigator in a separate piece of work.