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

Merge create plot commands #4680

Merged
merged 10 commits into from
Sep 20, 2023
Merged

Merge create plot commands #4680

merged 10 commits into from
Sep 20, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Sep 18, 2023

  • combine "Add Custom Plot" and "Add Plot" command into one. This adds an explanation for the "file selector" that appears when you add a top-level plot and simplifies some logic.

Demo

https://github.com/iterative/vscode-dvc/assets/43496356/62dad7cc-df0d-4051-a79e-981fe02f68fe

https://github.com/iterative/vscode-dvc/assets/43496356/5e50305c-c30a-4406-a27f-5c5af7e6f922

Screen.Recording.2023-09-20.at.7.21.17.AM.mov
image image image

To Do

  • Rename "top-level" to "Data Series"

Part of #4654

@julieg18 julieg18 added the product PR that affects product label Sep 18, 2023
@julieg18 julieg18 self-assigned this Sep 18, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better place for these two commands that are registered in extension.ts? I couldn't think of a place that didn't feel confusing 🤔

@@ -75,6 +76,14 @@ export const Ribbon: React.FC = () => {
text={`${revisions.length} of ${MAX_NB_EXP}`}
/>
</li>
<li className={styles.buttonWrapper}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example with primary colors:

Screenshot 2023-09-18 at 9 44 19 AM

Copy link
Member

Choose a reason for hiding this comment

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

As per the guidelines there should only be one primary button. I think Having Add Plot as the primary button now makes more sense than the revision selector but up to you.

})

export const addPipelinePlot = () => {
export const addCustomPlot = () =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose to keep the add plot button in the custom section since we still have the trash icon there, so I thought it made sense to have the add button next to it.

image

But we can remove it if preferred.

Copy link
Member

Choose a reason for hiding this comment

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

If you think the UX is better then it is ok to leave and we can even keep the add plot button above the Data Series section but do keep in mind that we will to maintain this code. Any code that runs can eventually cause bugs.

Copy link
Member

Choose a reason for hiding this comment

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

Are we still keeping this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought we agreed to keep it for now, but it wouldn't be the first time I misunderstood what was said in a meeting 😊. I'll go ahead and take off the + button. The addCustomPlot util would stay since we use it in the error screen.

Copy link
Contributor Author

@julieg18 julieg18 Sep 20, 2023

Choose a reason for hiding this comment

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

Actually, after testing it, I think we should keep it for now until we add a button to our "No Plots Added" screen. I was going to do that in a separate pr since it's only partially related to this pr plus this one is getting on the larger side at this point.

@julieg18 julieg18 marked this pull request as ready for review September 18, 2023 16:53
@julieg18 julieg18 requested a review from shcheklein September 18, 2023 16:55
@@ -75,6 +76,14 @@ export const Ribbon: React.FC = () => {
text={`${revisions.length} of ${MAX_NB_EXP}`}
/>
</li>
<li className={styles.buttonWrapper}>
Copy link
Member

Choose a reason for hiding this comment

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

As per the guidelines there should only be one primary button. I think Having Add Plot as the primary button now makes more sense than the revision selector but up to you.

})

export const addPipelinePlot = () => {
export const addCustomPlot = () =>
Copy link
Member

Choose a reason for hiding this comment

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

If you think the UX is better then it is ok to leave and we can even keep the add plot button above the Data Series section but do keep in mind that we will to maintain this code. Any code that runs can eventually cause bugs.

extension/src/commands/util.ts Outdated Show resolved Hide resolved
extension/src/commands/util.ts Outdated Show resolved Hide resolved
extension/src/commands/util.ts Outdated Show resolved Hide resolved
TOP_LEVEL = 'top-level'
}

export const addPlotCommand = async (context: Context) => {
Copy link
Member

Choose a reason for hiding this comment

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

[I] These should go in a new plots/quickPick file. Can you also please check to see if we will get two analytics events each time this is called (I don't think we want that).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you also please check to see if we will get two analytics events each time this is called (I don't think we want that).

Oh, I think we would get two since addPlot fires one and then "add custom"/"add pipeline" would fire another. We could remove the "add custom" and "add pipeline" commands and add a type argument to the "add plot" command 🤔

extension/src/extension.ts Outdated Show resolved Hide resolved
@julieg18
Copy link
Contributor Author

Resolved comments and re-requesting reviews since quite a bit of the solution has been updated! cc @mattseddon

@julieg18 julieg18 requested a review from mattseddon September 19, 2023 15:47
enablePlotCreation,
hasAddedPlots
} = useSelector((state: PlotsState) => state.custom)
const { plotsIds, nbItemsPerRow, isCollapsed, height, hasAddedPlots } =
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Sep 20, 2023

Code Climate has analyzed commit 0aeb1cc and detected 0 issues on this pull request.

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

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

View more on Code Climate.

@julieg18 julieg18 enabled auto-merge (squash) September 20, 2023 12:42
@julieg18 julieg18 merged commit f6654fd into main Sep 20, 2023
3 checks passed
@julieg18 julieg18 deleted the merge-create-plot-commands branch September 20, 2023 12:45
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.

2 participants