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

Add manual refresh button to missing plots #1754

Merged
merged 7 commits into from
May 23, 2022
Merged

Conversation

mattseddon
Copy link
Contributor

@mattseddon mattseddon commented May 23, 2022

Relates to #1649 & #1670.

This PR adds a refresh button to "missing images" in the comparison table:

image

The underlying action/message that the new button uses can be reused when we add the top ribbon into the plots webview.

Added this comment to one of the original issues re multiple plots being missing:

image

@mattseddon mattseddon added the product PR that affects product label May 23, 2022
@mattseddon mattseddon self-assigned this May 23, 2022
fillRule="evenodd"
clipRule="evenodd"
d="M4.681 3H2V2h3.5l.5.5V6H5V4a5 5 0 1 0 4.53-.761l.302-.954A6 6 0 1 1 4.681 3z"
fill="currentColor"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] I had to manually add this after running yarn svgr from the root. Did I do something wrong @sroy3?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine, it happens sometimes. It's because the svg was not created for the purpose we use it. I think we can change the config of svgr to add it for use.

url: `${this.webview.getWebviewUri(plot.url)}?${getModifiedTime(
plot.url
)}`
url: plot.url
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] We now always send the record for the revision but the URL will be undefined. We can then use the revision when we need to send something back for a manual refresh.

@mattseddon mattseddon marked this pull request as ready for review May 23, 2022 02:32
@@ -83,6 +83,9 @@ $gap: 4px;

.missing {
background-color: $bg-color;
border-style: solid;
border-width: thin;
border-color: $watermark-color;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[Q] Can anyone help me line up this bottom border:

image

?

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding vertical-align: middle to webview/src/plots/components/comparisonTable/styles.module.scss's .cell img rule gets you most of the way there:
image
top and bottom do the same, as long as it's not the default value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Zooming in on storybook does make some crazy stuff happen, though:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rogermparent is this new or existing and can it be recreated in VS Code? Just FYI, the refresh button will likely get dropped once we have the top ribbon in the webview.

Copy link
Contributor

@rogermparent rogermparent May 23, 2022

Choose a reason for hiding this comment

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

The CSS fix is something I added onto this branch locally, and I just replicated both the mostly-fixed and zoomed in weird state in VSCode itself

Normal state with new CSS (you can see the placeholder is still ~1px larger than normal plots on all sides):
image

Excessively zoomed in with new CSS:
image

Emphasis on excessively, while technically replicable in VS Code it's far from a real use case so could be considered low priority.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you

@codeclimate
Copy link

codeclimate bot commented May 23, 2022

Code Climate has analyzed commit d845caa and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.8% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit b91ffed into main May 23, 2022
@mattseddon mattseddon deleted the add-plots-refresh-button branch May 23, 2022 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants