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

Compare #5529

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open

Compare #5529

wants to merge 62 commits into from

Conversation

na9da
Copy link
Collaborator

@na9da na9da commented Jun 8, 2021

What this PR does

Implements new compare workflow.

Other changes

  • Adds ignoreSplitterWhenPicking option to MapInteractionMode. This is needed so that when user picks a filter location on the left or right and only one side has visible imagery, the interaction should still resolve the location correctly. cbf8317
  • Adds WorkflowPanel used for implementing workflows outside the workbench. https://github.com/TerriaJS/terriajs/blob/compare/lib/Styled/WorkflowPanel.tsx
  • Activates/deactivates terria timeline stack when the Timeline.jsx component mounts or unmounts.
  • Adds an index parameter to Workbench.add() method specifying the index where the item should be added -
    index: number = 0

Description

  • Implement the basic workflow based on the new designs.
  • Feature gate the workflow so that the old workflow is used by default and the new workflow is shown only when a feature flag is turned on
  • Disable location filter when interacting with the splitter or other Compare UI elements.
  • Just found a bug where the location filter does not get set the first time.
  • Use #useExperimentalCompareWorkflow hash parameter to enable this feature.
  • Write tests
  • Date picker popup should drop shadow to create some contrast when using lighter base maps.

Testing

  1. Open this CI link.
  2. Play with the workflow and try to break things

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated CHANGES.md with what I changed.

@@ -74,7 +76,7 @@ export default class TimelineStack {
});
}

destroy() {
deactivate() {
if (this._disposeClockAutorun) {
Copy link
Collaborator Author

@na9da na9da Jun 9, 2021

Choose a reason for hiding this comment

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

TimelineStack has a reaction that keeps the time of workbench items in sync with the timeline clock. Previously this reaction was created inside the constructor, so it kept running even when the Timeline.jsx component is unmounted/hidden. As a result when the user sets a date for an item, the reaction will override it with the current clock time. I have moved the reaction to a an activate method which gets called in the componentDidMount method of Timeline.jsx and created a deactivate method that gets called in unmount hook. So now, if the Timeline.jsx is not shown, the user can set dates on item without it being reset by this reaction.

public async add(
item: BaseModel | BaseModel[],
index: number = 0
): Promise<void> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added index parameter to specify the position in the workbench where we want to insert the item.

return;
}

this.insertItem(item);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved this call to later, because if the item is a reference, we need to load it first.

@@ -77,4 +78,4 @@ const BottomDock = observer(
})
);

module.exports = measureElement(BottomDock, false);
module.exports = withControlledVisibility(measureElement(BottomDock, false));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So that we can show/hide the BottomDock

@@ -16,9 +16,9 @@ import {
ObjectifiedYears
Copy link
Collaborator Author

@na9da na9da Jun 9, 2021

Choose a reason for hiding this comment

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

Changes to make the DateTimePicker more customizable... Ideally, when we have more time, we should rewrite this component.

Copy link
Collaborator

@zoran995 zoran995 left a comment

Choose a reason for hiding this comment

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

Hi @na9da I have just a small suggestion regarding the checkbox component

Comment on lines 9 to 11
top: 0.125em;
align-self: flex-start;
position: relative;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is added with an intention to force a checkbox aligned with a top row with multi-row label.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried to avoid this in feedback component
image

Comment on lines 58 to 62
<Checkbox
isChecked={item.show}
onChange={ev => onChangeSelection(item, ev.target.checked)}
label={<SelectorText medium>{item.name}</SelectorText>}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Font size should be set on the top checkbox element and text should inherit it that way we get text and checkbox icon to have the same size and they are aligned vertically.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are some changes to how the checkbox work in #5826 which enables us to easier work with text sizing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

just created a #5919 with only checkbox changes from #5826

@zoran995
Copy link
Collaborator

zoran995 commented Nov 4, 2021

@na9da We completely remove the existing compare tool from the navigation menu? I am not a fan of doing that, it will be really hard to communicate that to our users. Is there a chance to leave it but make it hidden by default, at first I understood that both options will be available and that this will be marked as experimental?

@AnaBelgun
Copy link
Member

hi @zoran995 the changes are following testing we've done with users which were very confused by the current workflow. Understandably, this is a major and we'd like to test it again before it's merged into main. We'll definitely keep you in the loop. and we'll talk about options.

@zoran995
Copy link
Collaborator

zoran995 commented Nov 4, 2021

I am afraid that it will confuse user where is option. Some of things that might be useful in new workflow :

  • Leave compare button to at least open new workflow (it will be much easier for user to find it and transition)
  • collapse option for left right dataset (big legends issue)
  • reorder of datasets

Also we lose option to put more dataset to one side and use opacity (ie street and addresses for two time periods)

p.s. I know that this is still in development but better to mention it in earlier

sidenote from above, closing and opening compare again cause something like this (compare is at 50% but the dataset is visible as it was in last compare)
image

@na9da
Copy link
Collaborator Author

na9da commented Nov 4, 2021

@zoran995 thanks for pointing out other use cases. This PR is still a WIP and I hope we will be able to address all the concerns. I'll add back the experimental flag if we merge it anytime soon.

@nf-s nf-s mentioned this pull request Feb 22, 2022
4 tasks
@nf-s nf-s mentioned this pull request Oct 26, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants