-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
extension/src/commands/util.ts
Outdated
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.
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}> |
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 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.
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 = () => |
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 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.
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.
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.
Are we still keeping this?
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 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.
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.
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.
@@ -75,6 +76,14 @@ export const Ribbon: React.FC = () => { | |||
text={`${revisions.length} of ${MAX_NB_EXP}`} | |||
/> | |||
</li> | |||
<li className={styles.buttonWrapper}> |
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.
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 = () => |
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.
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
TOP_LEVEL = 'top-level' | ||
} | ||
|
||
export const addPlotCommand = async (context: Context) => { |
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] 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).
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.
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 🤔
Resolved comments and re-requesting reviews since quite a bit of the solution has been updated! cc @mattseddon |
enablePlotCreation, | ||
hasAddedPlots | ||
} = useSelector((state: PlotsState) => state.custom) | ||
const { plotsIds, nbItemsPerRow, isCollapsed, height, hasAddedPlots } = |
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.
Similar blocks of code found in 3 locations. Consider refactoring.
This reverts commit ec3c5ed.
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. |
Demo
https://github.com/iterative/vscode-dvc/assets/43496356/62dad7cc-df0d-4051-a79e-981fe02f68fehttps://github.com/iterative/vscode-dvc/assets/43496356/5e50305c-c30a-4406-a27f-5c5af7e6f922Screen.Recording.2023-09-20.at.7.21.17.AM.mov
To Do
Part of #4654